RFR: 8326715: ZGC: RunThese24H fails with ExitCode 139 during shutdown

Markus Grönlund mgronlun at openjdk.org
Sat Jun 1 17:45:16 UTC 2024


Objects with static storage duration will implicitly add their destructors to the std::atexit callbacks list. During process shutdown, the C routine __ run_exit_handlers() invokes the destructors on the std::atexit callback list.

The RefCountHandle has static storage and a destructor that decrements a reference counted pointer and, if necessary, deletes the pointee's contents. In this case, this pointee includes yet another embedded RefCountHandle.

When the destructor is invoked, it causes a cascade of handles to be destroyed, so many that it causes a stack overflow. The list contains about 87000 entries. These reference-counted pointees are blobs saving metadata-related information about class unloading.

The DeprecationManager subsystem lacks a filtering mechanism, similar to the ObjectSampler subsystem, to decide what to save concerning class unloading blobs.

One solution is to consolidate the preservation of type set blobs for both the DeprecatedManager and the ObjectSampler subsystems. Additionally, filtering will prevent the storage of redundant data. This, coupled with more frequent scavenging of the list, will effectively avert a stack overflow.

Testing: jdk_jfr, stress testing

Thanks
Markus

-------------

Commit messages:
 - whitespace
 - cleanup
 - 8326715

Changes: https://git.openjdk.org/jdk/pull/19510/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=19510&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8326715
  Stats: 410 lines in 11 files changed: 251 ins; 100 del; 59 mod
  Patch: https://git.openjdk.org/jdk/pull/19510.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/19510/head:pull/19510

PR: https://git.openjdk.org/jdk/pull/19510


More information about the hotspot-jfr-dev mailing list