[kaffe] circular linking difficulties

rob at kaffe.org rob at kaffe.org
Sun Jun 27 12:10:22 PDT 2004


Hi all,

It's been some time since I announced [1] that verifier was pretty much
done, and that turned out to be pretty premature ;).  At this point, it is
functionally complete, but will remain off by default until kaffe can run
the usual bad boys--eclipse, ant, jython--with -verifyremote.

Unfortunately, kaffe -verifyremote is choking on most big programs now,
due to internal linking circularity problems.  In brief, if class A
requires class B to be linked for verification, and class B requires A to
be linked, then it fails, because the verifier uses the built-in class
loading methods, and getClassFromSignature in particular, to load classes,
and they load a class to state CSTATE_LINKED by default.

I mentioned this last summer, and Helmer [2] and Tim [3][4] both had ideas
of how to fix it.  I tried implementing Helmer's idea by creating methods
such as loadClassToState which allows you to choose to what state you want
your class loaded, and found that it didn't work very well, but that could
have been my implentation (in any event, I don't think that solution deals
with the problem when user class loaders are involved).  Tim [5] said that
the only way he managed to solve the linking problem was by loading in a
new thread, which is not ideal.

My current idea is to save all the classes that are currently undergoing
verification in a static hash-table in the verifier.  Thus when I need to
lookup a class using it's name/signature, I check the hash table to see if
I'm already working on it, and if not then I go through the normal
getClass() routines.  Also not a particularly great solution.

Does anybody see a good way to deal with this problem?  If it helps, I can
post a couple Java classes that display the error in the current CVS head
when it's run with -verifyremote as an option.


thanks,
Rob


[1] http://www.kaffe.org/pipermail/kaffe/2003-August/095213.html
[2] http://www.kaffe.org/pipermail/kaffe/2003-August/095231.html
[3] http://www.kaffe.org/pipermail/kaffe/2003-August/095240.html
[4] http://www.kaffe.org/pipermail/kaffe/2003-August/095384.html
[5] http://www.kaffe.org/pipermail/kaffe/2003-August/095384.html



More information about the kaffe mailing list