New issue
Advanced search Search tips

Issue 641655 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Sep 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

Logcat file is sometimes not read correctly for a crash.

Project Member Reported by isherman@chromium.org, Aug 27 2016

Issue description

The logcat file is sometimes not read correctly for a crash.  In particular, LogcatExtractionCallable::getLogcatInternal() calls extractLogcatFromReader() in a loop, and on each iteration overwrites the read logcat data.  Relatively often, I observed this resulting in a failure to read the logcat contents, because the first call to extractLogcatFromReader() returned nonempty contents, and the second call returned empty contents.

I'm not sure of the best way to fix this.  Some ideas:
(1) Treat the logcat file read as chunked, and append results from calls to extractLogcatFromReader()
(2) Don't call extractLogcatFromReader() until the "logcat -d" command completes.  I'm not sure whether the output of the command is consistently available after the command completes.
(3) Something completely different and much more clever (or much more simple).
 
Project Member

Comment 1 by bugdroid1@chromium.org, Sep 27 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4a1d16c19d99d81f644c90365751fe9408963f36

commit 4a1d16c19d99d81f644c90365751fe9408963f36
Author: isherman <isherman@chromium.org>
Date: Tue Sep 27 05:46:35 2016

[Android] Read the *last* N lines of a logcat to associate with a crash.

More precisely, reads the last N lines preceding the microdump, if any,
since any lines that follow the microdump are most likely not relevant to
the crash.

BUG= 641655 
R=gayane@chromium.org

Review-Url: https://codereview.chromium.org/2282173003
Cr-Commit-Position: refs/heads/master@{#421117}

[modify] https://crrev.com/4a1d16c19d99d81f644c90365751fe9408963f36/chrome/android/java/src/org/chromium/chrome/browser/crash/LogcatExtractionCallable.java
[modify] https://crrev.com/4a1d16c19d99d81f644c90365751fe9408963f36/chrome/android/junit/src/org/chromium/chrome/browser/crash/LogcatExtractionCallableUnitTest.java

Status: Fixed (was: Started)

Sign in to add a comment