"DebuggerException: Can't attach to the core file" message when attaching to core file with jhsdb/jmap/jdb
Issue
The following exception occurs when trying to load a core file in jdb.
java.io.IOException
at sun.jvm.hotspot.jdi.SACoreAttachingConnector.attach(SACoreAttachingConnector.java:139)
at com.sun.tools.example.debug.tty.VMConnection.attachTarget(VMConnection.java:349)
at com.sun.tools.example.debug.tty.VMConnection.open(VMConnection.java:159)
at com.sun.tools.example.debug.tty.Env.init(Env.java:55)
at com.sun.tools.example.debug.tty.TTY.main(TTY.java:1045)
Caused by: java.lang.reflect.InvocationTargetException
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:616)
at sun.jvm.hotspot.jdi.SACoreAttachingConnector.createVirtualMachine(SACoreAttachingConnector.java:96)
at sun.jvm.hotspot.jdi.SACoreAttachingConnector.attach(SACoreAttachingConnector.java:124)
... 4 more
Caused by: sun.jvm.hotspot.debugger.DebuggerException: Can't attach to the core file
...
The following exception occurs when try to create a heap dump from a core using jhsdb:
$JAVA_HOME/bin/jhsdb jmap --binaryheap --dumpfile pid.hprof --exe $JAVA_HOME/bin/java --core core.pid
Attaching to core core.pid from executable /usr/lib/jvm/java-11-openjdk-11.0.6.10-4.el8.x86_64/bin/java, please wait...
Error attaching to core file: Can't attach to the core file
sun.jvm.hotspot.debugger.DebuggerException: Can't attach to the core file
...
When using LIBSAPROC_DEBUG=1, one the following messages appears before the error:
libsaproc DEBUG: lookup failed for symbol 'UseSharedSpaces' in obj '/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/server/libjvm.so'
libsaproc DEBUG: can't lookup 'UseSharedSpaces' flag
libsaproc DEBUG: can't locate map_info at 0x555835f3d000
libsaproc DEBUG: core read failed for 16 byte(s) @ 0x555835f3d000 (15 more bytes)
libsaproc DEBUG: can't read debug info from _DYNAMIC
Environment
- OpenJDK
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.