JDK-6357598 : SA: java.lang.NullPointerException from jstack on compiled frame
  • Type: Bug
  • Component: core-svc
  • Sub-Component: tools
  • Affected Version: 5.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • CPU: x86
  • Submitted: 2005-12-01
  • Updated: 2010-08-19
  • Resolved: 2006-07-13
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
JVMs were on:

> java -version
java version "1.5.0_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_04-b05)
Java HotSpot(TM) Client VM (build 1.5.0_04-b05, mixed mode, sharing)

jstack itself was from 1.5.0_05

ADDITIONAL OS VERSION INFORMATION :
> uname -a
Linux sentrion.demo.sendmail.com 2.6.12.5 #1 SMP Wed Oct 5 02:50:11 UTC 2005 i686 pentium4 i386 GNU/Linux


A DESCRIPTION OF THE PROBLEM :
When I run jstack against a Tomcat application it works fine, i.e., I get a stack trace with no issues or errors. Against another one of our applications (standalone java application not in Tomcat) I get numerous errors like:

Thread 3131: (state = BLOCKED)
 - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be imprecise)
 - com.sendmail.iocaine.servers.mail.smtp.jilter.ProcessorQueue.getNextItem(long) @bci=89, line=106 (Compiled frame)
 - com.sendmail.iocaine.servers.mail.smtp.jilter.JilterProcessor.runThread() @bci=40, line=64 (Compiled frame)
Error occurred during stack walking:
java.lang.NullPointerException
        at sun.jvm.hotspot.runtime.Frame.addressOfStackSlot(Frame.java:214)
        at sun.jvm.hotspot.runtime.x86.X86Frame.addressOfInterpreterFrameMethod(X86Frame.java:442)
        at sun.jvm.hotspot.runtime.Frame.getInterpreterFrameMethod(Frame.java:354)
        at sun.jvm.hotspot.runtime.InterpretedVFrame.getMethod(InterpretedVFrame.java:19)
        at sun.jvm.hotspot.tools.StackTrace.run(StackTrace.java:51)
        at sun.jvm.hotspot.tools.JStack.run(JStack.java:41)
        at sun.jvm.hotspot.tools.Tool.start(Tool.java:204)
        at sun.jvm.hotspot.tools.JStack.main(JStack.java:58)

I think maybe the key here is the "compiled frame" part of this. The working case against Tomcat was all with "interpreted frames".

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run jstack against a running version of our stanalone application.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I expect a jstack dump without errors.
ACTUAL -
Numerous threads fail to dump stack as follows:

Thread 3131: (state = BLOCKED)
 - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be imprecise)
 - com.sendmail.iocaine.servers.mail.smtp.jilter.ProcessorQueue.getNextItem(long) @bci=89, line=106 (Compiled frame)
 - com.sendmail.iocaine.servers.mail.smtp.jilter.JilterProcessor.runThread() @bci=40, line=64 (Compiled frame)
Error occurred during stack walking:
java.lang.NullPointerException
        at sun.jvm.hotspot.runtime.Frame.addressOfStackSlot(Frame.java:214)
        at sun.jvm.hotspot.runtime.x86.X86Frame.addressOfInterpreterFrameMethod(X86Frame.java:442)
        at sun.jvm.hotspot.runtime.Frame.getInterpreterFrameMethod(Frame.java:354)
        at sun.jvm.hotspot.runtime.InterpretedVFrame.getMethod(InterpretedVFrame.java:19)
        at sun.jvm.hotspot.tools.StackTrace.run(StackTrace.java:51)
        at sun.jvm.hotspot.tools.JStack.run(JStack.java:41)
        at sun.jvm.hotspot.tools.Tool.start(Tool.java:204)
        at sun.jvm.hotspot.tools.JStack.main(JStack.java:58)

ERROR MESSAGES/STACK TRACES THAT OCCUR :
See Actual Result above.

REPRODUCIBILITY :
This bug can be reproduced always.

Comments
EVALUATION The java frames some times are not in a walkable state and the SA currently is not robust enough to handle such condition so it throws some random exception. We need to fix SA to handle this condition. In 1.6.0 jstack uses SIGQUIT handler to get stack dump for live process which can change the java frames to walkable state and you will not see this problem. I would suggest to use 1.6.0 jstack. I am closing this bug as duplicate of 6326210. -Swamyv
13-07-2006

EVALUATION No time to fix this for mustang. *** (#1 of 1): [ UNSAVED ] ###@###.###
09-12-2005