[Gc] Bus error with the CVS version on Leopard x86

Hans Boehm Hans.Boehm at hp.com
Sun Dec 23 13:31:29 PST 2007


GC_do_blocking expects a function and an argument to that function
as parameters.  It invokes that function on the supplied argument in
a context in which the thread state has already been saved so that
the collector does not need to stop the thread.

The documentation is clearly lacking at the moment, largely because
this function doesn't currently exist across all platforms.

Hans

On Sun, 23 Dec 2007, Joel Reymont wrote:

> #include <gc.h>
> #include <stdio.h>
> extern GC_do_blocking();
>
> main( int argc, char *argv[] ) {
>   GC_init();
>   if( GC_do_blocking() ) puts( "yes" ); else puts( "yes" );
>   return 0;
> }
>
> gcc -g /tmp/actestbigloo.c -o /tmp/Xactestbigloo -I/usr/local/include/gc
> -I/usr/local/include/gc/gc
> -L/usr/local/lib -lgc
>
> (gdb) r
> Starting program: /private/tmp/Xactestbigloo
> Reading symbols for shared libraries +++. done
>
> Program received signal EXC_BAD_ACCESS, Could not access memory.
> Reason: KERN_PROTECTION_FAILURE at address: 0x00000000
> 0x00000000 in ?? ()
> (gdb) where
> #0  0x00000000 in ?? ()
> #1  0x00049f5d in GC_do_blocking_inner (data=0xbffff278 "", context=0x0)
> at pthread_support.c:888
> #2  0x0004b05d in GC_with_callee_saves_pushed
> (fn=0x49f10 <GC_do_blocking_inner>, arg=0x0) at
> mach_dep.c:225
> #3  0x0004a00e in GC_do_blocking (fn=0, arg=0x0)
> at pthread_support.c:899
> #4  0x00001fcd in main (argc=1, argv=0xbffff2d0)
> at /tmp/actestbigloo.c:7
>
> What am I doing wrong?
>
>    Thanks, Joel
>
>
>
>
> _______________________________________________
> Gc mailing list
> Gc at linux.hpl.hp.com
> http://www.hpl.hp.com/hosted/linux/mail-archives/gc/
>


More information about the Gc mailing list