JVM core dump and attach to jsadebugd problem

Hi everyone,

I was looking for a way to dump the complete state of a JVM (all runing threads, objects, ...) and afterwards to analize the dumped data. I have found a thread(http://forum.java.sun.com/thread.jspa?threadID=735052) here in the forums with some explainations how this could be done using the Java 2 sdk 1.5.0 - troubleshooting tools (http://java.sun.com/j2se/1.5.0/docs/tooldocs/experimentaltools.html).

I've made a small application, which starts a thread and just prints out continously some messages to the console.

After that I attached with gdb to the running process as described, and generated a core file.

Unfortunatelly on calling jdsadebugd with the core dump it throws the following exception:

jsadebugd /..../jdk1.5.0_07/bin/java core.18294 DebServ

Attaching to core core.18294 from executable /.../jdk1.5.0_07/bin/java and starting RMI services, please wait...

Error attaching to core file or starting server: sun.jvm.hotspot.debugger.DebuggerException: Can't attach to the core file

at sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.attach0(Native Method)

at sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.attach(LinuxDebuggerLocal.java:258)

at sun.jvm.hotspot.HotSpotAgent.attachDebugger(HotSpotAgent.java:624)

at sun.jvm.hotspot.HotSpotAgent.setupDebuggerLinux(HotSpotAgent.java:610)

at sun.jvm.hotspot.HotSpotAgent.setupDebugger(HotSpotAgent.java:323)

at sun.jvm.hotspot.HotSpotAgent.go(HotSpotAgent.java:298)

at sun.jvm.hotspot.HotSpotAgent.startServer(HotSpotAgent.java:234)

at sun.jvm.hotspot.DebugServer.run(DebugServer.java:94)

at sun.jvm.hotspot.DebugServer.main(DebugServer.java:29)

at sun.jvm.hotspot.jdi.SADebugServer.main(SADebugServer.java:46)

Even if I try to print the shared objects mapping with jmap it fails with the following message:

jmap /.../jdk1.5.0_07/bin/java core.18294

Attaching to core core.18294 from executable /.../jdk1.5.0_07/bin/java, please wait...

Error attaching to core file: Can't attach to the core file

Does anyone have an idea what goes wrong here?

[2217 byte] By [painkillera] at [2007-10-3 1:31:46]
# 1

You will see this problem if sadebugd can not get all the necessary information like elf header, core file segment, loaded lib info, or.. from the core file.

Are you able to open the core file from gdb? Are you able to see threads and other information from gdb?

Thanks,

Swamy

swamyva at 2007-7-14 18:29:40 > top of Java-index,Archived Forums,Debugging Tools and Techniques...