Static initializers bug in 0.9.2 ?

Laurent Bossavit morendil at micronet.fr
Tue Mar 31 10:02:16 PST 1998


Hello,

 I have come across some strange Kaffe behaviour that I can only 
ascribe to a bug in the processClass() function in kaffevm/classMethod.c
in 0.9.2.

 One of my classes has a static initializer that attempts to create a 
BigInteger; that code is protected by a try/catch block, which 
catches Throwable, so that if loadLibrary("math") fails with an 
UnsatisfiedLinkError I fall back on a pure-Java implementation.

 The problem in Kaffe 0.9.2 is that apparently the catch block is not 
executed; instead, the class construction appears to fail, and 
further references to the class - in my instance, calling a static 
method of the class - fail with a NullPointerException.

 Moving the code in the static initializer block to a static void init()
function called from elsewhere seems to solve the problem. Oh, and 
the original code worked fine under JRE.

 I haven't been able to build 0.9.2 on my system - W95 using Cygnus
GNU Win32 b18 - so I can't really examine this issue more closely.
Can someone more knowledgeable with Kaffe internals confirm that
this is a problem with processClass() ? I'm also looking at the code
for 0.10.0 to see if the same thing might happen.


=====================================================
Laurent Bossavit
NetDIVE Paris offices                      (o o)
--------------------------------     -oOO--( )--OOo-
http://www.netdive.com/
NetDIVE: the leader in virtual meeting technology
=====================================================


More information about the kaffe mailing list