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

Commit fc811dce authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Cancel pending launch only if its removed process wasn't attached

There could be a corner race:
Low-memory-killer kills a process which is the target process of
a launching activity. Assume binder thread T1, T2:
 T1 receives binder died.
 T1 sets thread null.
    From AMS: handleAppDiedLocked > handleAppDiedLocked
               > onCleanupApplicationRecordLSP > makeInactive
               > WindowProcessController#setThread)
 T2 previous activity paused triggers to resume next top activity,
    then requests to start process because thread is null.
    From ActivityTaskSupervisor#startSpecificActivity
 T1 removes died process record.
    From AMS: handleAppDiedLocked > cleanUpApplicationRecordLocked
               > removeProcessNameLocked
               > ATMI:onProcessRemoved
               > remove launching activities

The activity removal in onProcessRemoved only focuses on handling
process which hasn't completed attach (i.e. no binder died).

Bug: 360797479
Flag: EXEMPT bugfix
Test: atest RootWindowContainerTests#testAttachApplication
Change-Id: I36484c634fa3e97194d3e60a9d33d0490051570f
parent 5268d622
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment