Patch: add extensions directory contents to VMClassLoader class path.

Ranjit Mathew rmathew@gmail.com
Fri Jun 18 11:57:00 GMT 2004


Andrew Haley wrote:
> Ranjit Mathew writes:
[...]
>  > we're installing the SEGV handler only after the VMClassLoader
>  > has initialised. Hence the SEGV was not caught via the
>  > normal exception handling mechanism.
> 
> Ah, okay.  Not a problem then.

Do I take this as an "OK" for the "dir.exists()" patch?

In any case, I decided to see if we can install the SEGV
and FPE handlers before the VMClassLoader is initialised,
so that a NullPointerException is thrown for the original
bug.

So I tried out the following patch on a clean tree (i.e.
without the "dir.exists()" patch) and was able to bootstrap
and pass all the libjava and Jacks testsuite again. I tested
this out on i686-pc-linux-gnu. Does anyone think that this
could create problems on other platforms?

(I also noticed that we don't protect INIT_SEGV with a
#ifdef HANDLE_SEGV - I think this is an oversight and not
deliberate.)

Is this OK for mainline?

In any case, I think the "dir.exists()" patch should still
be applied - there's no reason to wait for a NullPointerException
to be thrown if it can be avoided easily.

Ranjit.

Index: ChangeLog
from  Ranjit Mathew  <rmathew@hotmail.com>

        * prims.cc (_Jv_CreateJavaVM): Install SEGV and FPE handlers,
        if desired, before the default class loader is initialised.
        Call INIT_SEGV only if HANDLE_SEGV is defined.

Index: prims.cc
===================================================================
--- prims.cc    2004-06-18 16:08:22.000000000 +0530
+++ prims.cc    2004-06-18 16:11:46.000000000 +0530
@@ -954,6 +954,14 @@ _Jv_CreateJavaVM (void* /*vm_args*/)
   _Jv_InitGC ();
   _Jv_InitializeSyncMutex ();

+#ifdef HANDLE_SEGV
+  INIT_SEGV;
+#endif
+
+#ifdef HANDLE_FPE
+  INIT_FPE;
+#endif
+
   /* Initialize Utf8 constants declared in jvm.h. */
   void_signature = _Jv_makeUtf8Const ("()V", 3);
   clinit_name = _Jv_makeUtf8Const ("<clinit>", 8);
@@ -980,15 +988,11 @@ _Jv_CreateJavaVM (void* /*vm_args*/)
   // initialization of ClassLoader before we start the initialization
   // of VMClassLoader.
   _Jv_InitClass (&java::lang::ClassLoader::class$);
+
   // Once the bootstrap loader is in place, change it into a kind of
   // system loader, by having it read the class path.
   gnu::gcj::runtime::VMClassLoader::initialize();

-  INIT_SEGV;
-#ifdef HANDLE_FPE
-  INIT_FPE;
-#endif
-
   no_memory = new java::lang::OutOfMemoryError;

   java::lang::VMThrowable::trace_enabled = 1;



More information about the Java-patches mailing list