Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(839)

Issue 663543003: Fix low-memory devices crashing on Chrome start up during UMA recodring (Closed)

Created:
6 years, 2 months ago by petrcermak
Modified:
6 years, 1 month ago
CC:
chromium-reviews, erikwright+watch_chromium.org, asvitkine+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Fix for a problem on low-memory devices caused by https://codereview.chromium.org/643803003. This patch prevents low-memory devices from crashing on Chrome start up. Instead of relying on the Linker.sInBrowserProcess field, which can have an incorrect value on these devices, the mmap check (whether the device supports loading libraries directly from APK files) is performed inside LibraryLoader.onNativeInitializationComplete, which is guaranteed to be called only in the process thread. In addition, two extra possible values are added to the UMA histogram: Unknown (the mmap check was not carried out) and Successful (a library was successfully loaded directly from the APK). Finally, this patch removes the deprecated LibraryLoader.onNativeInitializationComplete() method (with no arguments), which was replaced by LibraryLoader.onNativeInitializationComplete(Context context) in https://codereview.chromium.org/643923004/. BUG=423699, 390618 Committed: https://crrev.com/23b7f2397e7e374eabaf0c3087fc960f4379c21f Cr-Commit-Position: refs/heads/master@{#301342}

Patch Set 1 #

Total comments: 43

Patch Set 2 : Large update for review feedback #

Total comments: 16

Patch Set 3 : Update for review feedback #

Patch Set 4 : Removed LibraryLoader.onNativeInitializationComplete() with no arguments #

Total comments: 4

Patch Set 5 : Final update for review feedback #

Patch Set 6 : Simplify Java-C++ enum sharing and fix WebView dependency #

Total comments: 2

Patch Set 7 : Fix recipe trybots failures #

Unified diffs Side-by-side diffs Delta from patch set Stats (+102 lines, -58 lines) Patch
M android_webview/java_library_common.mk View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M android_webview/libwebviewchromium.gypi View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M base/BUILD.gn View 1 2 3 4 5 6 2 chunks +4 lines, -0 lines 0 comments Download
M base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java View 1 2 3 6 chunks +30 lines, -23 lines 0 comments Download
M base/android/java/src/org/chromium/base/library_loader/Linker.java View 1 2 3 chunks +3 lines, -13 lines 0 comments Download
A base/android/library_loader/library_load_from_apk_status_codes.h View 1 2 3 4 5 1 chunk +36 lines, -0 lines 0 comments Download
M base/android/library_loader/library_loader_hooks.cc View 1 2 3 4 5 4 chunks +6 lines, -15 lines 0 comments Download
M base/base.gyp View 1 2 3 4 5 6 2 chunks +11 lines, -0 lines 0 comments Download
M base/base.gypi View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 3 chunks +9 lines, -7 lines 0 comments Download

Messages

Total messages: 41 (13 generated)
petrcermak
Hi, Please have a look at my CL. rmcilroy: base isherman: tools everybody else: FYI ...
6 years, 2 months ago (2014-10-16 18:48:52 UTC) #2
Ilya Sherman
https://codereview.chromium.org/663543003/diff/1/base/android/library_loader/library_loader_hooks.cc File base/android/library_loader/library_loader_hooks.cc (right): https://codereview.chromium.org/663543003/diff/1/base/android/library_loader/library_loader_hooks.cc#newcode54 base/android/library_loader/library_loader_hooks.cc:54: // The loader was unable to determine whether the ...
6 years, 2 months ago (2014-10-16 19:00:30 UTC) #3
Ilya Sherman
Sorry, histograms LGTM with those nits addressed.
6 years, 2 months ago (2014-10-16 19:01:24 UTC) #4
picksi1
Some lack-of-sleep powered nit picky points. https://codereview.chromium.org/663543003/diff/1/base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java File base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java (right): https://codereview.chromium.org/663543003/diff/1/base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java#newcode186 base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java:186: } Can you ...
6 years, 2 months ago (2014-10-17 08:23:24 UTC) #5
rmcilroy
https://codereview.chromium.org/663543003/diff/1/base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java File base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java (right): https://codereview.chromium.org/663543003/diff/1/base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java#newcode63 base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java:63: public static final int LIBRARY_LOAD_FROM_APK_UNKNOWN = 2; On 2014/10/16 ...
6 years, 2 months ago (2014-10-17 09:12:59 UTC) #6
picksi1
https://codereview.chromium.org/663543003/diff/1/base/android/library_loader/library_loader_hooks.cc File base/android/library_loader/library_loader_hooks.cc (right): https://codereview.chromium.org/663543003/diff/1/base/android/library_loader/library_loader_hooks.cc#newcode108 base/android/library_loader/library_loader_hooks.cc:108: library_load_from_apk_support = UNKNOWN; If we ditched the default entry ...
6 years, 2 months ago (2014-10-17 09:23:51 UTC) #7
rmcilroy
https://codereview.chromium.org/663543003/diff/1/base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java File base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java (right): https://codereview.chromium.org/663543003/diff/1/base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java#newcode334 base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java:334: libraryLoadFromApkSupport); Actually, I'm just about to turn on loading ...
6 years, 2 months ago (2014-10-17 09:54:46 UTC) #8
petrcermak
Thanks for your comments. PTAL. danakj: base rmcilroy: base/android isherman: tools everybody else: FYI Thanks, ...
6 years, 2 months ago (2014-10-17 14:51:28 UTC) #12
rmcilroy
Looks good, a couple more comments. Could you also please update the title and description ...
6 years, 2 months ago (2014-10-20 10:42:39 UTC) #13
petrcermak
Thanks for your comments. PTAL. https://codereview.chromium.org/663543003/diff/1/base/android/java/src/org/chromium/base/library_loader/Linker.java File base/android/java/src/org/chromium/base/library_loader/Linker.java (right): https://codereview.chromium.org/663543003/diff/1/base/android/java/src/org/chromium/base/library_loader/Linker.java#newcode831 base/android/java/src/org/chromium/base/library_loader/Linker.java:831: assert apkFile != null; ...
6 years, 2 months ago (2014-10-20 15:33:22 UTC) #15
picksi1
lgtm!
6 years, 2 months ago (2014-10-20 15:48:19 UTC) #16
rmcilroy
LGTM, thanks Petr. SimonB - do you have any comments before Petr lands this?
6 years, 2 months ago (2014-10-21 11:04:31 UTC) #17
petrcermak
FYI: I removed the deprecated LibraryLoader.onNativeInitializationComplete() method with no arguments.
6 years, 2 months ago (2014-10-21 12:46:45 UTC) #18
danakj
The GYP/GN changes in base LGTM w/ some comments https://codereview.chromium.org/663543003/diff/120001/base/BUILD.gn File base/BUILD.gn (right): https://codereview.chromium.org/663543003/diff/120001/base/BUILD.gn#newcode1446 base/BUILD.gn:1446: ...
6 years, 2 months ago (2014-10-23 15:12:36 UTC) #19
petrcermak
Thanks for your comments. I will now commit the patch. https://codereview.chromium.org/663543003/diff/120001/base/BUILD.gn File base/BUILD.gn (right): https://codereview.chromium.org/663543003/diff/120001/base/BUILD.gn#newcode1446 ...
6 years, 2 months ago (2014-10-23 16:24:57 UTC) #20
simonb (inactive)
lgtm
6 years, 2 months ago (2014-10-23 17:49:04 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/663543003/140001
6 years, 2 months ago (2014-10-23 18:01:50 UTC) #23
commit-bot: I haz the power
Try jobs failed on following builders: android_aosp on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/android_aosp/builds/26965)
6 years, 2 months ago (2014-10-23 18:34:37 UTC) #25
petrcermak
I made some changes to simplify Java-C++ enum sharing and fix WebView dependency (which was ...
6 years, 2 months ago (2014-10-24 12:12:02 UTC) #29
mkosiba (inactive)
android_webview/ LGTM https://codereview.chromium.org/663543003/diff/200001/base/android/library_loader/library_load_from_apk_status_codes.h File base/android/library_loader/library_load_from_apk_status_codes.h (right): https://codereview.chromium.org/663543003/diff/200001/base/android/library_loader/library_load_from_apk_status_codes.h#newcode16 base/android/library_loader/library_load_from_apk_status_codes.h:16: LIBRARY_LOAD_FROM_APK_STATUS_CODES_UNKNOWN = 0, FYI: you don't need ...
6 years, 2 months ago (2014-10-24 14:17:26 UTC) #30
rmcilroy
On 2014/10/24 14:17:26, mkosiba wrote: > android_webview/ LGTM > > https://codereview.chromium.org/663543003/diff/200001/base/android/library_loader/library_load_from_apk_status_codes.h > File base/android/library_loader/library_load_from_apk_status_codes.h (right): ...
6 years, 2 months ago (2014-10-24 15:17:27 UTC) #31
danakj
the gyp/gn still lgtm
6 years, 2 months ago (2014-10-24 16:40:17 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/663543003/200001
6 years, 2 months ago (2014-10-24 16:40:38 UTC) #34
petrcermak
Thanks for your comments. https://codereview.chromium.org/663543003/diff/200001/base/android/library_loader/library_load_from_apk_status_codes.h File base/android/library_loader/library_load_from_apk_status_codes.h (right): https://codereview.chromium.org/663543003/diff/200001/base/android/library_loader/library_load_from_apk_status_codes.h#newcode16 base/android/library_loader/library_load_from_apk_status_codes.h:16: LIBRARY_LOAD_FROM_APK_STATUS_CODES_UNKNOWN = 0, On 2014/10/24 ...
6 years, 2 months ago (2014-10-24 16:42:50 UTC) #35
commit-bot: I haz the power
Try jobs failed on following builders: android_arm64_dbg_recipe on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/android_arm64_dbg_recipe/builds/16017) android_clang_dbg_recipe on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/android_clang_dbg_recipe/builds/15971)
6 years, 2 months ago (2014-10-24 16:51:48 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/663543003/220001
6 years, 1 month ago (2014-10-27 10:40:15 UTC) #39
commit-bot: I haz the power
Committed patchset #7 (id:220001)
6 years, 1 month ago (2014-10-27 11:24:58 UTC) #40
commit-bot: I haz the power
6 years, 1 month ago (2014-10-27 11:25:32 UTC) #41
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/23b7f2397e7e374eabaf0c3087fc960f4379c21f
Cr-Commit-Position: refs/heads/master@{#301342}

Powered by Google App Engine
This is Rietveld 408576698