summaryrefslogtreecommitdiff
path: root/tools/aapt2/java/JavaClassGenerator_test.cpp
diff options
context:
space:
mode:
authorHui Yu <huiyu@google.com>2019-05-07 14:02:57 -0700
committerHui Yu <huiyu@google.com>2019-05-15 17:30:15 -0700
commit6dabda8d80276dba7f38e693816ee901ce764b95 (patch)
tree86dbf1b3888c6dce79aca4e71766c6602010c279 /tools/aapt2/java/JavaClassGenerator_test.cpp
parent9d89fd9fb26d0fe395ee6aa7d9b9cdf11a9d1ec9 (diff)
Clean up ProcessRecord when reuse a pid.
When Zygote starts a process with a pid, system_server may have this pid associate with a old process which is killed by the OS but system_server has not finished cleanup. In this case, clean up the old ProcessRecord so the new process can use the pid. This problem is exposed because the asynchronous process start change. attachApplicationLocked() may happen before handleProcessStartedLocked() and the mPidsSelfLocked may still have the old ProcessRecord associate with the new process's pid. Pid alone can not uniquely identify the process in mPidsSelfLocked. In addition to pid, use the startSeq to uniquely identify the ProcessRecord. Refactor PidMap.put() and PidMap.remove() to take a ProcessRecord as parameter. In PidMap.remove(), check startSeq before removing ProcessRecord from the map. Bug: 131105245 Test: Using the POC test steps in b/131105245. Without the fix, the issue can be reproduced in few attempts. With the fix, the issue can not be reproduced any more. Change-Id: I5d421f6c68f6b3437d51c94f4aef77e08a7bf002
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator_test.cpp')
0 files changed, 0 insertions, 0 deletions