-
Bug
-
Resolution: Fixed
-
P3
-
13
-
b24
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8231569 | 11.0.6 | Christoph Langer | P3 | Resolved | Fixed |
JfrFlush.cpp | .hpp
JfrConditionalFlush(Thread* t) {
if (jfr_is_event_enabled(Event::eventId)) { <<--------------- evaluates to true
jfr_conditional_flush(Event::eventId, sizeof(Event), t);
}
}
void jfr_conditional_flush(JfrEventId id, size_t size, Thread* t) {
assert(jfr_is_event_enabled(id), "invariant"); <<-------------------- could evaluate to false
if (t->jfr_thread_local()->has_native_buffer()) {
JfrStorage::Buffer* const buffer = t->jfr_thread_local()->native_buffer();
if (LessThanSize<JfrStorage::Buffer>::evaluate(buffer, size)) {
JfrFlush f(buffer, 0, 0, t);
}
}
}
Event settings are updated asynchronously, where event disablement happens after the recording has stopped.
A thread could have evaluated the initial check to true to enter jfr_conditional_flush(). Depending on visibility, context switching and preemption, another thread could have disabled the event before the thread runs jfr_conditional_flush().
There is no validity to be asserted at this location, so the assertion needs to be removed.
JfrConditionalFlush(Thread* t) {
if (jfr_is_event_enabled(Event::eventId)) { <<--------------- evaluates to true
jfr_conditional_flush(Event::eventId, sizeof(Event), t);
}
}
void jfr_conditional_flush(JfrEventId id, size_t size, Thread* t) {
assert(jfr_is_event_enabled(id), "invariant"); <<-------------------- could evaluate to false
if (t->jfr_thread_local()->has_native_buffer()) {
JfrStorage::Buffer* const buffer = t->jfr_thread_local()->native_buffer();
if (LessThanSize<JfrStorage::Buffer>::evaluate(buffer, size)) {
JfrFlush f(buffer, 0, 0, t);
}
}
}
Event settings are updated asynchronously, where event disablement happens after the recording has stopped.
A thread could have evaluated the initial check to true to enter jfr_conditional_flush(). Depending on visibility, context switching and preemption, another thread could have disabled the event before the thread runs jfr_conditional_flush().
There is no validity to be asserted at this location, so the assertion needs to be removed.
- backported by
-
JDK-8231569 Remove invalid assertion in jfr_conditional_flush()
- Resolved