[BC] Patch: FYI: GC interface fixlet

Tom Tromey tromey@redhat.com
Mon Oct 25 17:22:00 GMT 2004


I'm checking this in on the BC branch.

I ran into a situation where we dereferenced the aux_info field even
though it was NULL.  This is probably the result of a race where the
GC marks the class before it is fully initialized.

This patch lets us avoid the problem for now.  The real fix is to
follow the plan in PR 18086.  I'd like to try to do this before 4.0,
since it would be a big improvement in robustness, but I'm pretty busy
and it isn't clear if I'll get to it :-(

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>
	* boehm.cc (_Jv_MarkObj): Test aux_info before dereferencing it.

Index: boehm.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/boehm.cc,v
retrieving revision 1.42.12.9
diff -u -r1.42.12.9 boehm.cc
--- boehm.cc 18 Oct 2004 20:27:11 -0000 1.42.12.9
+++ boehm.cc 25 Oct 2004 17:19:05 -0000
@@ -241,7 +241,7 @@
       MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
 
 #ifdef INTERPRETER
-      if (_Jv_IsInterpretedClass (c))
+      if (_Jv_IsInterpretedClass (c) && c->aux_info)
 	{
 	  _Jv_InterpClass* ic = (_Jv_InterpClass*) c->aux_info;
 



More information about the Java-patches mailing list