RVM
  1. RVM
  2. RVM-624

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

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.0
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Gentoo x86, JikesRVM r14857, Harmony r683652
    • Number of attachments :
      2

      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)

      1. rvm-harmony-logging-v1.patch
        3 kB
        Aleksey Shipilev
      2. testLogger.java
        0.1 kB
        Aleksey Shipilev

        Activity

        Hide
        Aleksey Shipilev added a comment -

        testLogger.java
        The test.

        Show
        Aleksey Shipilev added a comment - testLogger.java The test.
        Hide
        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 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 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 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
        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
        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
        Ian Rogers added a comment -

        WIP patch committed in r14859.

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

        Fix in r14898.

        Show
        Ian Rogers added a comment - Fix in r14898.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: