Ivan Maidanski ivmai at mail.ru
Mon Nov 9 01:29:32 PST 2009


I've tried this simple config: -DGC_THREADS -DMAKE_BACK_GRAPH [-DGC_DISABLE_INCREMENTAL]. It crashed with SEGV, the backtrace is:

 	test.exe!reset_back_edge(char * p=0x0038b2a0, unsigned int n_bytes=0x00000020, unsigned long gc_descr=0x00000020)  Line 296 + 0x3 bytes	C
	test.exe!per_object_helper(hblk * h=0x0038b000, unsigned long fn=0x004048d0)  Line 278 + 0x12 bytes	C
 	test.exe!GC_apply_to_all_blocks(void (hblk *, unsigned long)* fn=0x00403eb0, unsigned long client_data=0x004048d0)  Line 322 + 0x1a bytes	C
 	test.exe!GC_apply_to_each_object(void (char *, unsigned int, unsigned long)* f=0x004048d0)  Line 285 + 0xe bytes	C
 	test.exe!GC_print_back_graph_stats()  Line 475 + 0xa bytes	C
 	test.exe!GC_notify_or_invoke_finalizers()  Line 876	C

 	test.exe!GC_generic_malloc(unsigned int lb=0x0000001c, int k=0x00000001)  Line 164	C
 	test.exe!GC_malloc(unsigned int lb=0x0000001c)  Line 276 + 0xb bytes	C
 	test.exe!GC_debug_malloc(unsigned int lb=0x00000000, const char * s=0x00440c28, int i=0x0000047e)  Line 471 + 0x14 bytes	C
 	test.exe!run_one_test()  Line 1150 + 0x11 bytes	C
 	test.exe!thr_run_one_test(void * arg=0x00000000)  Line 1428	C
 	test.exe!GC_win32_start_inner(GC_stack_base * sb=0x0181ff74, void * arg=0x00380ff8)  Line 1980 + 0x7 bytes	C
 	test.exe!GC_call_with_stack_base(void * (GC_stack_base *, void *)* fn=0x0040173a, void * arg=0x00380ff8)  Line 1350 + 0xb bytes	C
 	test.exe!GC_win32_start(void * arg=0x00380ff8)  Line 1998 + 0xe bytes	C

The debugger says old_back_ptr in reset_back_edge() is BadPtr.

I don't know how to fix the bug (at last now). My question is:
Is it OK that GC_apply_to_all_blocks() is called w/o the alloc lock.


More information about the Gc mailing list