[Gc] RE: GC ported to AIX pthreads

Dan Bonachea bonachea@cs.berkeley.edu
Mon, 02 Jun 2003 02:59:21 -0700


At 05:59 PM 5/30/2003, Boehm, Hans wrote:
>I will integrate the patch into my tree, making some adjustments.  I would 
>appreciate
>help in testing the result.  In spite of previous intentions, I will release 
>a 6.2alpha6
>with both Brian's and Dan's patches.

Sounds good. Look forward to seeing it.

> > >3) MPROTECT_VDB used to work on Irix.  I suspect something
> > fairly trivial
> > >(signal handler arguments handling?) broke somewhere along the line.
> >
> > You may be right - however I've never worked on the code which uses
> > MPROTECT_VDB, so I'm probably not the right person to debug
> > it for you. Here's
> > the gctest-MPROTECT_VDB crash stack, in case that's helpful:
> >
> > #0  0x10012b14 in GC_find_limit (p=0x7ffeb5c0 "", up=1)
> >      at
> > /u/ac/bonachea/Ti/src-gc/runtime/gc-build/uniproc/../../gc/os_
> > dep.c:647
> > #1  0x10012bcc in GC_get_stack_base ()
> >      at
> > /u/ac/bonachea/Ti/src-gc/runtime/gc-build/uniproc/../../gc/os_
> > dep.c:806
> > #2  0x1000a2a4 in GC_init_inner ()
> >      at
> > /u/ac/bonachea/Ti/src-gc/runtime/gc-build/uniproc/../../gc/misc.c:607
> > #3  0x1000a5d0 in GC_enable_incremental ()
> >      at
> > /u/ac/bonachea/Ti/src-gc/runtime/gc-build/uniproc/../../gc/misc.c:741
> > #4  0x10009428 in main ()
> >      at
> > /u/ac/bonachea/Ti/src-gc/runtime/gc-build/uniproc/../../gc/tes
> > ts/test.c:1463
> >
> > I looked over GC_find_limit and couldn't find anything
> > obvious wrong with it,
> > although there are some vague comments referring to IRIX 5 vs
> > 6... I have no
> > idea why the SIGSEGV is still being delivered despite the
> > sigaction which
> > should suspend it...
> > However, in the short-term disabling MPROTECT_VDB fixes the problem.
>
>Is this the real problem?  Does it die there?  Or is gdb just catching the
>SIGSEGV signal which should be delivered at that point?

You're correct - gdb was just intercepting the signal before the registered 
handler. Here's apparently the real place where it's dying with MPROTECT_VDB 
on IRIX:

#0  0xfa479b0 in p_str () at regcomp.c:748
#1  0x10017640 in GC_free (p=0x10178cd8) at ./../../gc/malloc.c:414
#2  0x100074cc in reverse_test () at ./../../gc/tests/test.c:669
#3  0x10008dd0 in run_one_test () at ./../../gc/tests/test.c:1282
#4  0x1000948c in main () at ./../../gc/tests/test.c:1471

It appears to be crashing in the call to BZERO, although I'm not sure why. gdb 
shows it as a SIGSEGV, but when I run it outside the debugger I get the 
message "Killed" rather than the usual "Segmentation fault", and additionally 
it fails to drop core as a normal segfault should (suggesting corruption of 
the C runtime library).

The arguments to BZERO seem to be fine in the debugger (i.e. I can access all 
the affected data using gdb), so I suspect corruption of the libc memory pages 
implementing the library call (perhaps we fiddled some of the protection bits 
on the code pages?).

In any case, it doesn't appear to be a trivial or obvious problem (so we 
should probably go ahead disable MPROTECT_VDB on IRIX 5 for now). Of course, 
I'd encourage someone with experience on the VDB implementation to take a look 
at it..

Dan