summaryrefslogtreecommitdiff
path: root/cmds/installd/commands.cpp
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2016-03-30 11:03:41 -0700
committer Mathieu Chartier <mathieuc@google.com> 2016-03-30 11:22:41 -0700
commita812bcfd06df38a360545ae6655a90a9564c3aa9 (patch)
tree0a9f6773b6dfee0e8b1b979f10b071fc252c83ed /cmds/installd/commands.cpp
parent057facfdc6b512b4fe43ee19db50b5156cecff84 (diff)
Revert "Avoid unlinking app image file"
Need unlink or the image file can change while being mmaped. Bug: 27493510 This reverts commit 310c5e70b2e36df36811b6de7ad5c2ebd82338e5. Change-Id: Ied09848e0b646f946f20f2ed114cac6b438bcda1
Diffstat (limited to 'cmds/installd/commands.cpp')
-rw-r--r--cmds/installd/commands.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmds/installd/commands.cpp b/cmds/installd/commands.cpp
index 3eae5a3210..95bc4b963d 100644
--- a/cmds/installd/commands.cpp
+++ b/cmds/installd/commands.cpp
@@ -1463,9 +1463,9 @@ int dexopt(const char* apk_path, uid_t uid, const char* pkgname, const char* ins
// Use app images only if it is enabled (by a set image format) and we are compiling
// profile-guided (so the app image doesn't conservatively contain all classes).
if (profile_guided && have_app_image_format) {
- // Recreate is false since we want to avoid deleting the image in case dex2oat decides to
- // not compile anything.
- image_fd = open_output_file(image_path, /*recreate*/false);
+ // Recreate is true since we do not want to modify a mapped image. If the app is already
+ // running and we modify the image file, it can cause crashes (b/27493510).
+ image_fd = open_output_file(image_path, /*recreate*/true);
if (image_fd < 0) {
// Could not create application image file. Go on since we can compile without it.
ALOGE("installd could not create '%s' for image file during dexopt\n", image_path);