File tree 1 file changed +4
-2
lines changed
src/hotspot/share/jfr/support
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -105,13 +105,15 @@ static void commit(HelperType& helper) {
105
105
assert (thread != nullptr , " invariant" );
106
106
if (thread->is_Java_thread ()) {
107
107
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) {
110
109
// For a JavaThread to take a JFR stacktrace, it must be in _thread_in_vm. Can safepoint here.
111
110
ThreadInVMfromNative transition (jt);
112
111
event.commit ();
113
112
return ;
114
113
}
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.
115
117
}
116
118
event.commit ();
117
119
}
You can’t perform that action at this time.
0 commit comments