This is the mail archive of the
libffi-discuss@sourceware.org
mailing list for the libffi project.
Re: pass by value and also snprintf()
- From: Bruce Korb <bruce dot korb at gmail dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: libffi-discuss at sourceware dot org
- Date: Mon, 27 Apr 2015 10:48:08 -0700
- Subject: Re: pass by value and also snprintf()
- Authentication-results: sourceware.org; auth=none
- References: <CAKRnqNK1D9Wp3uedW62uVk-5FCfzGgDd0xOA2W9qMQeizV1TSw at mail dot gmail dot com> <553E6D2E dot 7060403 at redhat dot com> <CAKRnqNJtEj_VvXNrF=QXteJAwAYmKZ3K1PAxtb35hY43Nr0ezw at mail dot gmail dot com> <CAKRnqNL8L77vGkzZrA8Tbcrv8Y3u2J-LCu=r5=bppOVgWSve4A at mail dot gmail dot com>
The GDB result (using snprintf this time):
(gdb)
37 if (ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 3, 5,
(gdb)
41 ffi_call(&cif, fn, &ret_val, values);
(gdb)
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff787f562 in vsnprintf () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) bt
#0 0x00007ffff787f562 in vsnprintf () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x00007ffff7861532 in snprintf () from /lib/x86_64-linux-gnu/libc.so.6
#2 0x00007ffff7bd7adc in ffi_call_unix64 () from
/usr/lib/x86_64-linux-gnu/libffi.so.6
#3 0x00007ffff7bd740c in ffi_call () from /usr/lib/x86_64-linux-gnu/libffi.so.6
#4 0x0000000000400ac0 in main (argc=1, argv=0x7fffffffe488) at ffi-test.c:41
If I link against the -O0 -ggdb3 version of libffi, what can I do to
help diagnose?