[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-serviceability-dev
Subject:    Re: SA Debug attach to another jvm version possible?
From:       Egor Ushakov <egor.ushakov () jetbrains ! com>
Date:       2018-08-21 11:49:22
Message-ID: 27acff51-b607-96c8-ddad-a755e332c904 () jetbrains ! com
[Download RAW message or body]

Thanks, Sharath!


On 21-Aug-18 14:46, Sharath Ballal wrote:
> 
> Hi Egor,
> 
> For JDK 9 and above try this.
> 
> 1. Run the debuggee and get the <pid>
> 
> 2. <jdk>\bin\jhsdb debugd <pid>   (you may need sudo on some platforms)
> 
> 3. <jdk>\bin\java -Dsun.jvm.hotspot.runtime.VM.disableVersionCheck -m 
> jdk.hotspot.agent/sun.jvm.hotspot.tools.HeapDumper localhost (sudo may 
> be needed on some platforms)
> 
> I realized that more bugs are required to be opened.
> 
> 1.   JDK 9 and above jhsdb jstack and other jhsdb tools do not take 
> debug server as a parameter
> 
> 2.   JStack and some other SA tools when invoked in the following 
> manner gives a " remote configuration is not yet implemented" error
> 
> <jdk>\bin\java -m 
> jdk.hotspot.agent/sun.jvm.hotspot.tools.JStack localhost (using same 
> jdk as the debugee)
> 
> Attaching to remote server localhost, please wait...
> 
> Debugger attached successfully.
> 
> Server compiler detected.
> 
> JVM version is 11-ea+22
> 
> remote configuration is not yet implemented
> 
> 3.   Doc changes JDK 10 onwards as sa-jdi.jar has been removed.   This 
> includes code samples.
> 
> I will open bugs for all of these.
> 
> Thanks,
> 
> Sharath
> 
> *From:*Krystal Mok [mailto:rednaxelafx@gmail.com]
> *Sent:* Tuesday, August 21, 2018 4:18 PM
> *To:* Egor Ushakov
> *Cc:* Sharath Ballal; David Holmes; 
> serviceability-dev@openjdk.java.net serviceability-dev@openjdk.java.net
> *Subject:* Re: SA Debug attach to another jvm version possible?
> 
> You're probably looking for <javahome>/jdk.hotspot.agent.jmod ?
> 
> - Kris
> 
> On Tue, Aug 21, 2018 at 3:18 AM, Egor Ushakov 
> <egor.ushakov@jetbrains.com <mailto:egor.ushakov@jetbrains.com>> wrote:
> 
> Thank you all! It is much better now.
> 
> Related question: documentation for java 10
> https://docs.oracle.com/javase/10/docs/specs/jpda/conninv.html#sa-pid-attaching-connector
>  still states that the debug server should be launched with
> sa-jdi.jar in classpath, though there's no such jar in the jdk any
> more.
> java \
> -classpath ${JAVA_HOME}/lib/sa-jdi.jar \
> sun.jvm.hotspot.jdi.SADebugServer
> How should it be launched on jdk 9, 10?
> 
> Thanks,
> Egor
> 
> 
> 
> On 21-Aug-18 11:55, Sharath Ballal wrote:
> 
> Hi David,
> 
> I opened https://bugs.openjdk.java.net/browse/JDK-8209781 for it.
> 
> Thanks,
> Sharath
> 
> 
> -----Original Message-----
> From: David Holmes
> Sent: Tuesday, August 21, 2018 7:47 AM
> To: Sharath Ballal; Egor Ushakov;
> serviceability-dev@openjdk.java.net
> <mailto:serviceability-dev@openjdk.java.net>
> serviceability-dev@openjdk.java.net
> <mailto:serviceability-dev@openjdk.java.net>
> Subject: Re: SA Debug attach to another jvm version possible?
> 
> Hi Sharath,
> 
> On 21/08/2018 3:07 AM, Sharath Ballal wrote:
> 
> Hello Egor,
> 
> By default, SA checks for the exact match of the version
> between the
> debugger and the debuggee.   If you
> 
> In that case we need to fix the referenced documentation that
> states otherwise.
> 
> Cheers,
> David
> 
> want SA to ignore the version, you need to provide the
> "-Dsun.jvm.hotspot.runtime.VM.disableVersionCheck" option to
> the java launcher from the command line.   This is the case
> even if you are not using the debug server.   However since
> 'jstack' and similar tools don't take the "-D" option of java,
> you can invoke it as follows:
> 
> java   -cp <jdk>/lib/sa-jdi.jar
> -Dsun.jvm.hotspot.runtime.VM.disableVersionCheck
> sun.jvm.hotspot.tools.JStack     localhost
> 
> If you invoke the SA tools with this option, you will get
> a warning that the version check has been disabled.
> 
> Example:
> $ <jdk>/bin/java -cp <jdk>/lib/sa-jdi.jar
> -Dsun.jvm.hotspot.runtime.VM.disableVersionCheck
> sun.jvm.hotspot.tools.JStack localhost Attaching to remote
> server localhost, please wait...
> WARNING: You have disabled SA and VM version check. You
> may be using incompatible version of SA and you may see
> unexpected results.
> Debugger attached successfully.
> Server compiler detected.
> JVM version is 25.121-b13
> Deadlock Detection:
> 
> No deadlocks found.
> 
> Thread t@ 2804: (state = BLOCKED)
> 
> 
> Thread t@ 2803: (state = BLOCKED)
> - java.lang.Object.wait(long) @bci=0 (Interpreted frame)
> - java.lang.ref.ReferenceQueue.remove(long) @bci=59,
> line=143 (Interpreted frame)
> - java.lang.ref.ReferenceQueue.remove() @bci=2,
> line=164 (Interpreted frame)
> - java.lang.ref.Finalizer$FinalizerThread.run()
> @bci=36, line=209
> (Interpreted frame)
> 
> 
> Thread t@ 2802: (state = BLOCKED)
> - java.lang.Object.wait(long) @bci=0 (Interpreted frame)
> - java.lang.Object.wait() @bci=2, line=502 (Interpreted
> frame)
> - java.lang.ref.Reference.tryHandlePending(boolean)
> @bci=54, line=191 (Interpreted frame)
> - java.lang.ref.Reference$ReferenceHandler.run()
> @bci=1, line=153
> (Interpreted frame)
> 
> 
> Thread t@ 2798: (state = BLOCKED)
> - java.lang.Thread.sleep(long) @bci=0 (Interpreted frame)
> - HelloWorld.main(java.lang.String[]) @bci=72, line=15
> (Interpreted
> frame)
> 
> 
> Hope this helps.
> 
> Thanks,
> Sharath
> 
> 
> -----Original Message-----
> From: Egor Ushakov [mailto:egor.ushakov@jetbrains.com
> <mailto:egor.ushakov@jetbrains.com>]
> Sent: Monday, August 20, 2018 3:42 PM
> To: serviceability-dev@openjdk.java.net
> <mailto:serviceability-dev@openjdk.java.net>
> serviceability-dev@openjdk.java.net
> <mailto:serviceability-dev@openjdk.java.net>
> Subject: SA Debug attach to another jvm version possible?
> 
> Hi all,
> 
> documentation for SA Debug Server Attaching Connector here:
> https://docs.oracle.com/javase/8/docs/technotes/guides/jpda/conninv.ht
> ml#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.tt
> <http://com.sun.tools.example.debug.tt>y.VMConnection.attachTarget(VMConnection.java:519)
>  at
> com.sun.tools.example.debug.tt
> <http://com.sun.tools.example.debug.tt>y.VMConnection.open(VMConnection.java:328)
> at com.sun.tools.example.debug.tt
> <http://com.sun.tools.example.debug.tt>y.Env.init(Env.java:63)
> at com.sun.tools.example.debug.tt
> <http://com.sun.tools.example.debug.tt>y.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
> 
> 
> -- 
> Egor Ushakov
> Software Developer
> JetBrains
> http://www.jetbrains.com
> The Drive to Develop
> 

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


[Attachment #3 (text/html)]

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Thanks, Sharath!<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 21-Aug-18 14:46, Sharath Ballal
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:ffdcb188-bf1b-4d86-ba28-57c03cce7b61@default">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
	{mso-style-priority:99;
	mso-style-link:"Plain Text Char";
	margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";}
span.EmailStyle17
	{mso-style-type:personal-reply;
	font-family:"Calibri","sans-serif";
	color:#1F497D;}
span.PlainTextChar
	{mso-style-name:"Plain Text Char";
	mso-style-priority:99;
	mso-style-link:"Plain Text";
	font-family:"Calibri","sans-serif";}
.MsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri","sans-serif";}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoPlainText">Hi Egor,<o:p></o:p></p>
        <p class="MsoPlainText"><o:p>  </o:p></p>
        <p class="MsoPlainText">For JDK 9 and above try this.<o:p></o:p></p>
        <p class="MsoPlainText"><o:p>  </o:p></p>
        <p class="MsoPlainText">1. Run the debuggee and get the
          &lt;pid&gt;<o:p></o:p></p>
        <p class="MsoPlainText">2. &lt;jdk&gt;\bin\jhsdb debugd
          &lt;pid&gt;   (you may need sudo on some platforms)<o:p></o:p></p>
        <p class="MsoPlainText">3. &lt;jdk&gt;\bin\java
          -Dsun.jvm.hotspot.runtime.VM.disableVersionCheck -m
          jdk.hotspot.agent/sun.jvm.hotspot.tools.HeapDumper localhost
          (sudo may be needed on some platforms)<o:p></o:p></p>
        <p class="MsoPlainText"><o:p>  </o:p></p>
        <p class="MsoPlainText">I realized that more bugs are required
          to be opened.<o:p></o:p></p>
        <p class="MsoPlainText">1.   JDK 9 and above jhsdb jstack and
          other jhsdb tools do not take debug server as a parameter<o:p></o:p></p>
        <p class="MsoPlainText">2.   JStack and some other SA tools when
          invoked in the following manner gives a " remote configuration
          is not yet implemented" error<o:p></o:p></p>
        <p class="MsoPlainText">                     &lt;jdk&gt;\bin\java -m
          jdk.hotspot.agent/sun.jvm.hotspot.tools.JStack localhost    
          (using same jdk as the debugee)<o:p></o:p></p>
        <p class="MsoPlainText">                   Attaching to remote server
          localhost, please wait...<o:p></o:p></p>
        <p class="MsoPlainText">                   Debugger attached
          successfully.<o:p></o:p></p>
        <p class="MsoPlainText">                   Server compiler \
                detected.<o:p></o:p></p>
        <p class="MsoPlainText">                     JVM version is \
                11-ea+22<o:p></o:p></p>
        <p class="MsoPlainText">                     remote configuration is not
          yet implemented<o:p></o:p></p>
        <p class="MsoPlainText">3.   Doc changes JDK 10 onwards as
          sa-jdi.jar has been removed.   This includes code samples.<o:p></o:p></p>
        <p class="MsoPlainText"><o:p>  </o:p></p>
        <p class="MsoPlainText">I will open bugs for all of these.   <o:p></o:p></p>
        <p class="MsoNormal"><span
style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>  \
</o:p></span></p>  <p class="MsoNormal"><span
style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Thanks,<o:p></o:p></span></p>
  <p class="MsoNormal"><span
style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Sharath<o:p></o:p></span></p>
  <p class="MsoNormal"><span
style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>  \
</o:p></span></p>  <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p> \
</o:p></span></p>  <p class="MsoNormal"><b><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">From:</span></b><span
 style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">
            Krystal Mok [<a class="moz-txt-link-freetext" \
href="mailto:rednaxelafx@gmail.com">mailto:rednaxelafx@gmail.com</a>] <br>  \
<b>Sent:</b> Tuesday, August 21, 2018 4:18 PM<br>  <b>To:</b> Egor Ushakov<br>
            <b>Cc:</b> Sharath Ballal; David Holmes;
            <a class="moz-txt-link-abbreviated" \
href="mailto:serviceability-dev@openjdk.java.net">serviceability-dev@openjdk.java.net</a>
                
            <a class="moz-txt-link-abbreviated" \
href="mailto:serviceability-dev@openjdk.java.net">serviceability-dev@openjdk.java.net</a><br>
  <b>Subject:</b> Re: SA Debug attach to another jvm version
            possible?<o:p></o:p></span></p>
        <p class="MsoNormal"><o:p>  </o:p></p>
        <div>
          <p class="MsoNormal">You're probably looking for
            &lt;javahome&gt;/jdk.hotspot.agent.jmod ?<o:p></o:p></p>
          <div>
            <p class="MsoNormal"><o:p>  </o:p></p>
          </div>
          <div>
            <p class="MsoNormal">- Kris<o:p></o:p></p>
          </div>
        </div>
        <div>
          <p class="MsoNormal"><o:p>  </o:p></p>
          <div>
            <p class="MsoNormal">On Tue, Aug 21, 2018 at 3:18 AM, Egor
              Ushakov &lt;<a href="mailto:egor.ushakov@jetbrains.com"
                target="_blank" \
moz-do-not-send="true">egor.ushakov@jetbrains.com</a>&gt;  wrote:<o:p></o:p></p>
            <blockquote style="border:none;border-left:solid #CCCCCC
              1.0pt;padding:0in 0in 0in
              6.0pt;margin-left:4.8pt;margin-right:0in">
              <p class="MsoNormal">Thank you all! It is much better now.<br>
                <br>
                Related question: documentation for java 10 <a
href="https://docs.oracle.com/javase/10/docs/specs/jpda/conninv.html#sa-pid-attaching-connector"
                
                  target="_blank" \
moz-do-not-send="true">https://docs.oracle.com/javase/10/docs/specs/jpda/conninv.html#sa-pid-attaching-connector</a><br>
  still states that the debug server should be launched
                with sa-jdi.jar in classpath, though there's no such jar
                in the jdk any more.<br>
                java \<br>
                       -classpath ${JAVA_HOME}/lib/sa-jdi.jar \<br>
                       sun.jvm.hotspot.jdi.SADebugServer<br>
                How should it be launched on jdk 9, 10?<br>
                <br>
                Thanks,<br>
                Egor<o:p></o:p></p>
              <div>
                <div>
                  <p class="MsoNormal"><br>
                    <br>
                    On 21-Aug-18 11:55, Sharath Ballal wrote:<o:p></o:p></p>
                  <blockquote style="border:none;border-left:solid
                    #CCCCCC 1.0pt;padding:0in 0in 0in
                    6.0pt;margin-left:4.8pt;margin-right:0in">
                    <p class="MsoNormal">Hi David,<br>
                      <br>
                      I opened <a
                        href="https://bugs.openjdk.java.net/browse/JDK-8209781"
                        target="_blank" \
moz-do-not-send="true">https://bugs.openjdk.java.net/browse/JDK-8209781</a>  for \
it.<br>  <br>
                      Thanks,<br>
                      Sharath<br>
                      <br>
                      <br>
                      -----Original Message-----<br>
                      From: David Holmes<br>
                      Sent: Tuesday, August 21, 2018 7:47 AM<br>
                      To: Sharath Ballal; Egor Ushakov; <a
                        href="mailto:serviceability-dev@openjdk.java.net"
                        target="_blank" \
moz-do-not-send="true">serviceability-dev@openjdk.java.net</a>  <a
                        href="mailto:serviceability-dev@openjdk.java.net"
                        target="_blank" \
moz-do-not-send="true">serviceability-dev@openjdk.java.net</a><br>  Subject: Re: SA \
Debug attach to another jvm  version possible?<br>
                      <br>
                      Hi Sharath,<br>
                      <br>
                      On 21/08/2018 3:07 AM, Sharath Ballal wrote:<o:p></o:p></p>
                    <blockquote style="border:none;border-left:solid
                      #CCCCCC 1.0pt;padding:0in 0in 0in
                      6.0pt;margin-left:4.8pt;margin-right:0in">
                      <p class="MsoNormal">Hello Egor,<br>
                        <br>
                        By default, SA checks for the exact match of the
                        version between the<br>
                        debugger and the debuggee.   If you<o:p></o:p></p>
                    </blockquote>
                    <p class="MsoNormal">In that case we need to fix the
                      referenced documentation that states otherwise.<br>
                      <br>
                      Cheers,<br>
                      David<br>
                      <br>
                      want SA to ignore the version, you need to provide
                      the
                      "-Dsun.jvm.hotspot.runtime.VM.disableVersionCheck"
                      option to the java launcher from the command
                      line.   This is the case even if you are not using
                      the debug server.   However since 'jstack' and
                      similar tools don't take the "-D" option of java,
                      you can invoke it as follows:<o:p></o:p></p>
                    <blockquote style="border:none;border-left:solid
                      #CCCCCC 1.0pt;padding:0in 0in 0in
                      6.0pt;margin-left:4.8pt;margin-right:0in">
                      <p class="MsoNormal" style="margin-bottom:12.0pt">java  
                          -cp &lt;jdk&gt;/lib/sa-jdi.jar  
                          -Dsun.jvm.hotspot.runtime.VM.disableVersionCheck  
                          sun.jvm.hotspot.tools.JStack     localhost<br>
                        <br>
                        If you invoke the SA tools with this option, you
                        will get a warning that the version check has
                        been disabled.<br>
                        <br>
                        Example:<br>
                        $ &lt;jdk&gt;/bin/java -cp
                        &lt;jdk&gt;/lib/sa-jdi.jar<br>
                        -Dsun.jvm.hotspot.runtime.VM.disableVersionCheck
                        sun.jvm.hotspot.tools.JStack localhost Attaching
                        to remote server localhost, please wait...<br>
                        WARNING: You have disabled SA and VM version
                        check. You may be using incompatible version of
                        SA and you may see unexpected results.<br>
                        Debugger attached successfully.<br>
                        Server compiler detected.<br>
                        JVM version is 25.121-b13<br>
                        Deadlock Detection:<br>
                        <br>
                        No deadlocks found.<br>
                        <br>
                        Thread t@ 2804: (state = BLOCKED)<br>
                        <br>
                        <br>
                        Thread t@ 2803: (state = BLOCKED)<br>
                             - java.lang.Object.wait(long) @bci=0
                        (Interpreted frame)<br>
                             - java.lang.ref.ReferenceQueue.remove(long)
                        @bci=59, line=143 (Interpreted frame)<br>
                             - java.lang.ref.ReferenceQueue.remove()
                        @bci=2, line=164 (Interpreted frame)<br>
                             -
                        java.lang.ref.Finalizer$FinalizerThread.run()
                        @bci=36, line=209<br>
                        (Interpreted frame)<br>
                        <br>
                        <br>
                        Thread t@ 2802: (state = BLOCKED)<br>
                             - java.lang.Object.wait(long) @bci=0
                        (Interpreted frame)<br>
                             - java.lang.Object.wait() @bci=2, line=502
                        (Interpreted frame)<br>
                             -
                        java.lang.ref.Reference.tryHandlePending(boolean)
                        @bci=54, line=191 (Interpreted frame)<br>
                             -
                        java.lang.ref.Reference$ReferenceHandler.run()
                        @bci=1, line=153<br>
                        (Interpreted frame)<br>
                        <br>
                        <br>
                        Thread t@ 2798: (state = BLOCKED)<br>
                             - java.lang.Thread.sleep(long) @bci=0
                        (Interpreted frame)<br>
                             - HelloWorld.main(java.lang.String[])
                        @bci=72, line=15 (Interpreted<br>
                        frame)<br>
                        <br>
                        <br>
                        Hope this helps.<br>
                        <br>
                        Thanks,<br>
                        Sharath<br>
                        <br>
                        <br>
                        -----Original Message-----<br>
                        From: Egor Ushakov [mailto:<a
                          href="mailto:egor.ushakov@jetbrains.com"
                          target="_blank" \
moz-do-not-send="true">egor.ushakov@jetbrains.com</a>]<br>  Sent: Monday, August 20, \
2018 3:42 PM<br>  To: <a
                          href="mailto:serviceability-dev@openjdk.java.net"
                          target="_blank" \
moz-do-not-send="true">serviceability-dev@openjdk.java.net</a><br>  <a
                          href="mailto:serviceability-dev@openjdk.java.net"
                          target="_blank" \
moz-do-not-send="true">serviceability-dev@openjdk.java.net</a><br>  Subject: SA Debug \
attach to another jvm version  possible?<br>
                        <br>
                        Hi all,<br>
                        <br>
                        documentation for SA Debug Server Attaching
                        Connector here:<br>
                        <a
href="https://docs.oracle.com/javase/8/docs/technotes/guides/jpda/conninv.ht"
                          target="_blank" \
moz-do-not-send="true">https://docs.oracle.com/javase/8/docs/technotes/guides/jpda/conninv.ht</a><br>
  ml#Connectors states that the SADebugServer has
                        to run on the same vm<br>
                        version as the debugee process, but "the
                        debugger does not have to be the same bit size
                        and version."<br>
                        However any attempts to connect from another
                        version fail with
                        sun.jvm.hotspot.runtime.VMVersionMismatchException.<br>
                        <br>
                        Please help, what do I do wrong (locally for
                        simplicity):<br>
                        - start the debugee process with jdk1.8.0_162   -
                        get the PID<br>
                        - start "jdk1.8.0_162\bin&gt;jsadebugd.exe PID"
                        - all starts well<br>
                        - trying to attach jstack, jdb or whatever from
                        another version:<br>
                        jdk1.8.0_152\bin&gt;jstack localhost<br>
                        Attaching to remote server localhost, please
                        wait...<br>
                        Error attaching to remote server:<br>
sun.jvm.hotspot.runtime.VMVersionMismatchException: Supported versions<br>
                        are 25.152-b16. Target VM is 25.162-b12<br>
                        sun.jvm.hotspot.debugger.DebuggerException:<br>
sun.jvm.hotspot.runtime.VMVersionMismatchException: Supported versions<br>
                        are 25.152-b16. Target VM is 25.162-b12<br>
                        <br>
                        jdk1.8.0_152\bin&gt;jdb -connect<br>
"sun.jvm.hotspot.jdi.SADebugServerAttachingConnector:debugServerName=localhost"<br>
                        java.io.IOException<br>
                                            at<br>
sun.jvm.hotspot.jdi.SADebugServerAttachingConnector.attach(SADebugServerAttachingConnector.java:106)<br>
  at<br>
                        <a href="http://com.sun.tools.example.debug.tt"
                          \
moz-do-not-send="true">com.sun.tools.example.debug.tt</a>y.VMConnection.attachTarget(VMConnection.java:519)<br>
  at<br>
                        <a href="http://com.sun.tools.example.debug.tt"
                          \
moz-do-not-send="true">com.sun.tools.example.debug.tt</a>y.VMConnection.open(VMConnection.java:328)<br>
  at <a
                          href="http://com.sun.tools.example.debug.tt"
                          \
moz-do-not-send="true">com.sun.tools.example.debug.tt</a>y.Env.init(Env.java:63)<br>  \
at <a  href="http://com.sun.tools.example.debug.tt"
                          \
moz-do-not-send="true">com.sun.tools.example.debug.tt</a>y.TTY.main(TTY.java:1082)<br>
  Caused by:
                        java.lang.reflect.InvocationTargetException<br>
                                            at
                        sun.reflect.NativeMethodAccessorImpl.invoke0(Native
                        Method)<br>
                                            at<br>
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)<br>
                                            at<br>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)<br>
  at
                        java.lang.reflect.Method.invoke(Method.java:498)<br>
                                            at<br>
sun.jvm.hotspot.jdi.SADebugServerAttachingConnector.createVirtualMachine(SADebugServerAttachingConnector.java:72)<br>
  at<br>
sun.jvm.hotspot.jdi.SADebugServerAttachingConnector.attach(SADebugServerAttachingConnector.java:91)<br>
                
                                            ... 4 more<br>
                        Caused by:
                        sun.jvm.hotspot.debugger.DebuggerException:<br>
sun.jvm.hotspot.runtime.VMVersionMismatchException: Supported versions
                        are 25.152-b16. Target VM is 25.162-b12<br>
                                            at
                        \
sun.jvm.hotspot.HotSpotAgent.setupVM(HotSpotAgent.java:435)<br>  at
                        sun.jvm.hotspot.HotSpotAgent.go(HotSpotAgent.java:305)<br>
                                            at
                        \
sun.jvm.hotspot.HotSpotAgent.attach(HotSpotAgent.java:183)<br>  at<br>
sun.jvm.hotspot.jdi.VirtualMachineImpl.createVirtualMachineForServer(VirtualMachineImpl.java:241)<br>
                
                                            ... 10 more<br>
                        Caused by:
                        sun.jvm.hotspot.runtime.VMVersionMismatchException:
                        Supported versions are 25.152-b16. Target VM is
                        25.162-b12<br>
                                            at
                        sun.jvm.hotspot.runtime.VM.checkVMVersion(VM.java:227)<br>
                                            at
                        sun.jvm.hotspot.runtime.VM.&lt;init&gt;(VM.java:294)<br>
                                            at
                        sun.jvm.hotspot.runtime.VM.initialize(VM.java:370)<br>
                                            at
                        \
                sun.jvm.hotspot.HotSpotAgent.setupVM(HotSpotAgent.java:431)<br>
                                            ... 13 more<br>
                        <br>
                        Thanks!<br>
                        <br>
                        --<br>
                        Egor Ushakov<br>
                        Software Developer<br>
                        JetBrains<br>
                        <a href="http://www.jetbrains.com"
                          target="_blank" \
moz-do-not-send="true">http://www.jetbrains.com</a><br>  The Drive to \
Develop<o:p></o:p></p>  </blockquote>
                  </blockquote>
                  <p class="MsoNormal" style="margin-bottom:12.0pt"><br>
                    -- <br>
                    Egor Ushakov<br>
                    Software Developer<br>
                    JetBrains<br>
                    <a href="http://www.jetbrains.com" target="_blank"
                      moz-do-not-send="true">http://www.jetbrains.com</a><br>
                    The Drive to Develop<o:p></o:p></p>
                </div>
              </div>
            </blockquote>
          </div>
          <p class="MsoNormal"><o:p>  </o:p></p>
        </div>
      </div>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Egor Ushakov
Software Developer
JetBrains
<a class="moz-txt-link-freetext" \
href="http://www.jetbrains.com">http://www.jetbrains.com</a> The Drive to \
Develop</pre>  </body>
</html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic