[Gc] A small patch for pthread_support

Ivan Maidanski ivmai at mail.ru
Mon Oct 20 08:58:54 PDT 2008


Hi!

GC_threads[] (hashtable roots) must be initially cleared since some code (e.g., in GC_remove_all_threads_but_me(), GC_mark_thread_local_free_lists(), GC_push_all_stacks()) does chain traversing until NULL is reached.

The patch is attached.

Bye.

-------------- next part --------------
diff -ru bdwgc/pthread_support.c updated/bdwgc/pthread_support.c
--- bdwgc/pthread_support.c	2008-10-16 23:05:32.000000000 +0400
+++ updated/bdwgc/pthread_support.c	2008-10-20 16:50:02.000000000 +0400
@@ -359,7 +359,7 @@
 
 GC_bool GC_thr_initialized = FALSE;
 
-volatile GC_thread GC_threads[THREAD_TABLE_SZ];
+volatile GC_thread GC_threads[THREAD_TABLE_SZ] = { 0 };
 
 void GC_push_thread_structures(void)
 {


More information about the Gc mailing list