Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8157306

Random infrequent null pointer exceptions in javac

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 8u92, 9
    • Fix Version/s: 9
    • Component/s: hotspot
    • Subcomponent:
    • Resolved In Build:
      b131
    • CPU:
      generic
    • OS:
      linux

      Backports

        Description

        For jdk8u test case: hotspot/test/runtime/6925573/SortMethodsTest.java, I witnessed random infrequent null pointer exceptions in javac with aarch64 jdk built from the latest jdk9-hs-comp branch.

        Note: This issue is only reproducable under -XX:+UseParallelGC, it does not happens with the default G1GC for jdk9. Also reproducable with the latest aarch64-jdk8u branch. I have also found that turning off instruction scheduling (-XX:-OptoScheduling) or turning off narrow class pointers (-XX:-UseCompressedClassPointers) makes it go away. Also it's easier to reproduce the bug when the memory subsystem is under high pressure. For example, running specjbb2005 with 32 warehouses in parallel. Somehow I suspect this issue is related to the aarch64 weak memory model.
        To reproduce the bug, one need to search the jtreg log for each run of the test, something like this:
          jtreg -va -nr hotspot/test/runtime/6925573/SortMethodsTest.java &> log
          msg=`egrep NullPointerException log`
          if [ "$msg" != "" ]; then
          cat log;
          break;
          fi

        JTreg error message:
        10 x more methods requires 0 x more time
        10 x more methods requires 2 x more time
        STDERR:
        An exception has occurred in the compiler (9-internal). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program and the following diagnostic in your report. Thank you.
        java.lang.NullPointerException
                at com.sun.tools.javac.comp.Lower.visitReturn(jdk.compiler@9-internal/Lower.java:3635)
                at com.sun.tools.javac.tree.JCTree$JCReturn.accept(jdk.compiler@9-internal/JCTree.java:1526)
                at com.sun.tools.javac.tree.TreeTranslator.translate(jdk.compiler@9-internal/TreeTranslator.java:58)
                at com.sun.tools.javac.comp.Lower.translate(jdk.compiler@9-internal/Lower.java:2392)
                at com.sun.tools.javac.tree.TreeTranslator.translate(jdk.compiler@9-internal/TreeTranslator.java:70)
                at com.sun.tools.javac.tree.TreeTranslator.visitBlock(jdk.compiler@9-internal/TreeTranslator.java:167)
                at com.sun.tools.javac.comp.Lower.visitBlock(jdk.compiler@9-internal/Lower.java:3608)
                at com.sun.tools.javac.tree.JCTree$JCBlock.accept(jdk.compiler@9-internal/JCTree.java:1000)
                at com.sun.tools.javac.tree.TreeTranslator.translate(jdk.compiler@9-internal/TreeTranslator.java:58)
                at com.sun.tools.javac.comp.Lower.translate(jdk.compiler@9-internal/Lower.java:2392)
                at com.sun.tools.javac.tree.TreeTranslator.visitMethodDef(jdk.compiler@9-internal/TreeTranslator.java:150)
                at com.sun.tools.javac.comp.Lower.visitMethodDefInternal(jdk.compiler@9-internal/Lower.java:2853)
                at com.sun.tools.javac.comp.Lower.visitMethodDef(jdk.compiler@9-internal/Lower.java:2765)
                at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(jdk.compiler@9-internal/JCTree.java:852)
                at com.sun.tools.javac.tree.TreeTranslator.translate(jdk.compiler@9-internal/TreeTranslator.java:58)
                at com.sun.tools.javac.comp.Lower.translate(jdk.compiler@9-internal/Lower.java:2392)
                at com.sun.tools.javac.comp.Lower.visitClassDef(jdk.compiler@9-internal/Lower.java:2538)
                at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(jdk.compiler@9-internal/JCTree.java:760)
                at com.sun.tools.javac.tree.TreeTranslator.translate(jdk.compiler@9-internal/TreeTranslator.java:58)
                at com.sun.tools.javac.comp.Lower.translate(jdk.compiler@9-internal/Lower.java:2392)
                at com.sun.tools.javac.comp.Lower.translate(jdk.compiler@9-internal/Lower.java:2411)
                at com.sun.tools.javac.comp.Lower.translateTopLevelClass(jdk.compiler@9-internal/Lower.java:3977)
                at com.sun.tools.javac.main.JavaCompiler.desugar(jdk.compiler@9-internal/JavaCompiler.java:1543)
                at com.sun.tools.javac.main.JavaCompiler.desugar(jdk.compiler@9-internal/JavaCompiler.java:1401)
                at com.sun.tools.javac.main.JavaCompiler.compile(jdk.compiler@9-internal/JavaCompiler.java:940)
                at com.sun.tools.javac.api.JavacTaskImpl$1.call(jdk.compiler@9-internal/JavacTaskImpl.java:104)
                at com.sun.tools.javac.api.JavacTaskImpl$1.call(jdk.compiler@9-internal/JavacTaskImpl.java:100)
                at com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(jdk.compiler@9-internal/JavacTaskImpl.java:135)
                at com.sun.tools.javac.api.JavacTaskImpl.doCall(jdk.compiler@9-internal/JavacTaskImpl.java:100)
                at com.sun.tools.javac.api.JavacTaskImpl.call(jdk.compiler@9-internal/JavacTaskImpl.java:94)
                at SortMethodsTest.main(SortMethodsTest.java:90)
                at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(java.base@9-internal/Native Method)
                at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(java.base@9-internal/NativeMethodAccessorImpl.java:62)
                at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(java.base@9-internal/DelegatingMethodAccessorImpl.java:43)
                at java.lang.reflect.Method.invoke(java.base@9-internal/Method.java:531)
                at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:92)
                at java.lang.Thread.run(java.base@9-internal/Thread.java:843)

          Issue Links

            Activity

            Hide
            dpochepk Dmitrij Pochepko added a comment -
            ILW = javac doesn't work; rarely; none = HLH = P2
            Show
            dpochepk Dmitrij Pochepko added a comment - ILW = javac doesn't work; rarely; none = HLH = P2
            Show
            kvn Vladimir Kozlov added a comment - webrev: http://cr.openjdk.java.net/~aph/8157306.1/
            Hide
            hgupdate HG Updates added a comment -
            URL: http://hg.openjdk.java.net/jdk9/hs-comp/hotspot/rev/f6c7981c093e
            User: kvn
            Date: 2016-07-25 21:17:29 +0000
            Show
            hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/hs-comp/hotspot/rev/f6c7981c093e User: kvn Date: 2016-07-25 21:17:29 +0000
            Hide
            hgupdate HG Updates added a comment -
            URL: http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/f6c7981c093e
            User: lana
            Date: 2016-08-10 20:19:27 +0000
            Show
            hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/f6c7981c093e User: lana Date: 2016-08-10 20:19:27 +0000
            Hide
            kvn Vladimir Kozlov added a comment -
            No new tests were added since the problem showed with existing Hotspot jtreg tests.
            Show
            kvn Vladimir Kozlov added a comment - No new tests were added since the problem showed with existing Hotspot jtreg tests.

              People

              • Assignee:
                aph Andrew Haley
                Reporter:
                fyang Felix Yang
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: