[Gc] Re: segfault with CACAO on OpenSolaris

Stefan Ring stefan at complang.tuwien.ac.at
Tue Jun 30 03:24:23 PDT 2009

Boehm, Hans <hans.boehm at ...> writes:

> > -----Original Message-----
> > From: Christian Thalinger [mailto:twisti at ...]
> > Sent: Wednesday, August 27, 2008 2:21 PM
> > Subject: RE: [Gc] segfault with CACAO on OpenSolaris
> >
> > I got another problem.  I think the problem is that an object
> > is collected although it's still in use.  I try to explain it.
> >
> > When an object's lock is contended we allocate a lock record
> > for this object.  To clean these lock records up when the
> > corresponding object is collected, we register a special
> > finalizer which is calling the Java finalizer (if any) and
> > freeing the lock record.
> >
> > The crash I'm now seeing is like this:
> >
> > LOG: [0x0000000000000003] [finalizer lockrecord: o=5d7020 p=0
> > class=Harness$TimeoutWatcher SYNCHRONIZED]
> > LOG: [0x0000000000000003] [lock_record_free  : lr=e658e0]
> >
> Is this by any chance called from another finalizer?


> Getting JVM implementations right in this area is quite tricky.  In order for
this kind of finalization to
> work, you really need the collector's normal "topologically ordered"
finalization semantics, so that a
> lock record is not deallocated while it is reachable from other
finalization-enabled objects.  But those
> are unfortunately not the finalization semantics required by Java.  I think
there is gcj-inspired code
> (a.k.a. ugly hack) in the collector to make this sort of thing work (see
> GC_register_finalizer_unreachable() in gc.h).
> If that's not the problem, and the CACAO code is correct, your best bet it to
apply the standard premature
> deallocation debugging techniques from the web site, and to see why the parent
object is not getting
> marked in the prior collection, and hence gets finalized.
> >
> > So my question is, is it possible that there is a bug
> > somewhere in the Solaris marking code?
> That's always a possibility.  It's really only the root finding code that's OS
and machine specific,
> though.  The fact that you need finalizers to trigger the bug makes me
suspicious that this is something else.

You were absolutely right about this.


I know this is a very late response, therefore I'm quoting almost the entire
original message. Although you must have long forgotten about this, I just
wanted to let you know that the problem was with CACAO, not the garbage
collector. I answer also for people who stumble across this thread and might be
eased a bit to find a resolution.


More information about the Gc mailing list