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

Commit

Permalink
8261262: Kitchensink24HStress.java crashed with EXCEPTION_ACCESS_VIOL…
Browse files Browse the repository at this point in the history
…ATION

Backport-of: 7b9d2562abf3462da0af908b66fab98371f5946f
  • Loading branch information
Harold Seigel committed Mar 30, 2021
1 parent 484087b commit 566703a
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/hotspot/share/prims/jvmtiEnvThreadState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,19 +259,16 @@ class GetCurrentLocationClosure : public HandshakeClosure {
JavaThread *jt = target->as_Java_thread();
ResourceMark rmark; // jt != Thread::current()
RegisterMap rm(jt, false);
// There can be a race condition between a VM_Operation reaching a safepoint
// There can be a race condition between a handshake
// and the target thread exiting from Java execution.
// We must recheck the last Java frame still exists.
// We must recheck that the last Java frame still exists.
if (!jt->is_exiting() && jt->has_last_Java_frame()) {
javaVFrame* vf = jt->last_java_vframe(&rm);
assert(vf != NULL, "must have last java frame");
Method* method = vf->method();
_method_id = method->jmethod_id();
_bci = vf->bci();
} else {
// Clear current location as the target thread has no Java frames anymore.
_method_id = (jmethodID)NULL;
_bci = 0;
if (vf != NULL) {
Method* method = vf->method();
_method_id = method->jmethod_id();
_bci = vf->bci();
}
}
_completed = true;
}
Expand Down

1 comment on commit 566703a

@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.