RFR: 8316229: Enhance class initialization logging

David Holmes dholmes at openjdk.org
Tue Sep 19 06:40:10 UTC 2023


This change adds some additional debug logging to the class linking and initialization process. It was useful in diagnosing the deadlock described by:

https://bugs.openjdk.org/browse/JDK-8316469

See the example output in JBS issue.

The changes are mostly uncontroversial but I needed to expose a way to access the init thread's name, which can't use the regular `name()` method as the safety check doesn't recognise the calling context as being safe.

Testing:
 - manual examination of logging output
 - ran the only test that enables class+init logging: runtime/logging/ClassInitializationTest.java (no change as expected)
 - tiers1-3 sanity

Thanks.

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

Commit messages:
 - Cache the log enabled state in a local.
 - 8316229: Enhance class initialization logging

Changes: https://git.openjdk.org/jdk/pull/15809/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15809&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8316229
  Stats: 73 lines in 4 files changed: 69 ins; 1 del; 3 mod
  Patch: https://git.openjdk.org/jdk/pull/15809.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/15809/head:pull/15809

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


More information about the hotspot-dev mailing list