8297170: misc JCK tests fail with "FATAL ERROR in native method: JDWP Can't disable vthread end events, jvmtiError=JVMTI_ERROR_WRONG_PHASE(112)"
Reviewed-by: amenkov, dcubed, lmesnik, sspitsyn
This commit is contained in:
parent
c68556916a
commit
1323e98df1
@ -1621,6 +1621,15 @@ eventHandler_onConnect() {
|
|||||||
debugMonitorExit(handlerLock);
|
debugMonitorExit(handlerLock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static jvmtiError
|
||||||
|
adjust_jvmti_error(jvmtiError error) {
|
||||||
|
// Allow WRONG_PHASE if vm is exiting.
|
||||||
|
if (error == JVMTI_ERROR_WRONG_PHASE && gdata->vmDead) {
|
||||||
|
error = JVMTI_ERROR_NONE;
|
||||||
|
}
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
eventHandler_reset(jbyte sessionID)
|
eventHandler_reset(jbyte sessionID)
|
||||||
{
|
{
|
||||||
@ -1637,18 +1646,20 @@ eventHandler_reset(jbyte sessionID)
|
|||||||
|
|
||||||
/* Disable vthread START and END events unless we are remembering vthreads
|
/* Disable vthread START and END events unless we are remembering vthreads
|
||||||
* when no debugger is connected. We do this because these events can
|
* when no debugger is connected. We do this because these events can
|
||||||
* be very noisy and hurt performance a lot.
|
* be very noisy and hurt performance a lot. Note the VM might be exiting,
|
||||||
|
* and we might get the VM_DEATH event while executing here, so don't
|
||||||
|
* complain about JVMTI_ERROR_WRONG_PHASE if we've already seen VM_DEATH event.
|
||||||
*/
|
*/
|
||||||
if (gdata->vthreadsSupported && !gdata->rememberVThreadsWhenDisconnected) {
|
if (gdata->vthreadsSupported && !gdata->rememberVThreadsWhenDisconnected) {
|
||||||
jvmtiError error;
|
jvmtiError error;
|
||||||
error = threadControl_setEventMode(JVMTI_DISABLE,
|
error = threadControl_setEventMode(JVMTI_DISABLE,
|
||||||
EI_VIRTUAL_THREAD_START, NULL);
|
EI_VIRTUAL_THREAD_START, NULL);
|
||||||
if (error != JVMTI_ERROR_NONE) {
|
if (adjust_jvmti_error(error) != JVMTI_ERROR_NONE) {
|
||||||
EXIT_ERROR(error,"Can't disable vthread start events");
|
EXIT_ERROR(error,"Can't disable vthread start events");
|
||||||
}
|
}
|
||||||
error = threadControl_setEventMode(JVMTI_DISABLE,
|
error = threadControl_setEventMode(JVMTI_DISABLE,
|
||||||
EI_VIRTUAL_THREAD_END, NULL);
|
EI_VIRTUAL_THREAD_END, NULL);
|
||||||
if (error != JVMTI_ERROR_NONE) {
|
if (adjust_jvmti_error(error) != JVMTI_ERROR_NONE) {
|
||||||
EXIT_ERROR(error,"Can't disable vthread end events");
|
EXIT_ERROR(error,"Can't disable vthread end events");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user