Uploaded image for project: 'JikesRVM'
  1. JikesRVM
  2. RVM-887

RVM failure at startup when using -Xbootclasspath (Trying to load a class too early in the booting process)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Low
    • Resolution: Fixed
    • Affects Version/s: hg tip
    • Fix Version/s: 3.1.1
    • Component/s: Runtime
    • Labels:
      None
    • Environment:

      production Jikes RVM 3.1.0+svn (r15833) on IA32 GNU/Linux, kernel 2.6.31.9-perfctr

      Description

      Putting a JAR on the boot classpath causes the VM (in all configuration from prototype to production) to fail at startup. The following command line triggers this behavior, regardless whether you use -Xbootclasspath/a or /p:

      ./dist/production_ia32-linux/rvm -Xbootclasspath/a:./components/dacapo/2006-10-MR2/dacapo.jar -jar ./components/dacapo/2006-10-MR2/dacapo.jar

      Trying to load a class (gnu.java.util.jar.JarUtils) too early in the booting process, before dynamic class loading is enabled; aborting.
      Trying to load a class too early in the booting process
      Thread #1
      – Stack –
      at [0x58ea06a4, 0x5b76cadb] Lorg/jikesrvm/VM; sysFail(Ljava/lang/String;)V at line 2275
      at [0x58ea0700, 0x5b76cd03] Lorg/jikesrvm/classloader/BootstrapClassLoader; findClass(Ljava/lang/String;)Ljava/lang/Class; at line 181
      at [0x58ea0740, 0x5b752084] Lorg/jikesrvm/classloader/BootstrapClassLoader; loadClass(Ljava/lang/String;Z)Ljava/lang/Class; at line 147
      at [0x58ea0764, 0x5b04bd38] Ljava/lang/ClassLoader; loadClass(Ljava/lang/String;)Ljava/lang/Class; at line 293
      at [0x58ea07bc, 0x5b0383cb] Lorg/jikesrvm/classloader/TypeReference; resolveInternal()Lorg/jikesrvm/classloader/RVMType; at line 807
      at [0x58ea07ec, 0x5b03922f] Lorg/jikesrvm/classloader/TypeReference; resolve()Lorg/jikesrvm/classloader/RVMType; at line 795
      at [0x58ea07ec, 0x5b03922f] Lorg/jikesrvm/classloader/MethodReference; resolve()Lorg/jikesrvm/classloader/RVMMethod; at line 196
      at [0x58ea0808, 0x5beb031a] Lorg/jikesrvm/classloader/MemberReference; resolveMember()Lorg/jikesrvm/classloader/RVMMember; at line 267
      at [0x58ea0828, 0x5be8bed5] Lorg/jikesrvm/classloader/TableBasedDynamicLinker; resolveMember(Lorg/jikesrvm/classloader/MemberReference;)I at line 74
      at [0x58ea0860, 0x5be8c19b] Lorg/jikesrvm/compilers/opt/runtimesupport/OptLinker; resolveDynamicLink(Lorg/jikesrvm/compilers/opt/runtimesupport/OptCompiledMethod;Lorg/vmmagic/unboxed/Offset;)V at line 64
      at [0x58ea08d4, 0x5b0d0402] Lorg/jikesrvm/compilers/opt/runtimesupport/OptSaveVolatile; resolve()V at line 133
      at [0x58ea0910, 0x5ba9c9c9] Ljava/util/jar/Manifest; read(Ljava/io/InputStream;)V at line 162
      at [0x58ea0910, 0x5ba9c9c9] Ljava/util/jar/Manifest; <init>(Ljava/io/InputStream;)V at line 89
      at [0x58ea0910, 0x5ba9c9c9] Ljava/util/jar/JarFile; readManifest()Ljava/util/jar/Manifest; at line 303
      at [0x58ea0940, 0x5bd13489] Ljava/util/jar/JarFile; <init>(Ljava/io/File;ZI)V at line 268
      at [0x58ea09a4, 0x5b636264] Lgnu/java/net/protocol/jar/Connection$JarFileCache; get(Ljava/net/URL;Z)Ljava/util/jar/JarFile; at line 99
      at [0x58ea09fc, 0x5b635804] Lgnu/java/net/protocol/jar/Connection; connect()V at line 141
      at [0x58ea0a1c, 0x5ba89b3f] Lgnu/java/net/protocol/jar/Connection; getInputStream()Ljava/io/InputStream; at line 159
      at [0x58ea0a68, 0x67814f26] Ljava/net/URL; openStream()Ljava/io/InputStream; at line 737
      at [0x58ea0a68, 0x67814f26] Ljava/lang/VMClassLoader; getBootPackages()[Ljava/lang/String; at line 186
      at [0x58ea0aa0, 0x5becfc50] Ljava/lang/VMClassLoader; <clinit>()V at line 69
      at [0x58ea0ae8, 0x5bed0919] Lorg/jikesrvm/VM; runClassInitializer(Ljava/lang/String;)V at line 545
      at [0x58ea0b28, 0x5bed1046] Lorg/jikesrvm/VM; finishBooting()V at line 384
      at [0x58ea0b38, 0x0804ffc5] Lorg/jikesrvm/VM; boot()V at line 145

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            dgrove David Grove added a comment -

            The way to make progress on this is to incrementally add classes to the primordials until there's enough stuff in there that you can process a jar file without needed to do additional class loading. It's a little tedious, but the basic idea would be to add classes one at a time until it works.

            The error message is telling you that the immediate problem is gnu.java.util.jar.JarUtils. Add it, rebuild (I'd use a quick turnaround image like prototype) and try again. If you are lucky it will work after only a few iterations.

            Show
            dgrove David Grove added a comment - The way to make progress on this is to incrementally add classes to the primordials until there's enough stuff in there that you can process a jar file without needed to do additional class loading. It's a little tedious, but the basic idea would be to add classes one at a time until it works. The error message is telling you that the immediate problem is gnu.java.util.jar.JarUtils. Add it, rebuild (I'd use a quick turnaround image like prototype) and try again. If you are lucky it will work after only a few iterations.
            Hide
            sewe Andreas Sewe added a comment -

            Took a few iterations, but here's the result (I've attached a patch):

            Lgnu/java/lang/CPStringBuilder;
            Lgnu/java/util/jar/JarUtils;
            Ljava/io/ByteArrayOutputStream;
            Lgnu/java/util/regex/RETokenAny;
            Lgnu/java/util/regex/RETokenRepeated;
            Lgnu/java/util/regex/RETokenWordBoundary;
            Ljava/security/MessageDigest;

            Show
            sewe Andreas Sewe added a comment - Took a few iterations, but here's the result (I've attached a patch): Lgnu/java/lang/CPStringBuilder; Lgnu/java/util/jar/JarUtils; Ljava/io/ByteArrayOutputStream; Lgnu/java/util/regex/RETokenAny; Lgnu/java/util/regex/RETokenRepeated; Lgnu/java/util/regex/RETokenWordBoundary; Ljava/security/MessageDigest;
            Hide
            dgrove David Grove added a comment -

            patch committed in 15838.

            Show
            dgrove David Grove added a comment - patch committed in 15838.
            Hide
            ebrangs Erik Brangs added a comment -

            I've run into the problem described in this issue but I needed to add additional classes to make Jikes RVM load the JAR file I needed.

            I would have attached a patch for the primordial changes but that's not possible for closed issues. The diff for the changes is:

            diff --git a/build/primordials/Classpath-0.97.2.txt b/build/primordials/Classpath-0.97.2.txt
            --- a/build/primordials/Classpath-0.97.2.txt
            +++ b/build/primordials/Classpath-0.97.2.txt
            @@ -577,6 +577,12 @@
             Lgnu/java/util/jar/JarUtils;
             Ljava/io/ByteArrayOutputStream;
             Lgnu/java/util/regex/RETokenAny;
            +Lgnu/java/util/regex/BacktrackStack;
            +Lgnu/java/util/regex/BacktrackStack$Backtrack;
             Lgnu/java/util/regex/RETokenRepeated;
            +Lgnu/java/util/regex/RETokenRepeated$StackedInfo;
            +Lgnu/java/util/regex/RETokenRepeated$FindMatchControlStack;
            +Lgnu/java/util/regex/RETokenRepeated$DoablesFinder;
            +Lgnu/java/util/regex/RETokenRepeated$TryAnotherResult;
             Lgnu/java/util/regex/RETokenWordBoundary;
             Ljava/security/MessageDigest;
            
            
            Show
            ebrangs Erik Brangs added a comment - I've run into the problem described in this issue but I needed to add additional classes to make Jikes RVM load the JAR file I needed. I would have attached a patch for the primordial changes but that's not possible for closed issues. The diff for the changes is: diff --git a/build/primordials/Classpath-0.97.2.txt b/build/primordials/Classpath-0.97.2.txt --- a/build/primordials/Classpath-0.97.2.txt +++ b/build/primordials/Classpath-0.97.2.txt @@ -577,6 +577,12 @@ Lgnu/java/util/jar/JarUtils; Ljava/io/ByteArrayOutputStream; Lgnu/java/util/regex/RETokenAny; +Lgnu/java/util/regex/BacktrackStack; +Lgnu/java/util/regex/BacktrackStack$Backtrack; Lgnu/java/util/regex/RETokenRepeated; +Lgnu/java/util/regex/RETokenRepeated$StackedInfo; +Lgnu/java/util/regex/RETokenRepeated$FindMatchControlStack; +Lgnu/java/util/regex/RETokenRepeated$DoablesFinder; +Lgnu/java/util/regex/RETokenRepeated$TryAnotherResult; Lgnu/java/util/regex/RETokenWordBoundary; Ljava/security/MessageDigest;

              People

              • Assignee:
                dgrove David Grove
                Reporter:
                sewe Andreas Sewe
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: