JDK-6602406 : jstack -m (mixed threads) throws NullPointerException
  • Type: Bug
  • Component: core-svc
  • Sub-Component: tools
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Won't Fix
  • OS: linux
  • CPU: x86
  • Submitted: 2007-09-07
  • Updated: 2023-12-14
  • Resolved: 2016-11-04
Related Reports
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.6.0_02"
Java(TM) SE Runtime Environment (build 1.6.0_02-b05)
Java HotSpot(TM) Client VM (build 1.6.0_02-b05, mixed mode, sharing)

also tested with 1.6.0_01

ADDITIONAL OS VERSION INFORMATION :
Linux heffer.pirobase.de 2.6.17-13mdv #1 SMP Fri Mar 23 19:03:31 UTC 2007 i686 Intel(R) Pentium(R) D CPU 3.00GHz GNU/Linux

and Ubuntu 7.04

A DESCRIPTION OF THE PROBLEM :
jstack -m <pid> in jdk1.6 just throws a lot of NullPointerException instead of reporting something useful:

Attaching to process ID 30466, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 1.6.0_01-b06
Deadlock Detection:

No deadlocks found.

----------------- 30467 -----------------
java.lang.NullPointerException
        at sun.jvm.hotspot.tools.PStack.printUnknown(PStack.java:207)
        at sun.jvm.hotspot.tools.PStack.run(PStack.java:130)
        at sun.jvm.hotspot.tools.PStack.run(PStack.java:36)
        at sun.jvm.hotspot.tools.PStack.run(PStack.java:31)
        at sun.jvm.hotspot.tools.JStack.run(JStack.java:43)
        at sun.jvm.hotspot.tools.Tool.start(Tool.java:204)
        at sun.jvm.hotspot.tools.JStack.main(JStack.java:69)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at sun.tools.jstack.JStack.runJStackTool(JStack.java:118)
        at sun.tools.jstack.JStack.main(JStack.java:84)
...

the same was working in jdk1.5.0_07 (only 1.5 release I tested). I also tested with the last jdk7 snapshot:

java version "1.7.0-ea"
Java(TM) SE Runtime Environment (build 1.7.0-ea-b13)
Java HotSpot(TM) Client VM (build 1.7.0-ea-b13, mixed mode, sharing)

there it seems to work, at least some threads are dumped. But there I get a lot of these:

sun.jvm.hotspot.debugger.UnalignedAddressException: Trying to read at address: 0x466e3a6e with alignm                                               ent: 4
        at sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal$1.checkAlignment(LinuxDebuggerLocal.java                                               :181)
        at sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.readCInteger(LinuxDebuggerLocal.java:469                                               )
        at sun.jvm.hotspot.debugger.DebuggerBase.readAddressValue(DebuggerBase.java:442)
        at sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.readAddress(LinuxDebuggerLocal.java:423)
        at sun.jvm.hotspot.debugger.linux.LinuxAddress.getAddressAt(LinuxAddress.java:74)
        at sun.jvm.hotspot.debugger.linux.x86.LinuxX86CFrame.sender(LinuxX86CFrame.java:60)
        at sun.jvm.hotspot.tools.PStack.run(PStack.java:161)
        at sun.jvm.hotspot.tools.PStack.run(PStack.java:53)
        at sun.jvm.hotspot.tools.PStack.run(PStack.java:48)
        at sun.jvm.hotspot.tools.JStack.run(JStack.java:60)
        at sun.jvm.hotspot.tools.Tool.start(Tool.java:221)
        at sun.jvm.hotspot.tools.JStack.main(JStack.java:86)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:624)
        at sun.tools.jstack.JStack.runJStackTool(JStack.java:136)
        at sun.tools.jstack.JStack.main(JStack.java:102)


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
call jstack -m on some pid with a java process

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
a mixed thread dump
ACTUAL -
NullPointerException

ERROR MESSAGES/STACK TRACES THAT OCCUR :
see attachment


REPRODUCIBILITY :
This bug can be reproduced always.

Release Regression From : 5.0u12
The above release value was the last known release where this 
bug was not reproducible. Since then there has been a regression.

Comments
This is not on our list of current priorities. If this changes, please reopen this issue.
04-11-2016