JDK-8248882 : SA PMap and PStack support on OSX works with core files. Enable them.
  • Type: Bug
  • Component: hotspot
  • Sub-Component: svc-agent
  • Affected Version: 16
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-07-06
  • Updated: 2020-08-03
  • Resolved: 2020-07-28
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 16
16 b08Fixed
Related Reports
Blocks :  
Relates :  
Relates :  
Description
It was thought that PMap did not work at all on OSX, so it was disable on in PMap.java:

      if (PlatformInfo.getOS().equals("darwin")) {
        out.println("Not available on Mac OS X");
        return;
      }

However, it does work with core files. The reason is the OSX port does register LoadObjects for core files, but not for processes. JDK-8248875 discusses this a bit. The above code should be modified to allow running on OSX if debugging a core file. Note ClhsdbPmap.java expects it to fail on OSX since it runs on a process. Possibly as part of this fix ClhsdbPmap.java can be updated to also run on a core file and expect it to pass on OSX.

PStack does the exact same check. It too should be enabled for OSX core files. 

The code for this is in ps_core.c::read_shared_lib_info(). It's very hard to read unless you have a good understanding of mach core file layouts.

Enabling PMap and PStack for OSX core files requires that first JDK-8247515 be pushed since it fixes some pc -> symbol lookup issues that PStack needs, and hides the system library lookup issues discussed in JDK-8249779. Note also that due to JDK-8249779 PMap will not show any system libraries and PStack will not do pc -> symbol resolution for pc's in system libraries.
Comments
URL: https://hg.openjdk.java.net/jdk/jdk/rev/18b22c189e69 User: cjplummer Date: 2020-07-28 19:06:58 +0000
28-07-2020