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

NPE in java.util.logging.LogManager with Apache Harmony classlib

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 3.0
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      Gentoo x86, JikesRVM r14857, Harmony r683652

      Description

      There is a bug that causes NPE at java.util.logging.LogManager in the attached test. This issue prevents SPECjbb2005 from running on RVM+Harmony.

      java.lang.NullPointerException
      at .<invisible method>(Unknown Source)
      at java.lang.Throwable.fillInStackTrace(Throwable.java:131)
      at java.lang.Throwable.<init>(Throwable.java:77)
      at java.lang.Exception.<init>(Exception.java:37)
      at java.lang.RuntimeException.<init>(RuntimeException.java:33)
      at java.lang.NullPointerException.<init>(NullPointerException.java:34)
      at org.jikesrvm.runtime.RuntimeEntrypoints.deliverHardwareException(RuntimeEntrypoints.java:693)
      at .<hardware trap>(Unknown Source)
      at java.util.Hashtable.get(Hashtable.java:531)
      at java.util.logging.LogManager.getLogger(LogManager.java:359)
      at java.util.logging.Logger.getLoggerWithRes(Logger.java:335)
      at java.util.logging.Logger.getLogger(Logger.java:361)
      at testLogger.main(testLogger.java:4)

        Attachments

          Activity

          Hide
          aleksey.shipilev Aleksey Shipilev added a comment -

          testLogger.java
          The test.

          Show
          aleksey.shipilev Aleksey Shipilev added a comment - testLogger.java The test.
          Hide
          aleksey.shipilev Aleksey Shipilev added a comment -

          rvm-harmony-logging-v1.patch
          The patch, solves the problem:

          • nullifies latest initialized instance of LogManager
          • refires static initializer for LogManager
          Show
          aleksey.shipilev Aleksey Shipilev added a comment - rvm-harmony-logging-v1.patch The patch, solves the problem: nullifies latest initialized instance of LogManager refires static initializer for LogManager
          Hide
          aleksey.shipilev Aleksey Shipilev added a comment -

          After the patch:

          shade@pegasus ~/tests $ ~/trunks/jikesrvm/dist/prototype_harmony_ia32-linux/rvm testLogger
          java.io.FileNotFoundException: /home/shade/trunks/jikesrvm/dist/prototype_harmony_ia32-linux/lib/logging.properties
          at .<invisible method>(Unknown Source)
          at java.lang.Throwable.fillInStackTrace(Throwable.java:131)
          at java.lang.Throwable.<init>(Throwable.java:77)
          at java.lang.Throwable.<init>(Throwable.java:87)
          at java.lang.Exception.<init>(Exception.java:48)
          at java.io.IOException.<init>(IOException.java:43)
          at java.io.FileNotFoundException.<init>(FileNotFoundException.java:43)
          at org.apache.harmony.luni.platform.OSFileSystem.open(OSFileSystem.java:235)
          at java.io.FileInputStream.<init>(FileInputStream.java:76)
          at java.io.FileInputStream.<init>(FileInputStream.java:123)
          at java.util.logging.LogManager.readConfiguration(LogManager.java:425)
          at java.util.logging.LogManager$1.run(LogManager.java:210)
          at java.security.AccessController.doPrivileged(AccessController.java:200)
          at java.util.logging.LogManager.<clinit>(LogManager.java:196)
          at org.jikesrvm.VM.runClassInitializer(VM.java:561)
          at org.jikesrvm.VM.finishBooting(VM.java:430)
          at org.jikesrvm.VM.boot(VM.java:158)
          java.util.logging.Logger@2763567a <-------------- SUCCESS

          The exception is not relevant to this issue, it's the infrastructure problem. This exception does not break the execution though, I will submit additional patch later.

          Show
          aleksey.shipilev Aleksey Shipilev added a comment - After the patch: shade@pegasus ~/tests $ ~/trunks/jikesrvm/dist/prototype_harmony_ia32-linux/rvm testLogger java.io.FileNotFoundException: /home/shade/trunks/jikesrvm/dist/prototype_harmony_ia32-linux/lib/logging.properties at .<invisible method>(Unknown Source) at java.lang.Throwable.fillInStackTrace(Throwable.java:131) at java.lang.Throwable.<init>(Throwable.java:77) at java.lang.Throwable.<init>(Throwable.java:87) at java.lang.Exception.<init>(Exception.java:48) at java.io.IOException.<init>(IOException.java:43) at java.io.FileNotFoundException.<init>(FileNotFoundException.java:43) at org.apache.harmony.luni.platform.OSFileSystem.open(OSFileSystem.java:235) at java.io.FileInputStream.<init>(FileInputStream.java:76) at java.io.FileInputStream.<init>(FileInputStream.java:123) at java.util.logging.LogManager.readConfiguration(LogManager.java:425) at java.util.logging.LogManager$1.run(LogManager.java:210) at java.security.AccessController.doPrivileged(AccessController.java:200) at java.util.logging.LogManager.<clinit>(LogManager.java:196) at org.jikesrvm.VM.runClassInitializer(VM.java:561) at org.jikesrvm.VM.finishBooting(VM.java:430) at org.jikesrvm.VM.boot(VM.java:158) java.util.logging.Logger@2763567a <-------------- SUCCESS The exception is not relevant to this issue, it's the infrastructure problem. This exception does not break the execution though, I will submit additional patch later.
          Hide
          ianrogers Ian Rogers added a comment -

          Thanks for the patch! I think we need to re-think the layout of the RVM_HOME directory after the build (e.g. dist/prototype_x86_64-linux/). I think the jar and dlls should be placed in a subdirectory called lib. In that lib directory we need to also copy the logging.properties from Harmony's deploy lib directory. We need to fix tools/bootImageRunner/rvm.harmony so that it knows where the boot classpath and dlls are.

          Show
          ianrogers Ian Rogers added a comment - Thanks for the patch! I think we need to re-think the layout of the RVM_HOME directory after the build (e.g. dist/prototype_x86_64-linux/). I think the jar and dlls should be placed in a subdirectory called lib. In that lib directory we need to also copy the logging.properties from Harmony's deploy lib directory. We need to fix tools/bootImageRunner/rvm.harmony so that it knows where the boot classpath and dlls are.
          Hide
          ianrogers Ian Rogers added a comment -

          WIP patch committed in r14859.

          Show
          ianrogers Ian Rogers added a comment - WIP patch committed in r14859.
          Hide
          ianrogers Ian Rogers added a comment -

          Fix in r14898.

          Show
          ianrogers Ian Rogers added a comment - Fix in r14898.

            People

            • Assignee:
              ianrogers Ian Rogers
              Reporter:
              aleksey.shipilev Aleksey Shipilev
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: