Skip to content

Commit ecedf4a

Browse files
authored
Merge pull request #20664 from JasonFengJ9/criuassert-0.49
(0.49) CRIU jvmtiHookVMRestoreStartAgent() requires internalEnterVMFromJNI()
2 parents b1d5b09 + 293c010 commit ecedf4a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

runtime/jvmti/jvmtiHook.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -570,13 +570,12 @@ jvmtiHookVMRestoreStartAgent(J9HookInterface **hook, UDATA eventNum, void *event
570570
{
571571
J9VMThread *currentThread = ((J9RestoreEvent *)eventData)->currentThread;
572572
J9JavaVM *vm = currentThread->javaVM;
573+
J9InternalVMFunctions const * const vmFuncs = vm->internalVMFunctions;
574+
573575
Trc_JVMTI_jvmtiHookVMRestoreStartAgent_Entry();
576+
vmFuncs->internalExitVMToJNI(currentThread);
574577
if (J9_ARE_ANY_BITS_SET(vm->checkpointState.flags, J9VM_CRIU_IS_JDWP_ENABLED)) {
575-
J9InternalVMFunctions const * const vmFuncs = vm->internalVMFunctions;
576-
577-
vmFuncs->internalExitVMToJNI(currentThread);
578578
criuRestoreStartAgent(vm);
579-
vmFuncs->internalEnterVMFromJNI(currentThread);
580579
} else {
581580
/* Last part of cleanup if there was no JDWP agent specified.
582581
* This releases VM access hence can't be invoked within criuDisableHooks() from
@@ -585,6 +584,7 @@ jvmtiHookVMRestoreStartAgent(J9HookInterface **hook, UDATA eventNum, void *event
585584
jvmtiEnv *jvmti_env = vm->checkpointState.jvmtienv;
586585
(*jvmti_env)->DisposeEnvironment(jvmti_env);
587586
}
587+
vmFuncs->internalEnterVMFromJNI(currentThread);
588588
TRACE_JVMTI_EVENT_RETURN(jvmtiHookVMRestoreStartAgent);
589589
}
590590

0 commit comments

Comments
 (0)