Skip to content

Commit bad5edf

Browse files
sunny868Markus Grönlund
and
Markus Grönlund
committedDec 8, 2023
8320959: jdk/jfr/event/runtime/TestShutdownEvent.java crash with CONF=fastdebug -Xcomp
Co-authored-by: Markus Grönlund <mgronlun@openjdk.org> Reviewed-by: mgronlun
1 parent f577385 commit bad5edf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎src/hotspot/share/jfr/support/jfrNativeLibraryLoadEvent.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,15 @@ static void commit(HelperType& helper) {
105105
assert(thread != nullptr, "invariant");
106106
if (thread->is_Java_thread()) {
107107
JavaThread* jt = JavaThread::cast(thread);
108-
if (jt->thread_state() != _thread_in_vm) {
109-
assert(jt->thread_state() == _thread_in_native, "invariant");
108+
if (jt->thread_state() == _thread_in_native) {
110109
// For a JavaThread to take a JFR stacktrace, it must be in _thread_in_vm. Can safepoint here.
111110
ThreadInVMfromNative transition(jt);
112111
event.commit();
113112
return;
114113
}
114+
// If a thread comes here still _thread_in_Java, which can happen for example
115+
// when loading the disassembler library in response to traps in JIT code - all is ok.
116+
// Since there is no ljf, an event will be committed without a stacktrace.
115117
}
116118
event.commit();
117119
}

0 commit comments

Comments
 (0)
Please sign in to comment.