Skip to content
Permalink
Browse files
8258746: illegal access to global field _jvmci_old_thread_counters by…
… terminated thread causes crash

Reviewed-by: dholmes, kvn
  • Loading branch information
dean-long committed Jun 26, 2021
1 parent 6eb734a commit d9cb068f4ba85e2be2ebc14e89e739b0a2d90409
Showing 1 changed file with 11 additions and 5 deletions.
@@ -1239,11 +1239,6 @@ JavaThread::~JavaThread() {

#if INCLUDE_JVMCI
if (JVMCICounterSize > 0) {
if (jvmci_counters_include(this)) {
for (int i = 0; i < JVMCICounterSize; i++) {
_jvmci_old_thread_counters[i] += _jvmci_counters[i];
}
}
FREE_C_HEAP_ARRAY(jlong, _jvmci_counters);
}
#endif // INCLUDE_JVMCI
@@ -1499,6 +1494,17 @@ void JavaThread::exit(bool destroy_vm, ExitType exit_type) {
_timer_exit_phase3.stop();
_timer_exit_phase4.start();
}

#if INCLUDE_JVMCI
if (JVMCICounterSize > 0) {
if (jvmci_counters_include(this)) {
for (int i = 0; i < JVMCICounterSize; i++) {
_jvmci_old_thread_counters[i] += _jvmci_counters[i];
}
}
}
#endif // INCLUDE_JVMCI

// Remove from list of active threads list, and notify VM thread if we are the last non-daemon thread
Threads::remove(this, daemon);

0 comments on commit d9cb068

Please sign in to comment.