Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e61bb742 authored by Jing Ji's avatar Jing Ji
Browse files

Fix potential FD leak with PhantomProcessRecord bookkeeping

We're tracking the phantom processes with the combination of
its process name and pid/uid, while if the process name changes
it'll be removed from the internal bookkeping, we should close
the FD to that process upon then.

Bug: 194146206
Test: atest AppChildProcessTest
Test: atest CtsAppTestCases:ActivityManagerTest
Change-Id: I62064afe55aa8bc51a2d523bc5d8fe6e97f171a8
parent 61d71cca
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -305,7 +305,7 @@ public final class PhantomProcessList {
            }
            // Somehow our record doesn't match, remove it anyway
            Slog.w(TAG, "Stale " + proc + ", removing");
            mPhantomProcesses.removeAt(index);
            onPhantomProcessKilledLocked(proc);
        } else {
            // Is this one of the zombie processes we've known?
            final int idx = mZombiePhantomProcesses.indexOfKey(pid);