Serious GC bug

Boehm, Hans hans_boehm@hp.com
Fri Dec 22 12:19:00 GMT 2000


It turns out the hash synchronization bug I was chasing was actually a
serious GC bug that apparently was there all along.  GC_gcj_malloc
apparently released the allocator lock twice, in most cases.  (This was also
in my GC5.3 distribution, I believe, though not in the 6.0 version.  I have
no idea how that happened, or how we got this far without running into
this.)

The patch consists of deleting one line:

--- gcj-cvs/libgcj/boehm-gc/gcj_mlc.c	Sat May  6 16:59:01 2000
+++ gcj/libgcj/boehm-gc/gcj_mlc.c	Fri Dec 22 11:32:00 2000
@@ -139,7 +139,6 @@
         } else {
             *opp = obj_link(op);
             GC_words_allocd += lw;
-            FASTUNLOCK();
         }
 	*(void **)op = ptr_to_struct_containing_descr;
 	UNLOCK();

Tom - could you check this in?

This is likely to mildly improve performance, in additon to correctness.

The test program that pointed out the problem is attached. 

Hans

-------------- next part --------------
A non-text attachment was scrubbed...
Name: sbtest.java
Type: text/x-c
Size: 836 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java/attachments/20001222/f559d562/attachment.bin>


More information about the Java mailing list