[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Jamvm-general] Re: jamvm + classpath CVS
From: |
Robert Lougher |
Subject: |
Re: [Jamvm-general] Re: jamvm + classpath CVS |
Date: |
Fri, 10 Dec 2004 11:10:43 +0000 |
On Thu, 9 Dec 2004 15:51:05 +0100, Jeroen Frijters <address@hidden> wrote:
> Michael Koch wrote:
>
>
> > Am Donnerstag, 9. Dezember 2004 14:32 schrieb Robert Lougher:
> > > Hi Michael,
> > >
> > > By the time I downloaded classpath cvs and builit it, I didn't have
> > > long to work on this. I put in the native methods, and modified
> > > the VM classes. I'm now getting stuck in a recursive class
> > > initialisation dependency. I've not investigated it very far, but
> > > it appears that SystemProperties.<clinit> forces Runtime.<clinit>,
> > > which uses SystemProperties -- as it's being initialised, we return
> > > (step 3 of initialisation process), accessing properties, which is
> > > null (hence the NullPointerException). BTW, it ends up as a
> > > NoClassDefError because Runtime gets marked as bad.
> > >
> > > I'll have a look at it again tonight. Did you manage to get past
> > > this stage? I may post something onto the classpath list but I
> > > want to make sure I've not done anything stupid first :)
> > >
> > > Rob.
> >
> > I hit the same problem. I thought it was me doing something
> > stupd with the native methods. I think I concluded wrong.
> >
> > I CC'ed Jeroen now as he wrote the patch. Perhaps he can say
> > something
> > about this.
> >
> > Jeroen: I think we have a problem with initialization in GNU
> > classpath. Can you tell us something about the above ?
>
> Can you figure out why SystemProperties is initializing Runtime? That
> doesn't happen for me (and it shouldn't happen).
>
> Regards,
> Jeroen
>
Hi,
It is a problem with SystemProperties.<clinit>. It's triggered when
StringBuffer is used. In my case this happens because my native
preInit() doesn't define "http.agent", so it sets up a default one,
using a StringBuffer. You probably define this property yourself so
you don't see it. Setting http.agent in preInit() fixes the problem
with JamVM.
This is a trace showing the sequence which triggers the recursive
initialisation. As discussed above, in Runtime.<clinit> we end up
with a null pointer because SystemProperties is initialised
recursively. This causes the whole Classpath initialisation sequence
to fail.
<<<<<<< LEAVING NOW BACK IN gnu/classpath/SystemProperties.<clinit>()V
>>>>>>> ENTERING java/lang/StringBuffer.<init>(Ljava/lang/String;)V
>>>>>>>> ENTERING java/lang/Object.<init>()V
<<<<<<<< LEAVING NOW BACK IN java/lang/StringBuffer.<init>(Ljava/lang/String;)V
>>>>>>>> ENTERING java/lang/String.getChars(II[CI)V
>>>>>>>>>ENTERED java/lang/System.<clinit>()V
>>>>>>>>>> ENTERING
java/lang/VMSystem.makeStandardInputStream()Ljava/io/InputStream;
>>>>>>>>>>>ENTERED java/io/FileDescriptor.<clinit>()V
>>>>>>>>>>>>ENTERED gnu/java/nio/channels/FileChannelImpl.<clinit>()V
>>>>>>>>>>>>> ENTERING java/lang/System.loadLibrary(Ljava/lang/String;)V
>>>>>>>>>>>>>>ENTERED java/lang/Runtime.<clinit>()V
>>>>>>>>>>>>>>>> ENTERING java/lang/Object.<init>()V
<<<<<<<<<<<<<<<< LEAVING NOW BACK IN java/lang/Runtime.<init>()V
RECURSIVELY INITING BY ME!!!!!!!!!!!!!! gnu/classpath/SystemProperties
>>>>>>>>>>>>>>>> ENTERING
gnu/classpath/SystemProperties.getProperty(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
RECURSIVELY INITING BY ME!!!!!!!!!!!!!! gnu/classpath/SystemProperties
>>>>>>>>>>>>>>>>>ENTERED
java/lang/NullPointerException.<init>(Ljava/lang/String;)V
CC-ing to the Classpath list in case any other VM implementor is
having problems with this.
Now that JamVM is working with classpath cvs again, I'll put together a patch.
Thanks,
Rob.
- Re: [Jamvm-general] Re: jamvm + classpath CVS,
Robert Lougher <=