Skip to content

Commit

Permalink
use guarantee(!CrashGCForDumpingJavaThread, "") to generate jvm crash
Browse files Browse the repository at this point in the history
  • Loading branch information
sendaoYan committed Dec 31, 2024
1 parent 1f5c195 commit 1251520
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/hotspot/share/runtime/frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1163,8 +1163,7 @@ void frame::oops_do_internal(OopClosure* f, NMethodClosure* cf,
#ifndef PRODUCT
// simulate GC crash here to dump java thread in error report
if (CrashGCForDumpingJavaThread) {
volatile char *t = nullptr; // Use volatile to prevent compiler from optimising away the store
*t = 'c';
guarantee(!CrashGCForDumpingJavaThread, "");
}
#endif
if (is_interpreted_frame()) {
Expand Down

0 comments on commit 1251520

Please sign in to comment.