Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.
/ jdk17 Public archive

Commit

Permalink
8258746: illegal access to global field _jvmci_old_thread_counters by…
Browse files Browse the repository at this point in the history
… terminated thread causes crash

Reviewed-by: dholmes, kvn
  • Loading branch information
dean-long committed Jun 26, 2021
1 parent 6eb734a commit d9cb068
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/hotspot/share/runtime/thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);

Expand Down

1 comment on commit d9cb068

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.