jstack thread dump error: get_thread_regs failed for a lwp
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
sun-java6 (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
When using jstack on 9.10 x86_64 (2.6.31-302-rs #7 SMP), with sun-java6-jdk (6.20dlj-
Example:
$ jstack -F 8812
Attaching to process ID 8819, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 16.3-b01
Deadlock Detection:
No deadlocks found.
Thread 8863: (state = BLOCKED)
Error occurred during stack walking:
sun.jvm.
at sun.jvm.
at sun.jvm.
at sun.jvm.
at sun.jvm.
at sun.jvm.
at sun.jvm.
at sun.jvm.
at sun.jvm.
at sun.jvm.
at sun.jvm.
at sun.jvm.
at sun.reflect.
at sun.reflect.
at sun.reflect.
at java.lang.
at sun.tools.
at sun.tools.
Caused by: sun.jvm.
at sun.jvm.
at sun.jvm.
at sun.jvm.
at sun.jvm.
AFAIK this is unexpected behavior, and instead a working thread dump should be shown. Unfortunately this is my first experience with jstack so I don't know exactly what I should be seeing.
Changed in sun-java6 (Ubuntu): | |
status: | Invalid → New |
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) 64-Bit Server VM (build 16.3-b01, mixed mode)
ubuntu 10.04 LTS 64-bit
You must invoke jstack as the user who started/is running the given process.
The above error occurs if you invoke jstack as "root"/via sudo (Has Super Cow Powers but is still the wrong user)
I guess you tried the "-F" option, because it didn't work without it. Therefore, you tried the sledgehammer :). "-F" IS for a hung process.
If you want to create a thread dump of e.g. tomcat6 (installed from ubuntu package repo) you must type the following:
"sudo -u tomcat6 jstack 8812"
Executes jstack as user tomcat6, who is running the service tomcat6, assuming tomcat's pid is 8812.
This is not an ubuntu bug, it's - say - some sort of usability issue with this jstack thing. Blame Sun/Oracle . . .