[Gc] GC7.0 on Leopard (MacOS X 10.5)... again Re: Gc Digest, Vol 50, Issue 6

Boehm, Hans hans.boehm at hp.com
Thu Jan 10 12:13:42 PST 2008


I think this needs to be debugged by an OSX expert.  If I read the OSX thread stopping code correctly, it gets a list of threads to be stopped from the OS, rather than using the GCs internal list.  My guess is that it's somehow accidentally stopping either a system thread at an inconvenient place or, ppossibly it is stopping the marker helper thread, if that has already been started.  Either one could break subsequent pthread_mutex_unlock() calls.

Especially given that no assertions are failing, the only thing special about this pthread_mutex_unlock() call should be that

a) It is made with the world stopped, and
b) It is probably the first such call made with the world stopped.

Thus my top question is now: Which threads are actually being stopped by GC_suspend_thread_list?  It seems to me that we do need some code to at least exclude the marker threads here.

The short-term workaround is almost certainly to disable parallel-mark on OSX.  But that's not a good thing.

Hans

> -----Original Message-----
> From: Manuel.Serrano at sophia.inria.fr
> [mailto:Manuel.Serrano at sophia.inria.fr]
> Sent: Thursday, January 10, 2008 5:32 AM
> To: Boehm, Hans
> Cc: Samuele Pedroni; gc at napali.hpl.hp.com
> Subject: RE: [Gc] GC7.0 on Leopard (MacOS X 10.5)... again
> Re: Gc Digest, Vol 50, Issue 6
>
> Hello Hans,
>
> > It would be interesting to know what happens with this
> version compiled with both --enable-parallel-mark and
> --enable-gc-assertions.  The parallel marking code has a
> reasonable number of assertions that might catch any weirdness.
> >
> > The version everyone is using is similar to the CVS
> version?  People are presumably testing on dual core
> machines?  When it hangs there is only a single thread around?
> Yes. The whole in just main() { GC_INIT(); }. There is thread
> involved here...
>
> > I believe this was intended to work, and I don't
> immediately see why it doesn't.  But I suspect some of the
> testing may have happened on single-core machines, where
> --enable-parallel-mark isn't that interesting.  In any case,
> it would be good to understand why this is breaking now.
>
> Enabling assertions does not help.
>
> -----|-----|-----|-----|-----|-----|-----|-----|-----|-----|--
> ---|-----|-----
> $ ./configure --enable-parallel-mark --enable-gc-assertions
> --prefix=$HOME/bgl/gc $ make $ make install $ cat > foo.c
> <<EOF #include <gc.h>
>
> int main() {
> GC_INIT();
> }
> EOF
> $ gcc foo.c -lgc
> $ gdb a.out
> (gdb) run
> Starting program: /Users/serrano/bgl/gc/gc-7.0/a.out
> Reading symbols for shared libraries +++. done ^C Program
> received signal SIGINT, Interrupt.
> 0xffff0295 in __spin_lock ()
> (gdb) bt
> #0  0xffff0295 in __spin_lock ()
> #1  0x926ba539 in pthread_mutex_unlock ()
> #2  0x0004df50 in GC_release_mark_lock () at pthread_support.c:1422
> #3  0x0004e6c4 in GC_stop_world () at darwin_stop_world.c:517
> #4  0x0003ac34 in GC_stopped_mark (stop_func=0x3a980
> <GC_never_stop_func>) at alloc.c:454
> #5  0x0003b7de in GC_try_to_collect_inner (stop_func=0x3a980
> <GC_never_stop_func>) at alloc.c:348
> #6  0x00048152 in GC_init_inner () at misc.c:742
> #7  0x00048297 in GC_init () at misc.c:428
> #8  0x00001ffd in main () at foo.c:4
> (gdb) c
> Continuing.
> ^C
> Program received signal SIGINT, Interrupt.
> 0xffff0292 in __spin_lock ()
> (gdb) bt
> #0  0xffff0292 in __spin_lock ()
> #1  0x00000000 in ?? ()
> (gdb) c
> Continuing.
> ^C
> Program received signal SIGINT, Interrupt.
> 0xffff0292 in __spin_lock ()
> (gdb) bt
> #0  0xffff0292 in __spin_lock ()
> #1  0x00000000 in ?? ()
> (gdb) c
> Continuing.
> ^C
> Program received signal SIGINT, Interrupt.
> 0xffff0292 in __spin_lock ()
> (gdb) bt
> #0  0xffff0292 in __spin_lock ()
> #1  0x00000000 in ?? ()
> (gdb) c
> Continuing.
> ^C
> Program received signal SIGINT, Interrupt.
> 0xffff0292 in __spin_lock ()
> (gdb) bt
> #0  0xffff0292 in __spin_lock ()
> #1  0x00000000 in ?? ()
> (gdb) The program is running.  Exit anyway? (y or n) y
> -----|-----|-----|-----|-----|-----|-----|-----|-----|-----|--
> ---|-----|-----
>
>
> --
> Manuel
>



More information about the Gc mailing list