While reviewing JDK-8146409 we found a potential race in printing task time stamps with an assert.
GCTaskManager::print_task_time_stamps() contains the code
if (!log_is_enabled(Debug, gc, task, time)) {
return;
}
for (all threads t) {
t->print_task_time_stamps();
}
And GCTaskThread::print_task_time_stamps() starts with
assert(log_is_enabled(Debug, gc, task, time), "sanity");
This latter assert might actually trigger since logging can be reconfigured any time, i.e. if the logging is reconfigured between the early exit in GCTaskManager::print_task_time_stamps() and the assert.
This potential issue has been found purely by code review. Is only possible when asserts are enabled too. Needs to be verified somehow.
The suggested fix is to simply remove the assert in GCTaskThread::print_task_time_stamps().
GCTaskManager::print_task_time_stamps() contains the code
if (!log_is_enabled(Debug, gc, task, time)) {
return;
}
for (all threads t) {
t->print_task_time_stamps();
}
And GCTaskThread::print_task_time_stamps() starts with
assert(log_is_enabled(Debug, gc, task, time), "sanity");
This latter assert might actually trigger since logging can be reconfigured any time, i.e. if the logging is reconfigured between the early exit in GCTaskManager::print_task_time_stamps() and the assert.
This potential issue has been found purely by code review. Is only possible when asserts are enabled too. Needs to be verified somehow.
The suggested fix is to simply remove the assert in GCTaskThread::print_task_time_stamps().
- duplicates
-
JDK-8024399 PrintGCTaskTimeStamps: amount of tasks reported for GC-thread sometimes differs from expected value
-
- Closed
-