JDK-6670173 : SA: jstack fails due to null sp on x86
  • Type: Bug
  • Component: core-svc
  • Sub-Component: tools
  • Affected Version: 5.0
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: solaris_10
  • CPU: x86
  • Submitted: 2008-03-02
  • Updated: 2014-02-26
  • Resolved: 2009-03-24
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.4.2_21Fixed
Related Reports
Relates :  
Description
Observed on Solaris 10 x86, jstack fails to give a stacktrace. 

e.g.
(5.10)$ jstack 2135
Attaching to process ID 2135, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 1.5.0_14-b03
Thread t@1: (state = BLOCKED)


Thread t@14: (state = BLOCKED)


Thread t@13: (state = BLOCKED)


...

This failure is not observed on Solaris 8 x86.

Comments
WORK AROUND None.
02-03-2008

EVALUATION In X86CurrentFrameGuess we are finding a null sp from the thread context, and bailing out. In JDK6 as part of 6463133, we change the "frame guesser" to look again if the sp it finds is null. Putting this single change from that CR into 5.0 makes jstack work. (Another tactic of starting guessing from fp instead of sp also worked.) *** (#1 of 1): [ UNSAVED ] ###@###.###
02-03-2008

SUGGESTED FIX Copy this change from JDK6: hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/x86/X86CurrentFrameGuess.java 1.1 if (sp == null) { 1.10.1.1 // Bail out if no last java frame eithe 1.10.1.1 if (thread.getLastJavaSP() != null) { 1.10.1.1 setValues(thread.getLastJavaSP(), thread.getLastJavaFP(), null); 1.10.1.1 return true; 1.10.1.1 } 1.1 // Bail out
02-03-2008