Skip to content
Permalink
Browse files
8261262: Kitchensink24HStress.java crashed with EXCEPTION_ACCESS_VIOL…
…ATION

Backport-of: 7b9d2562abf3462da0af908b66fab98371f5946f
  • Loading branch information
Harold Seigel committed Mar 30, 2021
1 parent 484087b commit 566703ac423e53408f8a9f3957adb382062acaf7
Showing with 7 additions and 10 deletions.
  1. +7 −10 src/hotspot/share/prims/jvmtiEnvThreadState.cpp
@@ -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;
}

1 comment on commit 566703a

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on 566703a Mar 30, 2021

Please sign in to comment.