summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2020-01-08 16:43:17 -0800
committer Mathieu Chartier <mathieuc@google.com> 2020-01-09 16:55:26 +0000
commitb86e9b0b63f4fbcc80859ff2637f86ee3ddc374c (patch)
tree197926197a553fe436fa098d9edbae9c739e28bb
parent81ba7db6eb468598e5b17b7d8480e00d8245f9c2 (diff)
Close fd if polling thread is disabled
Leaving it open causes problems with the webview zygote fd sanitization. Test: launch gmail and verify it doesn't crash Bug: 147381929 Bug: 139883463 Change-Id: I0b5d45a730a7da21e04284515645d0eac3e20b66
-rw-r--r--runtime/jit/jit.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/runtime/jit/jit.cc b/runtime/jit/jit.cc
index 285cfeefab..73b9f8b46f 100644
--- a/runtime/jit/jit.cc
+++ b/runtime/jit/jit.cc
@@ -1652,6 +1652,9 @@ void Jit::PostForkChildAction(bool is_system_server, bool is_zygote) {
pthread_create,
(&polling_thread, &attr, RunPollingThread, reinterpret_cast<void*>(this)),
"Methods maps thread");
+ } else {
+ // We need to close the fd otherwise the webview zygote will have problems.
+ fd_methods_.reset();
}
if (is_zygote || runtime->IsSafeMode()) {