"DebuggerException: Can't attach to the core file" message when attaching to core file with jdb

Solution Verified - Updated -

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
    at sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.attach0(Native Method)
    at sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.attach(LinuxDebuggerLocal.java:276)
    at sun.jvm.hotspot.HotSpotAgent.attachDebugger(HotSpotAgent.java:648)
    at sun.jvm.hotspot.HotSpotAgent.setupDebuggerLinux(HotSpotAgent.java:634)
    at sun.jvm.hotspot.HotSpotAgent.setupDebugger(HotSpotAgent.java:339)
    at sun.jvm.hotspot.HotSpotAgent.go(HotSpotAgent.java:314)
    at sun.jvm.hotspot.HotSpotAgent.attach(HotSpotAgent.java:174)
    at sun.jvm.hotspot.jdi.VirtualMachineImpl.createVirtualMachineForCorefile(VirtualMachineImpl.java:206)
    ... 10 more

When using LIBSAPROC_DEBUG=1, the following messages appear 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

Environment

  • Java

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.