summaryrefslogtreecommitdiff
path: root/rs/java/android/renderscript/RenderScript.java
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2016-12-09 09:06:12 -0700
committerJeff Sharkey <jsharkey@android.com>2016-12-09 09:07:16 -0700
commit41d2be0f0f824c002090c2fb663a0a9cdafca034 (patch)
treedaddeacfe0793be5187f0c70a5880d650136e807 /rs/java/android/renderscript/RenderScript.java
parentc0b7e766b03b9f463736caef75902b3ce4548e15 (diff)
Fix race condition bug related to freezing apps.
Consider the following situation: 1. Package is frozen. 2. We try forking the app while frozen, causing a ProcessRecord with PID 0 to be recorded in mProcessNames. As a result of the failed fork, removeProcessLocked() tears down that ProcessRecord, but a special case records it into mRemovedProcesses. 3. Package is unfrozen. 4. We try forking the app, and this time it proceeds normally now that we're unfrozen. The new valid ProcessRecord is recorded in mProcessNames. 5. activityIdleInternalLocked() triggers a clean-up pass of mRemovedProcesses. trimApplications() ends up cleaning up the stale reference from (2) above *by hash key* and not *by reference*, which causes us to remove the new valid ProcessRecord. This results in the valid ProcessRecord in (4) becoming an orphaned PID, which starts a chain reaction of havoc that ensues. This issue is fixed by checking the expected ProcessRecord by value before actually removing it, thus preventing orphaned PIDs. Test: builds, boots, over 600 installs without orphaned PIDs Bug: 28395549 Change-Id: I5ea1b31c3fd374ea7f5cc40ff35bb9195d9f3e2b
Diffstat (limited to 'rs/java/android/renderscript/RenderScript.java')
0 files changed, 0 insertions, 0 deletions