RFR: 8321698: JFR asserts in write_classloader: failed invariant

Markus Grönlund mgronlun at openjdk.org
Thu Dec 21 17:52:57 UTC 2023


Greetings,

I have reviewed the JFR tagging mechanism, which lacks proper transitivity in certain situations. For example, when tagging a PackageEntry or a ModuleEntry, no tag information is set for the ModuleEntry's CLD and its class_loader_klass. The assert then fires when writing the CLD of a ModuleEntry, should its CLD not have been tagged by some other means (some other direct usage).

The tagging must, in general, become deeper than what is done today, i.e. it must cover the transitive closure of a Klass, which involves two branches:

1) Klass -> CLD -> class_loader_klass
2) Klass -> PkgEntry -> ModuleEntry -> CLD -> class_loader_klass

A Klass under its closure can be treated as a node in a binary tree. Its closure (subtree) is covered by writing and tagging of artifacts using preorder traversal by recursing its CLD klasses.

Testing: jdk_jfr, stress testing

Thanks
Markus

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

Commit messages:
 - 8321698

Changes: https://git.openjdk.org/jdk/pull/17177/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17177&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8321698
  Stats: 928 lines in 4 files changed: 395 ins; 315 del; 218 mod
  Patch: https://git.openjdk.org/jdk/pull/17177.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/17177/head:pull/17177

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


More information about the hotspot-jfr-dev mailing list