This is the mail archive of the java-discuss@sources.redhat.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Serious GC bug


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

sbtest.java


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]