[Gc] Re: Desperately needing GC 7.1
Hans.Boehm at hp.com
Sun Jan 13 20:09:33 PST 2008
I'm not sure we're on the right track here:
On DARWIN, GC_INIT() expands to just GC_init(), and that should be
happening implicitly, even without the call. I suspect that the explicit
GC_INIT() call just alters the timing enough that we don't observe the
Last I looked at the code, it still seemed to me that there was a problem
with parallel mark in that the thread stopping code seemed to
inadvertently also stop the marker threads (as created by
start_mark_threads()), which I believe could have bad results, such as the
ones we're observing. I suspect this does not happen on uniprocessors
since, without explicit instructions to the contrary via an environment
variable, the collector will not create any separate marker threads in
this case. But it would explain problems on dual core machines. I put a
FIXME comment in roughly the right place, I think.
The last paragraph, even if I'm right, clearly does not explain the
failure without parallel marking on Leopard/G4. And it would be great to
understand that. In the event of a failure, is the stack trace the same
I wouldn't apply this patch without understanding this in more details.
It seems too likely that we're just hiding a bug that will reappear in a
more complicated context.
On Sun, 13 Jan 2008, Andreas Tobler wrote:
> Andreas Tobler wrote:
>> OS-X 10.5.1 intel was ok here (core2duo), cvs version. With and without
>> parallel-mark. So no improvements.
> That was not quite correct. Parallel mark indeed does not seem to work
> here. Or is it depending on the weather ...
>> OS-X 10.5.1 on G4 is borked. Investigating. Doesn't matter if parallel
>> mark or not. A nasty race condition. The gctest hangs in 99% of trials.
> Ok, I think I found a reason. The gctest does not use GC_INIT anymore
> for this target. Adding a GC_INIT again makes my G4 under Leopard (aka.
> 10.5.1) work with and without parallel-mark. Yes, with and without,
> double checked.
> But as said, Tiger on G4 was ok w/o modifying test.c.
> Index: tests/test.c
> RCS file: /cvsroot/bdwgc/bdwgc/tests/test.c,v
> retrieving revision 1.12
> diff -u -r1.12 test.c
> --- tests/test.c 25 Oct 2007 00:41:06 -0000 1.12
> +++ tests/test.c 13 Jan 2008 21:06:57 -0000
> @@ -65,7 +65,7 @@
> /* Call GC_INIT only on platforms on which we think we really need it, */
> /* so that we can test automatic initialization on the rest. */
> -#if defined(__CYGWIN32__) || defined (_AIX)
> +#if defined(__CYGWIN32__) || defined (_AIX) || defined (DARWIN)
> # define GC_COND_INIT() GC_INIT()
> # define GC_COND_INIT()
More information about the Gc