JDK-8200162 : Use coredump_filter to dump the MAP_SHARED regions of a CDS archive into a corefile
  • Type: Bug
  • Component: hotspot
  • Sub-Component: svc-agent
  • Affected Version: 9,10,11
  • Priority: P3
  • Status: Resolved
  • Resolution: Duplicate
  • OS: linux
  • CPU: generic
  • Submitted: 2018-03-23
  • Updated: 2023-08-02
  • Resolved: 2019-07-10
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
When a corefile gets created, the CDS archive regions mapped as MAP_SHARED do not get dumped into the corefile. To overcome this limitation, these regions get read in the Serviceability Agent (SA) directly from the classes.jsa in ps_core.c. For reading the regions in, the FileMapHeader structure (from src/hotspot/share/memory/filemap.hpp) is replicated in SA in ps_core.c. This replication is error prone and the copy in SA gets out of sync quickly w.r.t. the version in hotspot. This should be avoidable on Linux by setting the coredump_filter to dump the MAP_SHARED regions. (Need to explore the corresponding mechanism for other platforms). If there is no such mechanism for other platforms, then a lesser solution of including filemap.hpp in SA could be explored.
Comments
JDK-8200613
10-07-2019

We would need to make changes in SA to read in the file backed private regions of the core file only if these regions are not dumped in to the core file (Due to bit 2 of the coredump_filter being deliberately turned off) or due to the new option of disabling large core file creation being turned off.
12-11-2018

With the changes in JDK-8200613, all the CDS regions should get dumped into the corefile for Linux. For MacOS and Solaris, all the CDS regions are anyways getting dumped into the core file. We should be able to close this once JDK-8200613 is resolved.
12-11-2018