buglibsigsegv - Bugs: bug #27475, libsigsegv 2.7 fails to 'make...

 
 

bug #27475: libsigsegv 2.7 fails to 'make check' on linux on amd64

Submitter:  None
Submitted:  Fri 18 Sep 2009 03:37:15 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fix Released
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 17 Oct 2009 05:08:08 PM UTC, comment #4: 

Paolo Bonzini committed his fix on 2009-09-22.

Bruno Haible <haible>
Group administrator
Tue 22 Sep 2009 08:03:53 AM UTC, comment #3: 

I attached a patch that fixes the bug.  The difference seems to be whether the mystack variable is allocated at the top (-O1) or the bottom (-O2) of the stack frame:

example: -O1

(insn 5 4 6 3 ../../../sigsegv/tests/stackoverflow2.c:118 (set (mem/s/j/c:DI (plus:DI (reg/f:DI 54 virtual-stack-vars)
                (const_int -8328 [0xffffffffffffdf78])) [0 rl.rlim_max+0 S8 A64])

while -O2 is like this

(insn 5 4 6 3 ../../../sigsegv/tests/stackoverflow2.c:118 (set (mem/s/c:DI (plus:DI (reg/f:DI 54 virtual-stack-vars)
                (const_int -8 [0xfffffffffffffff8])) [4 rl.rlim_max+0 S8 A64])

The -O2 choice is actually better (more smaller offsets, and smaller code size) but apparently triggers some ABI violation or something like that; the produced code is fine.

Paolo Bonzini <bonzini>
Tue 22 Sep 2009 07:16:28 AM UTC, comment #2: 

Hello Bruno,

I've done some testing (not exacly debugging) this morning and I see that with -O2 it fails, but with -O1, -O3 or with -O1 wit the -O2 -f<foo> options enabled it works.

So I think we can assume that this is in fact a GCC bug, right?

Output:

~/libsigsegv-test/libsigsegv-2.7/tests :) $ rm stackoverflow2.o stackoverflow2 ;  gcc -DHAVE_CONFIG_H -I. -I.. -I../src -g -O1 -falign-jumps -falign-labels -falign-loops -fcaller-savees -fcrossjumping -fcse-follow-jumps -fdelete-null-pointer-checks -fexpensive-optimizations -fforward-propagate -finline-small-functions -foptimize-register-move -foptimize-sibling-calls -fpeephole2 -freggmove -freorder-blocks -freorder-functions -fschedule-insns2 -fstrict-aliasing -fthread-jumps -ftree-pre -ftree-store-ccp -fno-tree-vrp  -c stackoverflow2.c && gcc-4.1 -g -O2 -o stackoverflow2 stackoverfllow2.o ../src/.libs/libsigsegv.a -lc  ; ./stackoverflow2


Starting recursion pass 1.
Stack overflow 1 caught.
Starting recursion pass 2.
Stack overflow 2 caught.
Segmentation violation correctly detected.
Segmentation violation correctly detected.
Test passed.
~/libsigsegv-test/libsigsegv-2.7/tests :) $ rm stackoverflow2.o stackoverflow2 ;  gcc -DHAVE_CONFIG_H -I. -I.. -I../src -g -O1 -c stackoverflow2.c && gcc-4.1 -g -O2 -o stackoverflow2 stackoverfllow2.o ../src/.libs/libsigsegv.a -lc  ; ./stackoverflow2

Starting recursion pass 1.
Stack overflow 1 caught.
Starting recursion pass 2.
Stack overflow 2 caught.
Segmentation violation correctly detected.
Segmentation violation correctly detected.
Test passed.
~/libsigsegv-test/libsigsegv-2.7/tests :) $ rm stackoverflow2.o stackoverflow2 ;  gcc -DHAVE_CONFIG_H -I. -I.. -I../src -g -O3 -c stackoverflow2.c && gcc-4.1 -g -O2 -o stackoverflow2 stackoverfllow2.o ../src/.libs/libsigsegv.a -lc  ; ./stackoverflow2

Starting recursion pass 1.
Stack overflow 1 caught.
Starting recursion pass 2.
Stack overflow 2 caught.
Segmentation violation correctly detected.
Segmentation violation correctly detected.
Test passed.
~/libsigsegv-test/libsigsegv-2.7/tests :) $ rm stackoverflow2.o stackoverflow2 ;  gcc -DHAVE_CONFIG_H -I. -I.. -I../src -g -O2 -c stackoverflow2.c && gcc-4.1 -g -O2 -o stackoverflow2 stackoverfllow2.o ../src/.libs/libsigsegv.a -lc  ; ./stackoverflow2

Starting recursion pass 1.
Stack overflow 1 caught.
Starting recursion pass 2.
Stack overflow 2 caught.
Segmentation fault

Anonymous
Sat 19 Sep 2009 02:33:44 PM UTC, comment #1: 

On an x86_64 / Linux 2.6.25.5 system, the build and "make check"
of libsigsegv-2.7 passes for me.

The crash of stackoverflow2 happens on the way back from the
"Stack overflow 2 caught" message to the main program. I have
rarely seen it crash at that point. Therefore some debugging
is needed. Can you do the debugging, or give me access to such
a machine?

Bruno Haible <haible>
Group administrator
Fri 18 Sep 2009 03:37:15 AM UTC, original submission:  

Hello,

as you asked in your email I've opened a case here.

Building the library on amd64 works, but the self-tests fail.

Please see attached build log with also the contents of the files you requested.

Best regards, Peter

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #18752:  libsigsegv-stack-failure-fix.patch added by None (1KiB - application/octet-stream - patch fixing the bug)
file #18732:  buildlog-on-amd64.txt added by None (155KiB - text/plain - build log on amd64)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rdieter
  • -email is unavailable- added by bonzini (Posted a comment)
  • -email is unavailable- added by haible (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-01-04 haible StatusFixed Fix Released
        Assigned tobonzini None
    2009-10-17 haible StatusNeed Info Fixed
        Assigned tohaible bonzini
        Open/ClosedOpen Closed
    2009-09-22 rdieter Carbon-Copy- Added rdieter
    2009-09-22 None Attached File- Added libsigsegv-stack-failure-fix.patch, #18752
    2009-09-19 haible Assigned toNone haible
        StatusNone Need Info
    2009-09-18 None Attached File- Added buildlog-on-amd64.txt, #18732

    Back to the top

    Powered by Savane 3.13-bb6a.
    Corresponding source code