(
Jump to the original submission)
Sat 11 Feb 2017 03:07:22 PM UTC, comment #6:
I've reverted the fix and installed a simpler one instead:
http://git.savannah.gnu.org/gitweb/?p=libffcall.git;a=commit;h=ef490587eb5ccd58e4534fa596a9215a681caf57
|
Mon 02 Jan 2017 10:52:45 PM UTC, comment #5:
Re Sam:
> packaging libffcall as a shared library is a mistake.
I disagree. There is a move to position-independent code in the industry (think of ASLR). And when security bugs need to be fixed, you don't want to recompile all packages that use the library. So, compiling libffcall as a shared library should be made possible.
Re Andrey:
> Some code from ld.so corrupts r10 register which is used to pass callback data.
Yup. It's the routine, in ld.so, which resolves the address of function.
I found your patch (0001-fix-callback-on-x86_64.patch) very inspiring. Sure, it is wrong because it does not respect the required alignment of %rsp. But what I like about it is the ability to insert arbitrary instructions at the beginning of the function __vacall_r.
Now fixed for x86_64 and other CPU types through http://git.savannah.gnu.org/gitweb/?p=libffcall.git;a=commit;h=cb99e282fc978c77c4fb44d7965b331b89dd55ac
|
Mon 14 Feb 2011 03:56:39 AM UTC, comment #4:
packaging libffcall as a shared library is a mistake.
see libffcall/README
I will leave it to Bruno to decide whether to accept the patch.
|
Mon 14 Feb 2011 12:16:49 AM UTC, comment #3:
I use CVS snaphot 1.10+cvs20100619 (Debian Unstable).
There is no segfault when libcallback is linked as static library. But program crashes when libcallback is linked as shared library.
Some code from ld.so corrupts r10 register which is used to pass callback data.
|
Sun 13 Feb 2011 11:59:43 PM UTC, comment #2:
wfm on Linux sysu76 2.6.32-28-generic #55-Ubuntu SMP Mon Jan 10 23:42:43 UTC 2011 x86_64 GNU/Linux
and cvs head of ffcall:
$ gcc -I ~/src/top/include/ test_callback.c ~/src/top/lib/libvacall.a ~/src/top/lib/libtrampoline.a ~/src/top/lib/libcallback.a -o test_callback.exe
$ ./test_callback.exe
data = 0xbebebe: 2 + 3 = 5
5
$
are you reporting a bug in the released version or in cvs head?
|
Sun 13 Feb 2011 11:12:00 PM UTC, comment #1:
libcallback.so crashes on amd64.
I attach simple program which reproduces an error and a patch.
(file #22679, file #22680)
|
Sun 13 Feb 2011 11:06:05 PM UTC, original submission:
|
(Note: upload size limit is set to 16384 kB, after insertion of the required
escape characters.)
Attach File(s):
Comment:
Depends on the following items: None found
Items that depend on this one: None found
Follow 6 latest changes.