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

sun/tools/jhsdb/HeapDumpTestWithActiveProcess.java fails with NullPointerException

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 15
    • Fix Version/s: 15
    • Component/s: hotspot
    • Subcomponent:
    • Resolved In Build:
      b25

      Description

      java.lang.NullPointerException
      at jdk.hotspot.agent/sun.jvm.hotspot.oops.NarrowOopField.getValueAsOopHandle(NarrowOopField.java:49)
      at jdk.hotspot.agent/sun.jvm.hotspot.utilities.HeapHprofBinWriter.writeField(HeapHprofBinWriter.java:1042)
      at jdk.hotspot.agent/sun.jvm.hotspot.utilities.HeapHprofBinWriter.writeFieldDescriptors(HeapHprofBinWriter.java:981)
      at jdk.hotspot.agent/sun.jvm.hotspot.utilities.HeapHprofBinWriter.writeClassDumpRecord(HeapHprofBinWriter.java:663)
      at jdk.hotspot.agent/sun.jvm.hotspot.utilities.HeapHprofBinWriter$1.visit(HeapHprofBinWriter.java:600)
      at jdk.hotspot.agent/sun.jvm.hotspot.classfile.ClassLoaderData.classesDo(ClassLoaderData.java:105)
      at jdk.hotspot.agent/sun.jvm.hotspot.classfile.ClassLoaderDataGraph.classesDo(ClassLoaderDataGraph.java:84)
      at jdk.hotspot.agent/sun.jvm.hotspot.utilities.HeapHprofBinWriter.writeClassDumpRecords(HeapHprofBinWriter.java:596)
      at jdk.hotspot.agent/sun.jvm.hotspot.utilities.HeapHprofBinWriter.write(HeapHprofBinWriter.java:442)
      at jdk.hotspot.agent/sun.jvm.hotspot.tools.JMap.writeHeapHprofBin(JMap.java:182)
      at jdk.hotspot.agent/sun.jvm.hotspot.tools.JMap.run(JMap.java:97)
      at jdk.hotspot.agent/sun.jvm.hotspot.tools.Tool.startInternal(Tool.java:262)
      at jdk.hotspot.agent/sun.jvm.hotspot.tools.Tool.start(Tool.java:225)
      at jdk.hotspot.agent/sun.jvm.hotspot.tools.Tool.execute(Tool.java:118)
      at jdk.hotspot.agent/sun.jvm.hotspot.tools.JMap.main(JMap.java:176)
      at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.runJMAP(SALauncher.java:331)
      at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.main(SALauncher.java:483)

      Only one failure so far. This test is spent most of it's life on the problem list due to multiple issues which have been addressed recently, thus its removal from the problem list. I didn't see it fail in this manner after rigorous testing, so I'm guessing it is very rare.

      Based on the stack trace, it looks like this may be similar in a way to the NPE we got in JDK-8243210. The problem is that if you try to create an Address object for address 0, you get a null back rather than an Address object that references address 0. Parts of SA, and the heap walkers are one, need to be able to deal with possibly invalid addresses, so normally some sanity check is done on the address, and part of the sanity check needs to be to check for a null Address. There might be a missing null check here.

      I should also add this this bug is likely instigated by the fact that the target is actively mutating, thus increasing the likelihood of the heap being in a state where it cannot be 100% safely walked, but like I said, SA is suppose to deal with this by doing address validation.

        Attachments

          Activity

            People

            • Assignee:
              cjplummer Chris Plummer
              Reporter:
              cjplummer Chris Plummer
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: