RFR: 8347734: Turning off PerfData logging doesn't work
Casper Norrbin
cnorrbin at openjdk.org
Thu Mar 13 15:13:04 UTC 2025
Hi everyone,
When PerfData is disabled, the corresponding perfdata variables remain uninitialized. However, under certain conditions, logging may attempt to access these variables, leading to a crash. The existing code turns off the relevant tags using `LogConfiguration::configure_stdout`, but this doesn't modify other outputs. For example, the test `runtime/logging/RedefineClasses.java` crashes with `-XX:-UsePerfData` because it uses an output that isn't stdout.
To fix this, I've added a new method `LogConfiguration::disable_tags`. Unlike `configure_stdout`, this function iterates over all outputs and disables the specified tags on each. This way, we correctly disable tags across all outputs and longer try and access the uninitialized perfdata variables.
-------------
Commit messages:
- disable_tags function and test
Changes: https://git.openjdk.org/jdk/pull/24036/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24036&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8347734
Stats: 64 lines in 4 files changed: 57 ins; 3 del; 4 mod
Patch: https://git.openjdk.org/jdk/pull/24036.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/24036/head:pull/24036
PR: https://git.openjdk.org/jdk/pull/24036
More information about the hotspot-runtime-dev
mailing list