RFR: 8263670: pmap and pstack in jhsdb do not work on debug server
Chris Plummer
cjplummer at openjdk.java.net
Wed Mar 17 05:06:08 UTC 2021
On Tue, 16 Mar 2021 12:01:30 GMT, Yasumasa Suenaga <ysuenaga at openjdk.org> wrote:
> jhsdb supports pmap (jhsdb jmap) and pstack (jhsdb jstack --mixed), and they work fine if they attach to live process or to coredump, however they do not work on debug server as following:
>
> $ jhsdb jmap --connect localhost
> Attaching to remote server localhost, please wait...
> Debugger attached successfully.
> Server compiler detected.
> JVM version is 11.0.10+9
> remote configuration is not yet implemented
>
> pmap and pstack depend on CDebugger in SA, however it would not be set in case of remote debugger client. We can avoid it if we can delegate the process to debug server.
test/hotspot/jtreg/serviceability/sa/sadebugd/PmapOnDebugdTest.java line 56:
> 54: // are not required.
> 55: throw new SkippedException("Cannot run this test on OSX if adding privileges is required.");
> 56: }
pmap and pstack are not even supported on OSX with a live process. The automated github testing did not catch this because it passed due to the above check:
TEST RESULT: Passed. Skipped: jtreg.SkippedException: Cannot run this test on OSX if adding privileges is required.
If it passed the check, it would have failed below to find a .dylib. You could change the code below to something like what is in ClhsdbPmap.java:
if (!withCore && Platform.isOSX()) {
expStrMap.put("pmap", List.of("Not available for Mac OS X processes"));
} else {
expStrMap.put("pmap", List.of("jvm", "java", "jli", "jimage"));
}
-------------
PR: https://git.openjdk.java.net/jdk/pull/3027
More information about the serviceability-dev
mailing list