buglibffcall - foreign function call libraries - Bugs: bug #32466, segfault


bug #32466: segfault

Submitted by:  Andrey Kutejko <andy128k>
Submitted on:  Sun 13 Feb 2011 11:06:05 PM UTC  
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: Bruno Haible <haible>
Open/Closed: Open

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


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.

Sam Steingold <sds>
Project Administrator
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.

Andrey Kutejko <andy128k>
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

are you reporting a bug in the released version or in cvs head?

Sam Steingold <sds>
Project Administrator
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)

Andrey Kutejko <andy128k>
Sun 13 Feb 2011 11:06:05 PM UTC, original submission:
Andrey Kutejko <andy128k>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

Attached Files
file #22679:  test_callback.c added by andy128k (457B - text/x-csrc)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by sds (Posted a comment)
  • -unavailable- added by andy128k (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 13 Feb 2011 11:59:43 PM UTCsdsAssigned toNone=>haible
    Sun 13 Feb 2011 11:12:00 PM UTCandy128kAttached File-=>Added test_callback.c, #22679
      Attached File-=>Added 0001-fix-callback-on-x86_64.patch, #22680

    Back to the top

    Powered by Savane 3.1-cleanup