Hi all,

documentation for SA Debug Server Attaching Connector here: https://docs.oracle.com/javase/8/docs/technotes/guides/jpda/conninv.html#Connectors states that the SADebugServer has to run on the same vm version as the debugee process, but "the debugger does not have to be the same bit size and version." However any attempts to connect from another version fail with sun.jvm.hotspot.runtime.VMVersionMismatchException.

Please help, what do I do wrong (locally for simplicity):
- start the debugee process with jdk1.8.0_162  - get the PID
- start "jdk1.8.0_162\bin>jsadebugd.exe PID" - all starts well
- trying to attach jstack, jdb or whatever from another version:
jdk1.8.0_152\bin>jstack localhost
Attaching to remote server localhost, please wait...
Error attaching to remote server: sun.jvm.hotspot.runtime.VMVersionMismatchException: Supported versions are 25.152-b16. Target VM is 25.162-b12 sun.jvm.hotspot.debugger.DebuggerException: sun.jvm.hotspot.runtime.VMVersionMismatchException: Supported versions are 25.152-b16. Target VM is 25.162-b12

jdk1.8.0_152\bin>jdb -connect "sun.jvm.hotspot.jdi.SADebugServerAttachingConnector:debugServerName=localhost"
java.io.IOException
        at sun.jvm.hotspot.jdi.SADebugServerAttachingConnector.attach(SADebugServerAttachingConnector.java:106)         at com.sun.tools.example.debug.tty.VMConnection.attachTarget(VMConnection.java:519)         at com.sun.tools.example.debug.tty.VMConnection.open(VMConnection.java:328)
        at com.sun.tools.example.debug.tty.Env.init(Env.java:63)
        at com.sun.tools.example.debug.tty.TTY.main(TTY.java:1082)
Caused by: java.lang.reflect.InvocationTargetException
        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:498)
        at sun.jvm.hotspot.jdi.SADebugServerAttachingConnector.createVirtualMachine(SADebugServerAttachingConnector.java:72)         at sun.jvm.hotspot.jdi.SADebugServerAttachingConnector.attach(SADebugServerAttachingConnector.java:91)
        ... 4 more
Caused by: sun.jvm.hotspot.debugger.DebuggerException: sun.jvm.hotspot.runtime.VMVersionMismatchException: Supported versions are 25.152-b16. Target VM is 25.162-b12
        at sun.jvm.hotspot.HotSpotAgent.setupVM(HotSpotAgent.java:435)
        at sun.jvm.hotspot.HotSpotAgent.go(HotSpotAgent.java:305)
        at sun.jvm.hotspot.HotSpotAgent.attach(HotSpotAgent.java:183)
        at sun.jvm.hotspot.jdi.VirtualMachineImpl.createVirtualMachineForServer(VirtualMachineImpl.java:241)
        ... 10 more
Caused by: sun.jvm.hotspot.runtime.VMVersionMismatchException: Supported versions are 25.152-b16. Target VM is 25.162-b12
        at sun.jvm.hotspot.runtime.VM.checkVMVersion(VM.java:227)
        at sun.jvm.hotspot.runtime.VM.<init>(VM.java:294)
        at sun.jvm.hotspot.runtime.VM.initialize(VM.java:370)
        at sun.jvm.hotspot.HotSpotAgent.setupVM(HotSpotAgent.java:431)
        ... 13 more

Thanks!

--
Egor Ushakov
Software Developer
JetBrains
http://www.jetbrains.com
The Drive to Develop

Reply via email to