Skip to content

Commit 32839ba

Browse files
author
Serguei Spitsyn
committedNov 22, 2021
8266593: vmTestbase/nsk/jvmti/PopFrame/popframe011 fails with "assert(java_thread == _state->get_thread()) failed: Must be"
Reviewed-by: mdoerr, lmesnik, dcubed
1 parent 8051041 commit 32839ba

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed
 

‎src/hotspot/share/prims/jvmtiEnvBase.cpp

+16-11
Original file line numberDiff line numberDiff line change
@@ -1393,6 +1393,9 @@ SetForceEarlyReturn::doit(Thread *target, bool self) {
13931393
Thread* current_thread = Thread::current();
13941394
HandleMark hm(current_thread);
13951395

1396+
if (java_thread->is_exiting()) {
1397+
return; /* JVMTI_ERROR_THREAD_NOT_ALIVE (default) */
1398+
}
13961399
if (!self) {
13971400
if (!java_thread->is_suspended()) {
13981401
_result = JVMTI_ERROR_THREAD_NOT_SUSPENDED;
@@ -1523,6 +1526,10 @@ UpdateForPopTopFrameClosure::doit(Thread *target, bool self) {
15231526
Thread* current_thread = Thread::current();
15241527
HandleMark hm(current_thread);
15251528
JavaThread* java_thread = JavaThread::cast(target);
1529+
1530+
if (java_thread->is_exiting()) {
1531+
return; /* JVMTI_ERROR_THREAD_NOT_ALIVE (default) */
1532+
}
15261533
assert(java_thread == _state->get_thread(), "Must be");
15271534

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

1602-
if (!java_thread->is_exiting() && java_thread->threadObj() != NULL) {
1603-
_state->update_for_pop_top_frame();
1604-
java_thread->set_popframe_condition(JavaThread::popframe_pending_bit);
1605-
// Set pending step flag for this popframe and it is cleared when next
1606-
// step event is posted.
1607-
_state->set_pending_step_for_popframe();
1608-
_result = JVMTI_ERROR_NONE;
1609-
}
1609+
_state->update_for_pop_top_frame();
1610+
java_thread->set_popframe_condition(JavaThread::popframe_pending_bit);
1611+
// Set pending step flag for this popframe and it is cleared when next
1612+
// step event is posted.
1613+
_state->set_pending_step_for_popframe();
1614+
_result = JVMTI_ERROR_NONE;
16101615
}
16111616

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

1622+
if (java_thread->is_exiting()) {
1623+
return; /* JVMTI_ERROR_THREAD_NOT_ALIVE (default) */
1624+
}
16171625
assert(_state->get_thread() == java_thread, "Must be");
16181626

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

16351643
assert(vf->frame_pointer() != NULL, "frame pointer mustn't be NULL");
1636-
if (java_thread->is_exiting() || java_thread->threadObj() == NULL) {
1637-
return; /* JVMTI_ERROR_THREAD_NOT_ALIVE (default) */
1638-
}
16391644
int frame_number = _state->count_frames() - _depth;
16401645
_state->env_thread_state((JvmtiEnvBase*)_env)->set_frame_pop(frame_number);
16411646
_result = JVMTI_ERROR_NONE;

‎test/hotspot/jtreg/ProblemList.txt

-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ vmTestbase/nsk/jvmti/scenarios/jni_interception/JI05/ji05t001/TestDescription.ja
161161
vmTestbase/nsk/jvmti/scenarios/jni_interception/JI06/ji06t001/TestDescription.java 8219652 aix-ppc64
162162
vmTestbase/nsk/jvmti/SetJNIFunctionTable/setjniftab001/TestDescription.java 8219652 aix-ppc64
163163
vmTestbase/nsk/jvmti/SuspendThread/suspendthrd003/TestDescription.java 8264605 generic-all
164-
vmTestbase/nsk/jvmti/PopFrame/popframe011/TestDescription.java 8266593 generic-all
165164

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

0 commit comments

Comments
 (0)