Skip to content

Commit e71a980

Browse files
committed
8266593: vmTestbase/nsk/jvmti/PopFrame/popframe011 fails with "assert(java_thread == _state->get_thread()) failed: Must be"
Backport-of: 32839ba012f0a0a66e249cd8d12b94499d82ec0a
1 parent 66baa03 commit e71a980

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

src/hotspot/share/prims/jvmtiEnvBase.cpp

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1397,6 +1397,9 @@ SetForceEarlyReturn::doit(Thread *target, bool self) {
13971397
Thread* current_thread = Thread::current();
13981398
HandleMark hm(current_thread);
13991399

1400+
if (java_thread->is_exiting()) {
1401+
return; /* JVMTI_ERROR_THREAD_NOT_ALIVE (default) */
1402+
}
14001403
if (!self) {
14011404
if (!java_thread->is_suspended()) {
14021405
_result = JVMTI_ERROR_THREAD_NOT_SUSPENDED;
@@ -1527,6 +1530,10 @@ UpdateForPopTopFrameClosure::doit(Thread *target, bool self) {
15271530
Thread* current_thread = Thread::current();
15281531
HandleMark hm(current_thread);
15291532
JavaThread* java_thread = target->as_Java_thread();
1533+
1534+
if (java_thread->is_exiting()) {
1535+
return; /* JVMTI_ERROR_THREAD_NOT_ALIVE (default) */
1536+
}
15301537
assert(java_thread == _state->get_thread(), "Must be");
15311538

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

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

16161621
void
16171622
SetFramePopClosure::doit(Thread *target, bool self) {
16181623
ResourceMark rm;
16191624
JavaThread* java_thread = target->as_Java_thread();
16201625

1626+
if (java_thread->is_exiting()) {
1627+
return; /* JVMTI_ERROR_THREAD_NOT_ALIVE (default) */
1628+
}
16211629
assert(_state->get_thread() == java_thread, "Must be");
16221630

16231631
if (!self && !java_thread->is_suspended()) {
@@ -1637,9 +1645,6 @@ SetFramePopClosure::doit(Thread *target, bool self) {
16371645
}
16381646

16391647
assert(vf->frame_pointer() != NULL, "frame pointer mustn't be NULL");
1640-
if (java_thread->is_exiting() || java_thread->threadObj() == NULL) {
1641-
return; /* JVMTI_ERROR_THREAD_NOT_ALIVE (default) */
1642-
}
16431648
int frame_number = _state->count_frames() - _depth;
16441649
_state->env_thread_state((JvmtiEnvBase*)_env)->set_frame_pop(frame_number);
16451650
_result = JVMTI_ERROR_NONE;

test/hotspot/jtreg/ProblemList.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ vmTestbase/nsk/jvmti/AttachOnDemand/attach045/TestDescription.java 8202971 gener
152152
vmTestbase/nsk/jvmti/scenarios/jni_interception/JI05/ji05t001/TestDescription.java 8219652 aix-ppc64
153153
vmTestbase/nsk/jvmti/scenarios/jni_interception/JI06/ji06t001/TestDescription.java 8219652 aix-ppc64
154154
vmTestbase/nsk/jvmti/SetJNIFunctionTable/setjniftab001/TestDescription.java 8219652 aix-ppc64
155-
vmTestbase/nsk/jvmti/PopFrame/popframe011/TestDescription.java 8266593 generic-all
156155

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

0 commit comments

Comments
 (0)