RFR: 8321698: JFR asserts in write_classloader: failed invariant [v3]

Markus Grönlund mgronlun at openjdk.org
Fri Dec 22 15:00:52 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 -> PackageEntry -> 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

Markus Grönlund has updated the pull request incrementally with one additional commit since the last revision:

  enqueue klass loader klass for reachability at rotation

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/17177/files
  - new: https://git.openjdk.org/jdk/pull/17177/files/a860bac4..b490b04d

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=17177&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=17177&range=01-02

  Stats: 36 lines in 1 file changed: 6 ins; 17 del; 13 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