Skip to content

Commit

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

Reviewed-by: dcubed, sspitsyn
  • Loading branch information
robehn committed Mar 17, 2021
1 parent d2144a5 commit 7b9d256
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 @@ -258,19 +258,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 7b9d256

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