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

Issue 2878193002: [Crash Reporting] Implement a more direct bridge for extracting logcat output. (Closed)

Created:
3 years, 7 months ago by Ilya Sherman
Modified:
3 years, 7 months ago
CC:
chromium-reviews, sadrul, droger+watchlist_chromium.org, blundell+watchlist_chromium.org, sdefresne+watchlist_chromium.org, jam, darin-cc_chromium.org, asvitkine+watch_chromium.org, agrieve+watch_chromium.org, kalyank
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

[Crash Reporting] Implement a more direct bridge for extracting logcat output. When a child process crashes, Chrome attempts to attach recent logcat output to the minidump for the crash. Previously, this was implemented via a FileObserver on the crash reports directory: When the file observer detected a file moved into the directory, and saw that the filename matched the appropriate regex pattern, it would attempt to append logcat output. This has two drawbacks: (1) It's spooky action at a distance, which makes the code harder to reason about. (2) There's a super subtle constraint encoded into the "moved to" check: When the browser process crashes, a crash dump matching the same file pattern appears in the observed directory, but it is *created* rather than *moved*. Thus, this check is intentionally excluding browser crashes, for which the code might otherwise have a race between trying to attach logcat output and tearing down the main Java process. This CL replaces the FileObserver with a direct call from the C++ code that processes the minidump into the Java code that extracts the logcat. (Well, there's some indirection to get through the Chrome layering onion, but the flow is still much more linear.) BUG=719129 TEST=CrashDumpManagerTest.* R=gsennton@chromium.org Review-Url: https://codereview.chromium.org/2878193002 Cr-Commit-Position: refs/heads/master@{#472613} Committed: https://chromium.googlesource.com/chromium/src/+/6a32f0233caef0ad160bb4c3adcc25bb091ab4d0

Patch Set 1 #

Patch Set 2 : git-add new files #

Total comments: 2

Patch Set 3 : tryToAttachLogcat -> tryToUploadMinidump #

Patch Set 4 : Add an OWNERS file #

Total comments: 4

Patch Set 5 : Thread safety #

Patch Set 6 : Print the minidump path on an error #

Total comments: 2

Patch Set 7 : Document threading more, and fix check_deps #

Unified diffs Side-by-side diffs Delta from patch set Stats (+279 lines, -66 lines) Patch
M chrome/android/BUILD.gn View 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/android/java/DEPS View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
D chrome/android/java/src/org/chromium/chrome/browser/crash/MinidumpDirectoryObserver.java View 1 chunk +0 lines, -49 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/init/ChromeBrowserInitializer.java View 1 2 4 chunks +10 lines, -14 lines 0 comments Download
M chrome/android/java_sources.gni View 1 chunk +0 lines, -1 line 0 comments Download
A components/crash/android/BUILD.gn View 1 1 chunk +32 lines, -0 lines 0 comments Download
A components/crash/android/DEPS View 1 1 chunk +3 lines, -0 lines 0 comments Download
A components/crash/android/OWNERS View 1 2 3 1 chunk +7 lines, -0 lines 0 comments Download
A components/crash/android/java/src/org/chromium/components/crash/browser/CrashDumpManager.java View 1 2 3 4 5 6 1 chunk +80 lines, -0 lines 0 comments Download
A components/crash/android/javatests/src/org/chromium/components/crash/browser/CrashDumpManagerTest.java View 1 2 3 4 1 chunk +127 lines, -0 lines 0 comments Download
M components/crash/content/browser/BUILD.gn View 1 chunk +4 lines, -0 lines 0 comments Download
M components/crash/content/browser/DEPS View 1 chunk +1 line, -0 lines 0 comments Download
M components/crash/content/browser/crash_dump_manager_android.cc View 1 2 3 chunks +12 lines, -2 lines 0 comments Download

Messages

Total messages: 43 (26 generated)
Ilya Sherman
3 years, 7 months ago (2017-05-13 05:19:34 UTC) #1
gsennton
I like this much more than the Directory-listener (it is more clear in what cases ...
3 years, 7 months ago (2017-05-15 13:00:42 UTC) #11
gsennton
Toby, does it make sense to use the mechanism presented in this CL for WebView ...
3 years, 7 months ago (2017-05-15 13:05:13 UTC) #12
Ilya Sherman
Thanks, Gustav! https://codereview.chromium.org/2878193002/diff/20001/components/crash/android/java/src/org/chromium/components/crash/browser/CrashDumpManager.java File components/crash/android/java/src/org/chromium/components/crash/browser/CrashDumpManager.java (right): https://codereview.chromium.org/2878193002/diff/20001/components/crash/android/java/src/org/chromium/components/crash/browser/CrashDumpManager.java#newcode46 components/crash/android/java/src/org/chromium/components/crash/browser/CrashDumpManager.java:46: public static void tryToAttachLogcat(String minidumpPath) { On ...
3 years, 7 months ago (2017-05-16 07:03:39 UTC) #15
Ilya Sherman
+Maria for OWNERS review of all the Java files. +Mark for OWNERS review of all ...
3 years, 7 months ago (2017-05-16 07:06:08 UTC) #19
Tobias Sargeant
On 2017/05/15 13:05:13, gsennton wrote: > Toby, does it make sense to use the mechanism ...
3 years, 7 months ago (2017-05-16 14:31:12 UTC) #22
Mark Mentovai
components/crash LGTM, mostly as a stamp to approve your new subdirectory.
3 years, 7 months ago (2017-05-16 14:34:31 UTC) #23
Ilya Sherman
On 2017/05/16 14:31:12, Tobias Sargeant wrote: > On 2017/05/15 13:05:13, gsennton wrote: > > Toby, ...
3 years, 7 months ago (2017-05-16 20:26:25 UTC) #24
Ilya Sherman
On 2017/05/16 20:26:25, Ilya Sherman wrote: > On 2017/05/16 14:31:12, Tobias Sargeant wrote: > > ...
3 years, 7 months ago (2017-05-16 23:42:30 UTC) #26
Maria
https://codereview.chromium.org/2878193002/diff/60001/components/crash/android/java/src/org/chromium/components/crash/browser/CrashDumpManager.java File components/crash/android/java/src/org/chromium/components/crash/browser/CrashDumpManager.java (right): https://codereview.chromium.org/2878193002/diff/60001/components/crash/android/java/src/org/chromium/components/crash/browser/CrashDumpManager.java#newcode34 components/crash/android/java/src/org/chromium/components/crash/browser/CrashDumpManager.java:34: public static void registerUploadCallback(UploadMinidumpCallback callback) { I am concerned ...
3 years, 7 months ago (2017-05-17 00:39:23 UTC) #28
Ilya Sherman
https://codereview.chromium.org/2878193002/diff/60001/components/crash/android/java/src/org/chromium/components/crash/browser/CrashDumpManager.java File components/crash/android/java/src/org/chromium/components/crash/browser/CrashDumpManager.java (right): https://codereview.chromium.org/2878193002/diff/60001/components/crash/android/java/src/org/chromium/components/crash/browser/CrashDumpManager.java#newcode34 components/crash/android/java/src/org/chromium/components/crash/browser/CrashDumpManager.java:34: public static void registerUploadCallback(UploadMinidumpCallback callback) { On 2017/05/17 00:39:23, ...
3 years, 7 months ago (2017-05-17 00:59:54 UTC) #29
Maria
lgtm https://codereview.chromium.org/2878193002/diff/100001/components/crash/android/java/src/org/chromium/components/crash/browser/CrashDumpManager.java File components/crash/android/java/src/org/chromium/components/crash/browser/CrashDumpManager.java (right): https://codereview.chromium.org/2878193002/diff/100001/components/crash/android/java/src/org/chromium/components/crash/browser/CrashDumpManager.java#newcode20 components/crash/android/java/src/org/chromium/components/crash/browser/CrashDumpManager.java:20: * An interface for providing a callback that ...
3 years, 7 months ago (2017-05-17 01:06:56 UTC) #32
Tobias Sargeant
On 2017/05/16 23:42:30, Ilya Sherman wrote: > Sorry for the scattered nature of my previous ...
3 years, 7 months ago (2017-05-17 10:55:23 UTC) #35
Alexei Svitkine (slow)
Drive-by (re: last comment): I think you can use the worker pool and still guarantee ...
3 years, 7 months ago (2017-05-17 12:22:01 UTC) #36
Ilya Sherman
https://codereview.chromium.org/2878193002/diff/100001/components/crash/android/java/src/org/chromium/components/crash/browser/CrashDumpManager.java File components/crash/android/java/src/org/chromium/components/crash/browser/CrashDumpManager.java (right): https://codereview.chromium.org/2878193002/diff/100001/components/crash/android/java/src/org/chromium/components/crash/browser/CrashDumpManager.java#newcode20 components/crash/android/java/src/org/chromium/components/crash/browser/CrashDumpManager.java:20: * An interface for providing a callback that will ...
3 years, 7 months ago (2017-05-17 21:27:05 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2878193002/120001
3 years, 7 months ago (2017-05-17 21:28:50 UTC) #40
commit-bot: I haz the power
3 years, 7 months ago (2017-05-18 00:48:49 UTC) #43
Message was sent while issue was closed.
Committed patchset #7 (id:120001) as
https://chromium.googlesource.com/chromium/src/+/6a32f0233caef0ad160bb4c3adcc...

Powered by Google App Engine
This is Rietveld 408576698