JDK-8046560 : UnmappedAddressException while attaching to process or core when CDS is used
  • Type: Bug
  • Component: hotspot
  • Sub-Component: svc-agent
  • Affected Version: 8,9,10
  • Priority: P3
  • Status: Resolved
  • Resolution: Duplicate
  • Submitted: 2014-06-11
  • Updated: 2019-08-15
  • Resolved: 2018-09-19
Related Reports
Duplicate :  
Description
SACoreAttachingConnector.attach throws UnmappedAddressException if core was generated for process that use CDS:

> cat Test.java 
public class Test {
    public static void main(String args[]) {
        while (true) {}
    }
}
> $JAVA_HOME/bin/java -Xshare:dump
> $JAVA_HOME/bin/java -Xshare:on Test &
> kill -11 $!
> $JAVA_HOME/bin/jstack $JAVA_HOME/bin/java core

Attaching to core core from executable jdk1.8.0/bin/java, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 25.0-b70
Deadlock Detection:

sun.jvm.hotspot.debugger.UnmappedAddressException: 800026c08
	at sun.jvm.hotspot.debugger.PageCache.checkPage(PageCache.java:208)
	at sun.jvm.hotspot.debugger.PageCache.getData(PageCache.java:63)
	at sun.jvm.hotspot.debugger.DebuggerBase.readBytes(DebuggerBase.java:225)
	at sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.readCInteger(LinuxDebuggerLocal.java:498)
	at sun.jvm.hotspot.debugger.linux.LinuxAddress.getCIntegerAt(LinuxAddress.java:69)
	at sun.jvm.hotspot.oops.CIntField.getValue(CIntField.java:49)
	at sun.jvm.hotspot.oops.CIntField.getValue(CIntField.java:46)
	at sun.jvm.hotspot.utilities.GenericArray.length(GenericArray.java:46)
	at sun.jvm.hotspot.oops.InstanceKlass.getAllFieldsCount(InstanceKlass.java:335)
	at sun.jvm.hotspot.oops.InstanceKlass.<init>(InstanceKlass.java:119)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
	at sun.jvm.hotspot.runtime.VMObjectFactory.newObject(VMObjectFactory.java:58)
	at sun.jvm.hotspot.runtime.VirtualBaseConstructor.instantiateWrapperFor(VirtualBaseConstructor.java:104)
	at sun.jvm.hotspot.oops.Metadata.instantiateWrapperFor(Metadata.java:68)
	at sun.jvm.hotspot.oops.Oop.getKlassForOopHandle(Oop.java:211)
	at sun.jvm.hotspot.oops.ObjectHeap.newOop(ObjectHeap.java:251)
	at sun.jvm.hotspot.runtime.JavaThread.getThreadObj(JavaThread.java:335)
	at sun.jvm.hotspot.runtime.JavaThread.getCurrentParkBlocker(JavaThread.java:387)
	at sun.jvm.hotspot.runtime.DeadlockDetector.print(DeadlockDetector.java:82)
	at sun.jvm.hotspot.runtime.DeadlockDetector.print(DeadlockDetector.java:39)
	at sun.jvm.hotspot.tools.StackTrace.run(StackTrace.java:62)
	at sun.jvm.hotspot.tools.StackTrace.run(StackTrace.java:45)
	at sun.jvm.hotspot.tools.JStack.run(JStack.java:66)
	at sun.jvm.hotspot.tools.Tool.startInternal(Tool.java:260)
	at sun.jvm.hotspot.tools.Tool.start(Tool.java:223)
	at sun.jvm.hotspot.tools.Tool.execute(Tool.java:118)
	at sun.jvm.hotspot.tools.JStack.main(JStack.java:92)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at sun.tools.jstack.JStack.runJStackTool(JStack.java:140)
	at sun.tools.jstack.JStack.main(JStack.java:106)

Issue could be reproduced with latest 8 and 9 builds. I was able to reproduce it starting from 8 FCS, did not try previous trains yet.
Comments
duplicates JDK-8200613
19-09-2018

Attaching to a CDS process went through without any issue using jhsdb. Attaching to a corefile from a CDS process using 'jhsdb' had an issue attaching to the corefile. This is on Linux x64. [ jini-VirtualBox hs ] $ /home/jini/jdk10/hs/build/linux-x86_64-normal-server-slowdebug/images/jdk/bin/jhsdb clhsdb --exe /home/jini/jdk10/hs/build/linux-x86_64-normal-server-slowdebug/images/jdk/bin/java --core /tmp/sa.core.3629 Opening core file, please wait... Unable to open core file /tmp/sa.core.3629: Can't attach to the core file sun.jvm.hotspot.debugger.DebuggerException: Can't attach to the core file at jdk.hotspot.agent/sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.attach0(Native Method) at jdk.hotspot.agent/sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.attach(LinuxDebuggerLocal.java:286) at jdk.hotspot.agent/sun.jvm.hotspot.HotSpotAgent.attachDebugger(HotSpotAgent.java:679) at jdk.hotspot.agent/sun.jvm.hotspot.HotSpotAgent.setupDebuggerLinux(HotSpotAgent.java:617) at jdk.hotspot.agent/sun.jvm.hotspot.HotSpotAgent.setupDebugger(HotSpotAgent.java:339) at jdk.hotspot.agent/sun.jvm.hotspot.HotSpotAgent.go(HotSpotAgent.java:306) at jdk.hotspot.agent/sun.jvm.hotspot.HotSpotAgent.attach(HotSpotAgent.java:158) at jdk.hotspot.agent/sun.jvm.hotspot.CLHSDB.attachDebugger(CLHSDB.java:202) at jdk.hotspot.agent/sun.jvm.hotspot.CLHSDB.run(CLHSDB.java:63) at jdk.hotspot.agent/sun.jvm.hotspot.CLHSDB.main(CLHSDB.java:40) at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.runCLHSDB(SALauncher.java:191) at jdk.hotspot.agent/sun.jvm.hotspot.SALauncher.main(SALauncher.java:439)
15-02-2017