Declare to heap that switching from zygote to its child in test 2031
Otherwise userfaultfd GC logic asserts in certain cases that we are
zygote, whereas that's not true as per the runtime.
Test: art/test/testrunner/testrunner.py --host -t 2031
Change-Id: Ice5dc3605ac8623dfb139773aff7cc7c8b6116ce
diff --git a/test/2031-zygote-compiled-frame-deopt/native-wait.cc b/test/2031-zygote-compiled-frame-deopt/native-wait.cc
index 1c8af24..c256d59 100644
--- a/test/2031-zygote-compiled-frame-deopt/native-wait.cc
+++ b/test/2031-zygote-compiled-frame-deopt/native-wait.cc
@@ -40,6 +40,7 @@
if (has_jit) {
runtime->GetJit()->PreZygoteFork();
}
+ runtime->GetHeap()->PreZygoteFork();
runtime->SetAsZygoteChild(/*is_system_server=*/false, /*is_zygote=*/false);
runtime->AddCompilerOption("--debuggable");
runtime->SetRuntimeDebugState(Runtime::RuntimeDebugState::kJavaDebuggableAtInit);
@@ -55,6 +56,7 @@
// We have "zygote" code that isn't really part of the BCP. just don't collect it.
runtime->GetJitCodeCache()->SetGarbageCollectCode(false);
}
+ runtime->GetHeap()->PostForkChildAction(Thread::Current());
}
extern "C" JNIEXPORT void JNICALL Java_art_Test2031_setupJvmti(JNIEnv* env,