RFR: 8266593: vmTestbase/nsk/jvmti/PopFrame/popframe011 fails with "assert(java_thread == _state->get_thread()) failed: Must be" [v3]

Serguei Spitsyn sspitsyn at openjdk.java.net
Thu Nov 18 10:34:40 UTC 2021


On Thu, 18 Nov 2021 09:34:13 GMT, Serguei Spitsyn <sspitsyn at openjdk.org> wrote:

>> The test fails when the target JavaThread has is_exiting() status. In such a case the JvmtiExport::cleanup_thread(this) has already made a clean up of its jvmtiThreadState, so the JavaThread address returned by _state->get_thread() is 0xbabababababababa.
>> The fix is to add a check for is_exiting() status into handshake closure do_thread() early.
>> There following handshake closures are fixed by this update:
>>   - UpdateForPopTopFrameClosure
>>  - SetForceEarlyReturn
>>  - SetFramePopClosure
>
> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision:
> 
>   get rid of the checks in jvmti handshakes: java_thread->threadObj() == NULL

It is not correct.
At least, there is this case:

/* non suspended and exiting thread */
    case 6:
        set_watch_ev(1); /* watch JVMTI events */
        popframe_err = (jvmti->PopFrame(frameThr)); /* explode the bomb */
        set_watch_ev(0); /* ignore again JVMTI events */
        if (popframe_err != JVMTI_ERROR_THREAD_NOT_SUSPENDED &&
            popframe_err != JVMTI_ERROR_THREAD_NOT_ALIVE) {
            printf("TEST FAILED: the function PopFrame() returned the error %d: %s\n",
                popframe_err, TranslateError(popframe_err));
            printf("\tBut it should return the error JVMTI_ERROR_THREAD_NOT_SUSPENDED or JVMTI_ERROR_THREAD_NOT_ALIVE.\n");
            return STATUS_FAILED;
        }
        break;
    }

In other cases, the test constructs cases so that the tested thread is alive when expected.
The test was easily failing before in 10th of runs but now it does not fail in 100 runs.
I'll try to run this test 1000 times on all platforms.

-------------

PR: https://git.openjdk.java.net/jdk/pull/6440


More information about the serviceability-dev mailing list