RFR: 8346193: CrashGCForDumpingJavaThread do not trigger expected crash build with clang17 [v2]
Kim Barrett
kbarrett at openjdk.org
Tue Dec 31 10:41:23 UTC 2024
On Tue, 31 Dec 2024 06:20:49 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
>> SendaoYan has updated the pull request incrementally with one additional commit since the last revision:
>>
>> update comment "Use volatile to prevent compiler from optimising away the store"
>
> src/hotspot/share/runtime/frame.cpp line 1166:
>
>> 1164: // simulate GC crash here to dump java thread in error report
>> 1165: if (CrashGCForDumpingJavaThread) {
>> 1166: volatile char *t = nullptr; // Use volatile to prevent compiler from optimising away the store
>
> No, don't do this. We don't need more ways to force a crash. Use
> VMError::controlled_crash instead. Note that this will require upgrading that
> function to !PRODUCT rather than DEBUG_ONLY. (Don't forget "optimized"
> builds.)
>
> OTOH, based on the comment's description of what this is needed for, why not
> just `guarantee(!CrashGCForDumpingJavaThread, "")` ?
Or do we really need to support this in "optimized" builds? I'm not sure who uses this.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22757#discussion_r1900044614
More information about the hotspot-dev
mailing list