Skip to content
Permalink
Browse files
8266593: vmTestbase/nsk/jvmti/PopFrame/popframe011 fails with "assert…
…(java_thread == _state->get_thread()) failed: Must be"

Reviewed-by: mdoerr, lmesnik, dcubed
  • Loading branch information
Serguei Spitsyn committed Nov 22, 2021
1 parent 8051041 commit 32839ba012f0a0a66e249cd8d12b94499d82ec0a
Showing with 16 additions and 12 deletions.
  1. +16 −11 src/hotspot/share/prims/jvmtiEnvBase.cpp
  2. +0 −1 test/hotspot/jtreg/ProblemList.txt
@@ -1393,6 +1393,9 @@ SetForceEarlyReturn::doit(Thread *target, bool self) {
Thread* current_thread = Thread::current();
HandleMark hm(current_thread);

if (java_thread->is_exiting()) {
return; /* JVMTI_ERROR_THREAD_NOT_ALIVE (default) */
}
if (!self) {
if (!java_thread->is_suspended()) {
_result = JVMTI_ERROR_THREAD_NOT_SUSPENDED;
@@ -1523,6 +1526,10 @@ UpdateForPopTopFrameClosure::doit(Thread *target, bool self) {
Thread* current_thread = Thread::current();
HandleMark hm(current_thread);
JavaThread* java_thread = JavaThread::cast(target);

if (java_thread->is_exiting()) {
return; /* JVMTI_ERROR_THREAD_NOT_ALIVE (default) */
}
assert(java_thread == _state->get_thread(), "Must be");

if (!self && !java_thread->is_suspended()) {
@@ -1599,21 +1606,22 @@ UpdateForPopTopFrameClosure::doit(Thread *target, bool self) {
// It's fine to update the thread state here because no JVMTI events
// shall be posted for this PopFrame.

if (!java_thread->is_exiting() && java_thread->threadObj() != NULL) {
_state->update_for_pop_top_frame();
java_thread->set_popframe_condition(JavaThread::popframe_pending_bit);
// Set pending step flag for this popframe and it is cleared when next
// step event is posted.
_state->set_pending_step_for_popframe();
_result = JVMTI_ERROR_NONE;
}
_state->update_for_pop_top_frame();
java_thread->set_popframe_condition(JavaThread::popframe_pending_bit);
// Set pending step flag for this popframe and it is cleared when next
// step event is posted.
_state->set_pending_step_for_popframe();
_result = JVMTI_ERROR_NONE;
}

void
SetFramePopClosure::doit(Thread *target, bool self) {
ResourceMark rm;
JavaThread* java_thread = JavaThread::cast(target);

if (java_thread->is_exiting()) {
return; /* JVMTI_ERROR_THREAD_NOT_ALIVE (default) */
}
assert(_state->get_thread() == java_thread, "Must be");

if (!self && !java_thread->is_suspended()) {
@@ -1633,9 +1641,6 @@ SetFramePopClosure::doit(Thread *target, bool self) {
}

assert(vf->frame_pointer() != NULL, "frame pointer mustn't be NULL");
if (java_thread->is_exiting() || java_thread->threadObj() == NULL) {
return; /* JVMTI_ERROR_THREAD_NOT_ALIVE (default) */
}
int frame_number = _state->count_frames() - _depth;
_state->env_thread_state((JvmtiEnvBase*)_env)->set_frame_pop(frame_number);
_result = JVMTI_ERROR_NONE;
@@ -161,7 +161,6 @@ vmTestbase/nsk/jvmti/scenarios/jni_interception/JI05/ji05t001/TestDescription.ja
vmTestbase/nsk/jvmti/scenarios/jni_interception/JI06/ji06t001/TestDescription.java 8219652 aix-ppc64
vmTestbase/nsk/jvmti/SetJNIFunctionTable/setjniftab001/TestDescription.java 8219652 aix-ppc64
vmTestbase/nsk/jvmti/SuspendThread/suspendthrd003/TestDescription.java 8264605 generic-all
vmTestbase/nsk/jvmti/PopFrame/popframe011/TestDescription.java 8266593 generic-all

vmTestbase/gc/lock/jni/jnilock002/TestDescription.java 8192647 generic-all

1 comment on commit 32839ba

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 32839ba Nov 22, 2021

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.