RFR: 8358645: Access violation in ThreadsSMRSupport::print_info_on during thread dump
David Holmes
dholmes at openjdk.org
Tue Jun 24 23:46:37 UTC 2025
We started observing these occasional crashes involving the JfrSamplerThread (which is a NonJavaThread) during JFR's termination thread dump. Examination of the `print_info_on` code showed that it was making an invalid assumption that it is safe to walk the thread's thread-list at a safepoint, as that is not true when you are dealing with a NonJavaThread, as it is not held at the safepoint and so the list you are walking can disappear whilst you examine it. I added some test code to make this more likely and was able to trigger similar crashes - see JBS for details.
The simple fix is to only walk JavaThreads.
Testing
- tier 5 JFR tests
- selected tests with JFR explicitly enabled
- tier 1-3 (sanity)
Thanks
-------------
Commit messages:
- 8358645: Access violation in ThreadsSMRSupport::print_info_on during thread dump
Changes: https://git.openjdk.org/jdk/pull/25963/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25963&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8358645
Stats: 4 lines in 1 file changed: 1 ins; 0 del; 3 mod
Patch: https://git.openjdk.org/jdk/pull/25963.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/25963/head:pull/25963
PR: https://git.openjdk.org/jdk/pull/25963
More information about the hotspot-runtime-dev
mailing list