This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libgcj/33442] 1938 unexpected fails in libjava testsuite



------- Comment #2 from danglin at gcc dot gnu dot org  2007-09-15 18:13 -------
I have no idea what has triggered this bug but the problem seems
to be in the setting of the stack base in GC_get_thread_stack_base().
In particular, pthread_attr_getstack() seems broken.  This is the
code for the line

return stack_addr - stack_size;

0x4239ad40 <GC_get_thread_stack_base+96>:       ldw -78(sp),r20
0x4239ad44 <GC_get_thread_stack_base+100>:      ldw -74(sp),ret0
0x4239ad48 <GC_get_thread_stack_base+104>:      sub r20,ret0,r20
0x4239ad4c <GC_get_thread_stack_base+108>:      copy r20,ret0

At 0x4239ad48:

(gdb) p/x $ret0
$5 = 0x800000
(gdb) p/x $r20
$6 = 0xfb50c000
(gdb) p/x $sp
$7 = 0xfb50cc80

At 0x4239ad50:
(gdb) p/x $ret0
$8 = 0xfad0c000
(gdb) c
Continuing.

Program received signal SIGSEGV, Segmentation fault.
GC_push_all_eager (bottom=<value optimized out>,
    top=0xfb50ce88 "°P?\210B?*ÝBÞðl\020\027t®")
    at ../../../gcc/boehm-gc/mark.c:1468
1468            q = *p;
(gdb) p/x $r3
$9 = 0xfad0c000

It seems that pthread_attr_getstack() returns a stack_addr value
that is too small, and after subtracting stack_size to obtain stack_base,
we have an invalid pointer.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33442


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]