chromiumos/platform/crash-reporter.git
12 months agoAppend all crashes to Chrome's crash log 86/65886/5 master
Albert Chaulk [Wed, 14 Aug 2013 21:46:58 +0000 (14:46 -0700)]
Append all crashes to Chrome's crash log

Currently chrome://crashes reports no crashes due to the switch to using
crash_reporter. This adds reports of all crashes, with the report ID and
product (Chrome or Chrome OS) to Chrome's log.

BUG=chromium:210624
TEST=none

Change-Id: I7e47f6af0374095250830f46b693ac2fa053fa54
Reviewed-on: https://gerrit.chromium.org/gerrit/65886
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Albert Chaulk <achaulk@chromium.org>
Tested-by: Albert Chaulk <achaulk@chromium.org>
12 months agoAdding a lock mechanism to crash_sender. 56/65556/2
Rohit Makasana [Mon, 12 Aug 2013 07:28:05 +0000 (12:58 +0530)]
Adding a lock mechanism to crash_sender.

This is to avoid situations when crash_sender is already running
and while test crash reporting, we execute crash_sender manually.

BUG=None
TEST=Manually

Change-Id: I3beea8d503940d7a1af24c8f16eebb365d447434
Reviewed-on: https://gerrit.chromium.org/gerrit/65556
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Rohit Makasana <rohitbm@chromium.org>
Reviewed-by: Rohit Makasana <rohitbm@chromium.org>
Tested-by: Rohit Makasana <rohitbm@chromium.org>
13 months agocrash_collector: Collect kernel task states for chrome crashes 05/63205/2 factory-pit-4471.B firmware-pit-4482.B stabilize-4512.B
Yuly Novikov [Wed, 24 Jul 2013 14:49:49 +0000 (10:49 -0400)]
crash_collector: Collect kernel task states for chrome crashes

When handling chrome crash:
call debugd to write kernel task states into syslog,
parse only the relevant task states out of syslog,
pack them into the log file to be uploaded.

BUG=chromium:244916
TEST=Kill chrome, see the task states in crash log, on Link, Snow and Alex.

Change-Id: Ib8aad79622886581ae5ce50c03097f01db9153a7
Reviewed-on: https://gerrit.chromium.org/gerrit/63205
Reviewed-by: Albert Chaulk <achaulk@chromium.org>
Reviewed-by: Balazs Engedy <engedy@chromium.org>
Tested-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>

13 months agocrash_collector: Handle compressed i915_error_state for chrome crashes 68/62568/2 factory-4455.B stabilize-4443.B
Yuly Novikov [Fri, 19 Jul 2013 00:31:47 +0000 (20:31 -0400)]
crash_collector: Handle compressed i915_error_state for chrome crashes

i915_error_state was previously truncated by debugd,
and will be compressed in the future to prevent that.

Because of compression, it will now be received in base64 format,
so to reduce it's size, decode it back.

Also, use xz compression, since it's more compact.
The second compression is a preparation for adding task states to the logs.

BUG=chromium:219121
TEST=Kill chrome, see the log gathered. Uploaded report id 5e5a6f9bf6ff4b5f.

Change-Id: I316cdaef8f8f42d4ac839f7c880960cdf6d7a1e8
Reviewed-on: https://gerrit.chromium.org/gerrit/62568
Reviewed-by: Albert Chaulk <achaulk@chromium.org>
Tested-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>

13 months agocrash: Remove references to low-battery state file. 78/62578/2
Daniel Erat [Thu, 18 Jul 2013 22:57:11 +0000 (15:57 -0700)]
crash: Remove references to low-battery state file.

Remove references to the low-battery state file formerly
written by powerd. The system shuts down immediately when it
enters the low-battery state.

BUG=chromium:259189
TEST=ran unit tests

Change-Id: I2122210b448af58fb4ecac2c234b9faa9d231e2b
Reviewed-on: https://gerrit.chromium.org/gerrit/62578
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
Commit-Queue: Daniel Erat <derat@chromium.org>

13 months agocrash_collector: Collect i915_error_state for chrome crashes 06/61606/2
Yuly Novikov [Thu, 11 Jul 2013 21:27:51 +0000 (17:27 -0400)]
crash_collector: Collect i915_error_state for chrome crashes

Since crash_collector runs as chronos for chrome crashes,
it doesn't have permission to read i915_error_state.

Switch to getting it from debugd instead of reading directly.

Also, collect it for all chrome crashes.

BUG=chromium:219121
TEST=Kill chrome, see the log gathered. Uploaded report id 7cbae7f70da9bd3e.

Change-Id: Ic74abea2fc86b16c5a7f0f11df73137d93e5220c
Reviewed-on: https://gerrit.chromium.org/gerrit/61606
Reviewed-by: Albert Chaulk <achaulk@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Tested-by: Yuly Novikov <ynovikov@chromium.org>
13 months agoAdd error logging and fix uploading for chrome crash reports 72/59572/11 factory-pit-4390.B firmware-falco_peppy-4389.B firmware-leon-4389.26.B firmware-wolf-4389.24.B
Albert Chaulk [Wed, 19 Jun 2013 22:34:13 +0000 (15:34 -0700)]
Add error logging and fix uploading for chrome crash reports

Adds some logging of parse errors in case there's a format mismatch in future.
Fixes detection of the minidump, was checking the wrong variable.
Modifies crash_sender to properly upload a Chrome dump, including all of the
extra options that get included, and identifies it as a Chrome and not ChromeOS
dump so that it shows up in the right lists server-side.

BUG=chromium:216523
TEST=loaded build of chrome with matching changes, verified about:crash causes
  a dump to be created and placed in the right spot, and that it uploads
  properly by crash_sender

Change-Id: I8a114ad6798f09f33b78df1680153c0412eabf45
Reviewed-on: https://gerrit.chromium.org/gerrit/59572
Reviewed-by: Albert Chaulk <achaulk@chromium.org>
Tested-by: Albert Chaulk <achaulk@chromium.org>
Commit-Queue: Albert Chaulk <achaulk@chromium.org>

14 months agocrash_collector: pedantically document hashed string for warn_collector 97/60797/3
mukesh agrawal [Tue, 2 Jul 2013 20:00:01 +0000 (13:00 -0700)]
crash_collector: pedantically document hashed string for warn_collector

When computing a hash of a kernel warning message, we include the
trailing newline character. Document this fact, to make it easier
to write separate tools that compute the hash.

BUG=none
TEST=cros_workon_make --board=link --test --reconf crash-reporter

Change-Id: I5d78235db5c8bff7e3639c9d1cd3915d343f471e
Reviewed-on: https://gerrit.chromium.org/gerrit/60797
Commit-Queue: mukesh agrawal <quiche@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
14 months agokernel_log_collector.sh : correct kernel message pattern 97/59297/3 release-R29-4319.B
Yufeng Shen [Wed, 19 Jun 2013 20:50:37 +0000 (16:50 -0400)]
kernel_log_collector.sh : correct kernel message pattern

The timestamp in the kernel message can have either "+" or "-"
sign. We want to match both of them.

BUG=chromium:226186
TEST=Make sure the script can capture message starting with
"2013-06-19T20:38:58.663410+00:00 localhost kernel: ["

Change-Id: I93647d4fc8b3d796166d2e959b24364de4bc60c5
Reviewed-on: https://gerrit.chromium.org/gerrit/59297
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Yufeng Shen <miletus@chromium.org>
Tested-by: Yufeng Shen <miletus@chromium.org>
14 months agoAdd support for sending Atmel TP/TS error message 39/48239/11 factory-4290.B
Yufeng Shen [Tue, 16 Apr 2013 19:00:27 +0000 (15:00 -0400)]
Add support for sending Atmel TP/TS error message

This adds the support that when Pixel touchscreen/trackpad driver
atmel_mxt_ts is misbehaving, e.g. failed to update firmware, failed
to read messages from the chip, trigger crash reporter to send system
logging message for further debugging.

We also follow the policy that, for atmel/cypress logs, we only fetch
the last 30s of the logs.

BUG=chromium:226186
TEST=1. On Pixel, replace the touchscreen firmware file
        /opt/google/touch/firmware/162.0_1.1.170.bin
        with an empty file with the same name
     2. Force touchscreen firmware update
        /opt/google/touch/scripts/chromeos-touch-firmware-update.sh -d atmel_mxt_ts -f -n maxtouch-ts.fw
     3. After the firmware update fails, check crash report exists at
        /var/spool/crash/change__i2c_atmel_mxt_ts.XXX
     4. Check that the log contains only 30s of entries with "atmel" keyword.

Change-Id: If46a575491378405e60ad1ccbd39026ae6bf2033
Reviewed-on: https://gerrit.chromium.org/gerrit/48239
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Will Drewry <wad@chromium.org>
Commit-Queue: Yufeng Shen <miletus@chromium.org>
Tested-by: Yufeng Shen <miletus@chromium.org>
14 months agoUpdate chrome crash reports to require the exe name 29/58929/2
Albert Chaulk [Mon, 17 Jun 2013 20:56:48 +0000 (13:56 -0700)]
Update chrome crash reports to require the exe name

When invoked from chrome we execute too late to get any of the crashing
process' info as it's already been cleaned up by the kernel. So, require
chrome to pass along the name too

BUG=chromium:216523
TEST=manual invocation of /sbin/crash_reporter, verified supplied name gets
  used & it doesn't check /proc for any info

Change-Id: Id74cae3ba93426bd0ac74959741a11baf83c2694
Reviewed-on: https://gerrit.chromium.org/gerrit/58929
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Albert Chaulk <achaulk@chromium.org>
Tested-by: Albert Chaulk <achaulk@chromium.org>
14 months agocrash_sender: disable uploading on test images 84/51084/4 factory-pit-4280.B factory-spring-4262.B stabilize-4287.B
Mike Frysinger [Tue, 14 May 2013 00:37:09 +0000 (20:37 -0400)]
crash_sender: disable uploading on test images

Not sure what has changed, but we're uploading crashes now for test images
when we don't want to.  When the channel in /etc/lsb-release is marked as
a test channel (which happens for all test images), exit early.

BUG=chromium:239862
TEST=passed vmtests (logging_CrashSender & logging_UserCrash)
TEST=`cbuildbot {arm,amd64,x86}-generic-full` pass

Change-Id: I4a35aaa34b590c575de639888ed8be68bc9608b6
Reviewed-on: https://gerrit.chromium.org/gerrit/51084
Reviewed-by: Chris Masone <cmasone@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
14 months agocrash_collector: add /crash to the user crash path 32/58232/2
Mike Frysinger [Tue, 11 Jun 2013 21:03:59 +0000 (17:03 -0400)]
crash_collector: add /crash to the user crash path

The recent multiprofile work forgot to append /crash to the user-specific
crash path.  It was in the fallback path, but not the dynamic one.

BUG=chromium:248629
TEST=`cros_run_unit_tests --board=x86-alex -p crash-reporter` works
TEST=`cbuildbot x86-generic-full` works

Change-Id: If87848526b0e78f3f76fd412b0f46e37b7022bd6
Reviewed-on: https://gerrit.chromium.org/gerrit/58232
Reviewed-by: Chris Masone <cmasone@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
14 months agoFix initialization of kernel_crash_reporter objects. 45/56845/2
Luigi Semenzato [Tue, 28 May 2013 21:29:43 +0000 (14:29 -0700)]
Fix initialization of kernel_crash_reporter objects.

This fixes a copy-paste error that initialized (twice)
the wrong object.

BUG=chromium:244574
TEST=none

Change-Id: I8ada187483a7b8dbfd8ec19ca284cf08a685844e
Reviewed-on: https://gerrit.chromium.org/gerrit/56845
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Tested-by: Luigi Semenzato <semenzato@chromium.org>
Commit-Queue: Luigi Semenzato <semenzato@chromium.org>

14 months agoadd support for multiprofile 00/55600/6
Mike Frysinger [Fri, 17 May 2013 23:36:47 +0000 (19:36 -0400)]
add support for multiprofile

Update crash_sender to scan /home/chronos/u-*/crash/ paths since it's
a shell script and there's no easy way to get the right info via shell
commands.  We want to scan all paths in case of different ordering.

For crash_collector, update it to use SessionManager's dbus call to
query the active profiles.  We select the first one and use that to
process crashes.  This should be fine.

We also need to handle the edge case where no user is logged in (yet a
crash occurs with a program running as chronos uid; e.g. the login).
In the past, we just wrote to /home/chronos/user/crash/ even when there
wasn't a user home dir mounted there.  With this change, we formalize
(and document) things a bit more by moving to /home/chronos/crash/.  We
want this behavior rather than re-using the system path as our tests
specifically verify system vs user crashes.

BUG=chromium:221778
TEST=`cros_run_unit_tests --board=x86-alex -p crash-reporter` passes
TEST=logging_UserCrash autotest passes in a vm
CQ-DEPEND=CL:56112
CQ-DEPEND=CL:57067

Change-Id: If9f2ffd0740533537718b2a5e7d215200f5a41d6
Reviewed-on: https://gerrit.chromium.org/gerrit/55600
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>

14 months agoReplace some LOGs with PLOGs 13/57213/3
Chris Masone [Fri, 31 May 2013 16:37:33 +0000 (09:37 -0700)]
Replace some LOGs with PLOGs

PLOG automatically appends an error message appropriate
for errno, so use it when logging errors after operations
that would set errno meaningfully.

BUG=None
TEST=None

Change-Id: I63549e149bd699469293e5a7f0e48efa9e388162
Reviewed-on: https://gerrit.chromium.org/gerrit/57213
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
Commit-Queue: Chris Masone <cmasone@chromium.org>

15 months agowarn_collector_test: make it actually work 05/56305/2
Mike Frysinger [Wed, 22 May 2013 21:50:39 +0000 (17:50 -0400)]
warn_collector_test: make it actually work

The warn_collector_test.c wrapper which calls system() assumes that the
return value of system() is the exit code when it's really a wait status.
That means we'd often get back values like 256 which, when masked with
0377, we get back 0 and so this test would always "pass".

Once we fix that, we see that the script has been failing for all boards
other than link because of hardcoded paths in the setup:
warn_collector: error while loading shared libraries: libmetrics.so:
cannot open shared object file: No such file or directory

Analysis of these vars show that we haven't even been testing the local
compiled binary.  Instead, we've been trying to test the one installed
into the $SYSROOT due to the $PATH munging.  I cleaned that up as well
as generally tidied up this test script.

Once we fix that, we then see that the collection doesn't work properly
and fails with:
expected 2 lines in warn-test-log, found this:
6c1b181c

This last bug is due to the regex matching less than was expected:
<PRE_WARN>[^ ]+\n         if (WarnStart()) {  /* yytext is file:line */
But the actual line looks like:
Apr 31 25:25:25 localhost kernel: [117959.231100] WARNING: at /mnt/host/source/src/third_party/kernel/files/drivers/gpu/drm/i915/intel_dp.c:351 intel_dp_check_edp+0x6b/0xb9()

You can see there is a space between the <file> and the <symbol> which
means we pass in to the start function in this (*not* the file:line):
intel_dp_check_edp+0x6b/0xb9()

When the test script runs, it tries to use sed to mung the error message
to get a new file path, but the collector only looks at the func name,
so the calculated hashes continue to match.

We can fix this latter part in two ways: change the test to mung the
func name, or change the lex to pass in the file+func name.  I've gone
the latter route as that seems to have been the intention.

BUG=chromium:217382
TEST=`cros_run_unit_tests --board=x86-alex -p crash-reporter` passes

Change-Id: I5b3490c56280bb5260198af930b6744cea585c46
Reviewed-on: https://gerrit.chromium.org/gerrit/56305
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>

15 months agowarn_collector: handle non-fatal signals 03/56303/2
Mike Frysinger [Wed, 22 May 2013 21:47:49 +0000 (17:47 -0400)]
warn_collector: handle non-fatal signals

If we pause the process (standard SIGSTOP/SIGCONT), the read() on the
inotify handle gets angry and aborts.  This can happen if you ctrl+z
the program, or if you attach to it with strace.  This is undesirable,
so ignore EINTR errors from the read().

BUG=None
TEST=ran `./warn_collector --test` and hit ctrl+z then fg

Change-Id: I49e99abb12ace847e88f973817854d8ba95cf689
Reviewed-on: https://gerrit.chromium.org/gerrit/56303
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>

15 months agoHandle Chrome crashes 72/49972/6
Albert Chaulk [Thu, 2 May 2013 22:38:31 +0000 (15:38 -0700)]
Handle Chrome crashes

Chrome will be modified to pass crashes to crash_reporter via a specially
formatted file, a TLV-style designed to be easily parsed, instead of
multipart/form-data. Extra attributes are added into the .meta file.

BUG=chromium:187808
TEST=new unit tests created

Change-Id: I0d65d118e0e348329d14bb4004c8f7bad5a44a97
Reviewed-on: https://gerrit.chromium.org/gerrit/49972
Reviewed-by: Chris Masone <cmasone@chromium.org>
Commit-Queue: Albert Chaulk <achaulk@chromium.org>
Tested-by: Albert Chaulk <achaulk@chromium.org>
16 months agoHash only warning "file:line" in warning collector. 05/49505/6 factory-4128.B factory-spring-4131.B release-R28-4100.B stabilize-4100.38.B stabilize-spring-4100.53.B toolchainB
Luigi Semenzato [Mon, 29 Apr 2013 19:38:36 +0000 (12:38 -0700)]
Hash only warning "file:line" in warning collector.

Before this change, the signature of a warning is computed from
a string such as this one:

/mnt/host/source/src/third_party/kernel/files/drivers/gpu/drm/i915/intel_dp.c:351 intel_dp_check_edp+0x6b/0xb9()

This change removes all text after the first space, i.e. the function name
and IP offset.  The latter varies across architectures and can vary across
builds, giving different signatures for the same warning.

BUG=chromium:227080
TEST=manual

Change-Id: Ied65dbd8edd734bd152a9dd35aaa48f1e8f1b9e8
Reviewed-on: https://gerrit.chromium.org/gerrit/49505
Commit-Queue: Luigi Semenzato <semenzato@chromium.org>
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
Tested-by: Luigi Semenzato <semenzato@chromium.org>
16 months agoCollect and report kernel warnings. 77/48277/18
Luigi Semenzato [Fri, 12 Apr 2013 00:22:13 +0000 (17:22 -0700)]
Collect and report kernel warnings.

A flex-based daemon collects kernel warnings by parsing /var/log/messages
as lines are added to it.  For every warning the daemon sends a sample
to a sparse UMA histogram using a hash of the warning as the bucket.
Then, if the warning hasn't been seen before, the daemon invokes the
crash collector to upload the warning stack trace.

BUG=chromium:217382
TEST=manually tested (for now), automated test on its way
CQ-DEPEND=Ic8d5773d05d717a275c4a4b5616e0e4c307337b8
CQ-DEPEND=I6a4010acad0ffe20c702bb0fc455e3da7cdf3ac1

Change-Id: I89090e5c2b61ec46b4e740f0895c591728d70e77
Reviewed-on: https://gerrit.chromium.org/gerrit/48277
Commit-Queue: Luigi Semenzato <semenzato@chromium.org>
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
Tested-by: Luigi Semenzato <semenzato@chromium.org>
18 months agoReplace FilePath declaration with file_path.h include 77/43577/3 factory-spring-3842.B firmware-spring-3824.4.B firmware-spring-3824.55.B firmware-spring-3824.84.B firmware-spring-3824.B firmware-spring-3833.B release-R27-3912.B stabilize-3881.0.B stabilize-3912.79.B stabilize-4008.0.B stabilize-4035.0.B stabilize-4068.0.B toolchainA
Simon Que [Wed, 20 Feb 2013 01:19:52 +0000 (17:19 -0800)]
Replace FilePath declaration with file_path.h include

Fixes a clang error.  Also use "base::FilePath" since FilePath has been
moved to the base namespace.

BUG=chromium-os:39046
TEST=The following command passes:
USE="chrome_internal" CFLAGS="-clang -print-cmdline"
CXXFLAGS="-clang -print-cmdline" emerge-x86-alex crash-reporter

Change-Id: I7da82093c5685b5b556cba971b1e1b14ac0f59c4
Signed-off-by: Simon Que <sque@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43577
Reviewed-by: Ben Chan <benchan@chromium.org>
18 months agoupdate to libchrome 180609 78/43378/4
Mike Frysinger [Fri, 15 Feb 2013 03:39:57 +0000 (22:39 -0500)]
update to libchrome 180609

Purely mechanical changes here.

BUG=chromium-os:38933
TEST=`cros_run_unit_tests --board=stumpy -p crash-reporter` passes
CQ-DEPEND=CL:43376

Change-Id: I62d5d12556517bedf48d36ada4c651ff1c671fe9
Reviewed-on: https://gerrit.chromium.org/gerrit/43378
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>

18 months agouse volatile markings in crash test 77/43377/2
Mike Frysinger [Sat, 19 Jan 2013 16:03:37 +0000 (11:03 -0500)]
use volatile markings in crash test

This makes it work with clang (supposedly).

BUG=chromium-os:37965
TEST=`cros_run_unit_tests --board=stumpy -p crash-reporter` passes

Change-Id: I598df1be7c8a38e14cde5f5328a3b6e2e1532ea7
Reviewed-on: https://gerrit.chromium.org/gerrit/43377
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
18 months agocrash-reporter: Updating common.mk to ToT to enable profiling 77/42777/3 release-R26-3701.B stabilize-3701.30.0 stabilize-3701.30.0b stabilize-3701.46.B stabilize-3701.81.B stabilize-bluetooth-smart toolchain-3701.42.B
Ryan Harrison [Wed, 6 Feb 2013 21:33:15 +0000 (16:33 -0500)]
crash-reporter: Updating common.mk to ToT to enable profiling

This update replaces the current common.mk used in this project with the newest
version. This will allow all of the common.mk based projects to be on the same
version for debugging and enables profiling support.

BUG=chromium-os:37854
TEST=Exectuted the following commands to confirm the build works:
     MODE=profiling cros_workon_make --board=link
     MODE=profiling cros_workon_make --board=link --test
     cros_workon_make --board=link
     cros_workon_make --board=link --test
     Repeated these with emerge-link, USE=profiling, and
     FEATURES=test as need.
     For the emerge command with profiling and testing enable, confirmed the
     appropriate coverage files were created in /usr/share/profiling/...

Change-Id: I12fcd4a590994223ddc42cf22670db82e94f0e03
Reviewed-on: https://gerrit.chromium.org/gerrit/42777
Tested-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>

18 months agocrash-reporter: Remove some dependency on /proc 78/34078/5
Michael Krebs [Wed, 26 Sep 2012 01:03:13 +0000 (18:03 -0700)]
crash-reporter: Remove some dependency on /proc

Make the existence of a crashing process's /proc/<PID>/ directory optional
for all of crash_reporter, except for core2md.  In particular, have the
kernel pass the UID of the crashing process to crash_reporter in case the
"status" file is unavailable.

BUG=chromium-os:34385
TEST=Ran unittests and autotests
CQ-DEPEND=I6048d3eb84f8188bee6a755eaa010510f5d2459b

Change-Id: I62df52cab44cf1febc7ed3e55b75bcffa0daf524
Reviewed-on: https://gerrit.chromium.org/gerrit/34078
Commit-Queue: David James <davidjames@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
19 months agoupdate OWNERS 32/41532/2 stabilize-3658.0.0
Mike Frysinger [Thu, 17 Jan 2013 15:57:06 +0000 (10:57 -0500)]
update OWNERS

Mike is taking over for Mike.

BUG=None
TEST=None

Change-Id: I031fd82f7015be19f8232ee77b516699b757cd94
Reviewed-on: https://gerrit.chromium.org/gerrit/41532
Reviewed-by: Ben Chan <benchan@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
19 months agoRevert "crash_sender: Temporary hack to increase MAX_CRASH_RATE to 100 for Link" 63/41363/2
Yufeng Shen [Wed, 16 Jan 2013 18:31:43 +0000 (10:31 -0800)]
Revert "crash_sender: Temporary hack to increase MAX_CRASH_RATE to 100 for Link"

This reverts commit fc5783575be6a6c1c56895ebe99440058ff67fe9

Change-Id: I9034f9b46e20603274d6a7e199665eb0e3dae3fb
Reviewed-on: https://gerrit.chromium.org/gerrit/41363
Commit-Queue: Yufeng Shen <miletus@chromium.org>
Reviewed-by: Yufeng Shen <miletus@chromium.org>
Tested-by: Yufeng Shen <miletus@chromium.org>
19 months agocrash-reporter: Add rule to collect touch event log 25/41325/2
Yufeng Shen [Wed, 16 Jan 2013 00:55:09 +0000 (19:55 -0500)]
crash-reporter: Add rule to collect touch event log

We are having a daemon touch_noise_monitor which periodically dump
touch event logs to /var/log/touch_event.log. Adding this matching
rule to collect the logs.

BUG=chrome-os-partner:17244
TEST=Made fake touch event /var/log/touch_event.log and call
     /sbin/crash_reporter --udev=SUBSYSTEM=TouchEvent to generate
     crash report.

Change-Id: Ic2eaea021a3eef31f48c92688600171db961c09f
Reviewed-on: https://gerrit.chromium.org/gerrit/41325
Reviewed-by: Michael Krebs <mkrebs@chromium.org>
Commit-Queue: Yufeng Shen <miletus@chromium.org>
Tested-by: Yufeng Shen <miletus@chromium.org>
19 months agocrash_sender: Temporary hack to increase MAX_CRASH_RATE to 100 for Link 05/41305/7
Yufeng Shen [Tue, 15 Jan 2013 22:01:36 +0000 (17:01 -0500)]
crash_sender: Temporary hack to increase MAX_CRASH_RATE to 100 for Link

BUG=chrome-os-partner:17244
TEST=On Link
     1) Run crash_sender, see log
2013-01-15T16:10:12.774799-08:00 localhost crash_sender[6163]: MAX_CRASH_RATE set to 100
     2) mv /etc/session_manager_use_flags.txt /etc/session_manager_use_flags.txt.bak
        Run crash_sender
        check log
2013-01-15T16:12:35.718920-08:00 localhost crash_sender[6730]: MAX_CRASH_RATE set to 32

Change-Id: Ib0311be802993206b1a7d55b62399d5c935a656d
Reviewed-on: https://gerrit.chromium.org/gerrit/41305
Reviewed-by: Michael Krebs <mkrebs@chromium.org>
Tested-by: Yufeng Shen <miletus@chromium.org>
Commit-Queue: Yufeng Shen <miletus@chromium.org>

19 months agocrash-reporter: Add rule to collect touch noise logs 14/40014/3 factory-3536.B
Yufeng Shen [Thu, 20 Dec 2012 17:19:55 +0000 (12:19 -0500)]
crash-reporter: Add rule to collect touch noise logs

We are having a daemon touch_noise_monitor which can monitor
raw touch device events and when identifying noise pattern, it
will call crash reporter to upload relevant touch logs. Adding
this matching rule to make this happen.

BUG=chrome-os-partner:16788
TEST=Made fake touch noise happen and check that crash reported
     as reportid c34d76e413aa87ee

Change-Id: I2fa9a32d97a3f31f183623bd44cb3eb8f2436878
Reviewed-on: https://gerrit.chromium.org/gerrit/40014
Commit-Queue: Yufeng Shen <miletus@chromium.org>
Reviewed-by: Yufeng Shen <miletus@chromium.org>
Tested-by: Yufeng Shen <miletus@chromium.org>
20 months agocrash-reporter: Collect i915 error state for chrome crashes 71/39271/2 stabilize2 toolchain-3428.65.B
Michael Krebs [Wed, 5 Dec 2012 23:13:08 +0000 (15:13 -0800)]
crash-reporter: Collect i915 error state for chrome crashes

Add in the i915 error state as a log file in "chrome" crash reports.  "chrome"
isn't normally reported through crash_reporter, so this will only kick in where
a developer has explicitly changed a machine to report them as such.

Because the output can be quite large (as we saw with udev crash reports), the
log is compressed before uploading.  Although the file attached to the crash
report will have a ".log" extension, it will actually have been gzip'ed.

BUG=chromium-os:36979
TEST=Tested same config with "sleep" command:
crash/reportdetail?reportid=f429dbcaee7494be

Change-Id: I618a4364dcdd751852a69a79452272b7cf5e61f8
Reviewed-on: https://gerrit.chromium.org/gerrit/39271
Commit-Ready: Michael Krebs <mkrebs@chromium.org>
Tested-by: Michael Krebs <mkrebs@chromium.org>
Reviewed-by: Stuart Abercrombie <sabercrombie@chromium.org>
21 months agocrash-reporter: Add a new Chrome thread to ignore 73/38673/2
Michael Krebs [Mon, 26 Nov 2012 22:26:17 +0000 (14:26 -0800)]
crash-reporter: Add a new Chrome thread to ignore

A bunch of "supplied_MediaPipeline" crashes are showing up for product
"Chrome_ChromeOS", so add "MediaPipeline" as a thread name to ignore as a
Chrome crash.

BUG=chrome-os-partner:16165
TEST=Ran unittests

Change-Id: Iadcba53400c63b1e7fe93d7f1e74c8dd5c37ebd9
Reviewed-on: https://gerrit.chromium.org/gerrit/38673
Commit-Ready: Michael Krebs <mkrebs@chromium.org>
Tested-by: Michael Krebs <mkrebs@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
21 months agocrash-reporter: Add udev rule to collect cyapa trackpad logs
Yufeng Shen [Mon, 5 Nov 2012 22:06:34 +0000 (17:06 -0500)]
crash-reporter: Add udev rule to collect cyapa trackpad logs

Add the udev rule that when trackpad driver cyapa detects abnormal
behavior and fired uevent, additional logs from system logs are
collected.

BUG=chromium-os:35169
TEST=Made fake cyapa uevent and checked that logs are generated
     in /var/spool/crash

Change-Id: I7ebabd729e6ce362b6f5db12c7cff38ed75c9792
Reviewed-on: https://gerrit.chromium.org/gerrit/37376
Reviewed-by: Michael Krebs <mkrebs@chromium.org>
Commit-Ready: Yufeng Shen <miletus@chromium.org>
Tested-by: Yufeng Shen <miletus@chromium.org>
21 months agoConstruct signature and exec_name from udev rules
Yufeng Shen [Fri, 2 Nov 2012 18:21:21 +0000 (14:21 -0400)]
Construct signature and exec_name from udev rules

Current all udev collected reports have the same signature and
exec_name. This patch makes that different udev rules generate
reports with different signatures and exec_name so that it is
easier to search a specific kind of udev report on crash server.

BUG=chromium-os:35169
TEST=Tested locally, with a fake udev rule
ACTION=="change", SUBSYSTEM=="i2c", DRIVER=="cyapa", ENV{ERROR}=="1", RUN+="/sbin/crash_reporter --udev=SUBSYSTEM=i2c-cyapa:ACTION=change"
and fake crash_reporter_logs.conf entry
crash_reporter-udev-collection-change--i2c-cyapa:grep -C 20 cyapa /var/log/messages
Generate a report log with meta data:
"
sig=crash_reporter-udev-collection-change--i2c-cyapa
exec_name=udev-i2c-cyapa
ver=3120.0.2012_10_31_1248
payload=/var/spool/crash/change__i2c_cyapa.20121102.125731.0.log.gz
payload_size=6557
done=1
"

Change-Id: I9f7905b69e786a2a13cb8a8df46eeba243157009
Reviewed-on: https://gerrit.chromium.org/gerrit/37262
Reviewed-by: Simon Que <sque@chromium.org>
Reviewed-by: Michael Krebs <mkrebs@chromium.org>
Commit-Ready: Yufeng Shen <miletus@chromium.org>
Tested-by: Yufeng Shen <miletus@chromium.org>
21 months agoGet the real extension if log file is gzipped
Yufeng Shen [Thu, 1 Nov 2012 21:25:41 +0000 (17:25 -0400)]
Get the real extension if log file is gzipped

Udev collector compresses crash log and appends .gz as file extension
which is not recognized by crash sender. This patch fixes crash sender
by extracting real file extension if the original log file ends with
.gz.

BUG=chromium-os:35968
TEST=Manually test, crash sender can send udev collector generated
     log file: report id 7fa1184e8e62946f.

Change-Id: Ic0abd9f264ef601399cc5edd27faa6f64cd9f204
Reviewed-on: https://gerrit.chromium.org/gerrit/37136
Reviewed-by: Michael Krebs <mkrebs@chromium.org>
Reviewed-by: Simon Que <sque@chromium.org>
Commit-Ready: Yufeng Shen <miletus@chromium.org>
Tested-by: Yufeng Shen <miletus@chromium.org>
23 months agocrash-reporter: Add "boot_mode" key to crash reports for dev mode factory-2985.B factory-2993.B factory-3004.B
Michael Krebs [Thu, 13 Sep 2012 23:23:11 +0000 (16:23 -0700)]
crash-reporter: Add "boot_mode" key to crash reports for dev mode

For crash reports sent when a machine is in developer mode, annotate them
with a "boot_mode" key set to "dev".  This is so other people know the
system may have been mucked with.

BUG=chromium-os:33947
TEST=Ran logging_CrashSender autotest

Change-Id: I30d58885e41f2c32e32b7b0f691ed2e5d14f2e3c
Reviewed-on: https://gerrit.chromium.org/gerrit/33246
Tested-by: Michael Krebs <mkrebs@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Michael Krebs <mkrebs@chromium.org>

23 months agocrash-reporter: Don't send dmesg output with internal crash_reporter reports factory-2914.B release-R23-2913.B stabilize stabilize-daisy stabilize-link
Michael Krebs [Thu, 13 Sep 2012 03:31:20 +0000 (20:31 -0700)]
crash-reporter: Don't send dmesg output with internal crash_reporter reports

Seeing as kernel crashes no longer include dmesg output, we probably
shouldn't either.  This is for crash reports with signature
"crash_reporter-user-collection".

BUG=chromium-os:34389
TEST=Ran logging_UserCrash autotest
CQ-DEPEND=I813a711c3557227cc17a58be8f960bfe569722bc

Change-Id: I52debf6d8ad32132d3b64c7f313f306b26287dd1
Reviewed-on: https://gerrit.chromium.org/gerrit/33167
Tested-by: Michael Krebs <mkrebs@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Michael Krebs <mkrebs@chromium.org>

23 months agocrash-reporter: Add a missing Chrome thread to ignore
Michael Krebs [Thu, 13 Sep 2012 20:24:12 +0000 (13:24 -0700)]
crash-reporter: Add a missing Chrome thread to ignore

I somehow missed "AudioOutputDevice" as the name of a Chrome thread.  It
showed up in crash reports.

BUG=chrome-os-partner:12045
TEST=Ran unittests

Change-Id: Ia29404aebfe806a81fceb6b45145434af6749822
Reviewed-on: https://gerrit.chromium.org/gerrit/33224
Commit-Ready: Michael Krebs <mkrebs@chromium.org>
Tested-by: Michael Krebs <mkrebs@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
23 months agocrash-reporter: Add "image_type" key to crash reports for dev builds
Michael Krebs [Fri, 7 Sep 2012 02:58:18 +0000 (19:58 -0700)]
crash-reporter: Add "image_type" key to crash reports for dev builds

For crash reports sent from developer images, annotate them with an
"image_type" key set to "dev".  This is so other people know they can be
ignored.  The key will be set to "force-official" if the $FORCE_OFFICIAL
environment variable is set for non-developer images.

BUG=chromium-os:33947
TEST=Ran logging_CrashSender autotest

Change-Id: I9d87bdc7dac1a9fd4898fb3c7fd1c965c81d4ce3
Reviewed-on: https://gerrit.chromium.org/gerrit/32480
Tested-by: Michael Krebs <mkrebs@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Michael Krebs <mkrebs@chromium.org>

2 years agocrash-reporter: Also ignore renamed Chrome threads factory-2846.B factory-2848.B firmware-stout-2817.B
Michael Krebs [Wed, 22 Aug 2012 03:17:03 +0000 (20:17 -0700)]
crash-reporter: Also ignore renamed Chrome threads

At some point Chrome started naming its threads such that crashes report a
different executable name.  We've been getting a *lot* of crash-reporter
errors with names like "supplied_Compositor" in particular, so consider
those to be Chrome crashes that should be ignored.

Unfortunately, the thread names can be arbitrary.  With this CL we check the
entire range of possible names.  Maybe someday someone can use the core file
to determine that a process was originally named "chrome".

BUG=chrome-os-partner:12045
TEST=Ran unittests

Change-Id: Ia82d619bd1ee4367129640dc6c7be5ce258a68bb
Reviewed-on: https://gerrit.chromium.org/gerrit/31084
Commit-Ready: Michael Krebs <mkrebs@chromium.org>
Tested-by: Michael Krebs <mkrebs@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
2 years agofix -I flag paths when building out-of-tree firmware-butterfly-2788.B
Mike Frysinger [Wed, 8 Aug 2012 03:25:10 +0000 (23:25 -0400)]
fix -I flag paths when building out-of-tree

The current build logic assumes the build dir is directly under the
source dir.  This fails if the build and source trees are completely
different paths.  So use a full path to the source dir rather than a
relative one so that it works in all states.

BUG=chromium-os:33327
TEST=`cros_run_unit_tests --board x86-alex -p crash-reporter` still works

Change-Id: I0e6b4c257cbef5879cb67e8692e3082bbb5fb2d5
Reviewed-on: https://gerrit.chromium.org/gerrit/29577
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2 years agoCreate separate udev collector class factory-2569.B factory-2717.B factory-2723.14.B firmware-link-2695.2.B firmware-link-2695.B firmware-parrot-2685.B firmware-snow-2695.90.B firmware-snow-2695.B release-R22-2723.B
Simon Que [Sat, 5 May 2012 01:10:09 +0000 (18:10 -0700)]
Create separate udev collector class

Previously added a udev collector to CrashCollector.  Now it's time to
put it in its own class.

BUG=chromium-os:30268
TEST=See "TEST=" under  https://gerrit.chromium.org/gerrit/21498

Change-Id: I6a62826cb84ef7ccd42a512b00e127af6de3280d
Signed-off-by: Simon Que <sque@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/25112
Reviewed-by: Michael Krebs <mkrebs@chromium.org>
2 years agocrash-reporter: change kDumpFormat to make it compile with gcc 4.7
Yunlian Jiang [Wed, 27 Jun 2012 17:54:41 +0000 (10:54 -0700)]
crash-reporter: change kDumpFormat to make it compile with gcc 4.7

BUG=None
TEST=compile passed

Change-Id: I9de18a4c91048881717731a88b265a09bfb22060
Reviewed-on: https://gerrit.chromium.org/gerrit/21687
Reviewed-by: Michael Krebs <mkrebs@chromium.org>
Tested-by: Yunlian Jiang <yunlian@chromium.org>
Commit-Ready: Yunlian Jiang <yunlian@chromium.org>

2 years agoPut send metrics code into common function
Simon Que [Thu, 28 Jun 2012 00:28:14 +0000 (17:28 -0700)]
Put send metrics code into common function

SendEnumToUMA() and SendCrashToUMA() are being called from three
functions in crash_reporter.cc.  This patch puts the three calls
plus a repeated TODO into one helper function that's called by the
three existing functions.

BUG=chromium-os:11163,chromium-os:30268
TEST=emerge crash-reporter

Change-Id: I703d93e3a072faa0264a220a69df2203af100c57
Signed-off-by: Simon Que <sque@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/26291
Reviewed-by: Ben Chan <benchan@chromium.org>
2 years agocrash collector: compress udev crash logs factory-2268.16.B factory-2305.B factory-2338.B factory-2368.B factory-2394.B factory-2460.B factory-2475.B firmware-link-2348.B release-R20-2268.B release-R21-2465.B
Simon Que [Mon, 30 Apr 2012 22:41:10 +0000 (15:41 -0700)]
crash collector: compress udev crash logs

BUG=chrome-os-partner:6492
TEST=Run:
"crash_reporter --udev=ACTION=change:KERNEL=card0:SUBSYSTEM=drm"
Check that a card0-drm log.gz file has been created under /var/spool/crash
Check that the corresponding .meta file points to the log.gz file.

Change-Id: Id1ecc82b9fac118f8bf1e5edc40c3a2f61abd4c4
Signed-off-by: Simon Que <sque@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/21495
Reviewed-by: Ben Chan <benchan@chromium.org>
2 years agocrash-reporter: Re-enable CollectBadDirectory unittest
Sergiu Iordache [Fri, 5 Aug 2011 22:32:15 +0000 (15:32 -0700)]
crash-reporter: Re-enable CollectBadDirectory unittest

The KernelCollectorTest.CollectBadDirectory unittest was first re-enabled by
sergiu@ in https://gerrit.chromium.org/gerrit/5433, but it broke the
buildbots and had to be re-disabled.  So I'm trying again, but this time I
have the power of trybots!  I also added code to output the log if it fails
again.

BUG=chromium-os:18622
TEST=Ran unittests.  Ran trybots on: alex-paladin, amd64-generic-paladin,
arm-tegra2-paladin, lumpy-paladin, stumpy-paladin.

Change-Id: Ib7fa1c1a32e9c198db9bdae8f933c9dd9fc3381a
Reviewed-on: https://gerrit.chromium.org/gerrit/20667
Tested-by: Michael Krebs <mkrebs@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Michael Krebs <mkrebs@chromium.org>

2 years agocrash-reporter: Move disabling of GCC warning into source file
Michael Krebs [Wed, 18 Apr 2012 19:34:13 +0000 (12:34 -0700)]
crash-reporter: Move disabling of GCC warning into source file

Rather than disable the "format not a string literal, argument types not
checked" warning for the entire kernel_collector.cc file, only disable it
for the code in question.

BUG=chromium-os:27127
TEST=Ran unittests

Change-Id: Id85e7945779cd5d1b6a3b68cfdedae53b3f22c74
Reviewed-on: https://gerrit.chromium.org/gerrit/20484
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Michael Krebs <mkrebs@chromium.org>
Tested-by: Michael Krebs <mkrebs@chromium.org>
2 years agocrash-reporter: Convert Makefile over to using common.mk
Michael Krebs [Thu, 12 Apr 2012 23:20:51 +0000 (16:20 -0700)]
crash-reporter: Convert Makefile over to using common.mk

This will allow running of unittests on ARM, as well as cleaning up the make
output some.

BUG=chromium-os:27127
TEST=Ran unittests, logging_CrashSender, and logging_UserCrash

Change-Id: Ide09a42132be0843146dde6687e4424352b6b866
Reviewed-on: https://gerrit.chromium.org/gerrit/20174
Tested-by: Michael Krebs <mkrebs@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Michael Krebs <mkrebs@chromium.org>

2 years agocrash-reporter: Fix unclean_shutdown_collector_test to work by itself
Michael Krebs [Thu, 12 Apr 2012 22:24:22 +0000 (15:24 -0700)]
crash-reporter: Fix unclean_shutdown_collector_test to work by itself

The CantDisable test was failing because it couldn't properly fake the
enabling of the crash collector -- which meant that the disable didn't
actually fail.  The reason was that the "test" directory was being removed
during SetUp().  I also added/improved some error-checking that helped me
track down various unittest failures.

BUG=chromium-os:29395
TEST=Ran unittests

Change-Id: I8cf50dbd0d5187b0028c8cf16ae10a4f68bb160f
Reviewed-on: https://gerrit.chromium.org/gerrit/20129
Commit-Ready: Michael Krebs <mkrebs@chromium.org>
Tested-by: Michael Krebs <mkrebs@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
2 years agoupdate to newer libbase
Mike Frysinger [Wed, 11 Apr 2012 18:47:09 +0000 (14:47 -0400)]
update to newer libbase

BUG=chromium-os:25872
TEST=`emerge-x86-alex crash-reporter` works
TEST=`cros_run_unit_tests --board=x86-alex -p crash-reporter` passed

Change-Id: Iff428b1364f96533d2d2290272823c2c84c48933
Reviewed-on: https://gerrit.chromium.org/gerrit/20008
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2 years agoAdd udev event-based crash reporting
Simon Que [Tue, 10 Apr 2012 02:07:07 +0000 (19:07 -0700)]
Add udev event-based crash reporting

This allows crash_reporter to handle nonfatal errors from the kernel
passed thru udev events.  There is a udev .rules file for invoking crash
reporter.  Currently it supports DRM error info logging.

BUG=chrome-os-partner:6492
TEST=Run:
"crash_reporter --udev=ACTION=change:KERNEL=card0:SUBSYSTEM=drm"
Check that a card0-drm log file has been created under /var/spool/crash

Change-Id: I05a1d508e5446988575b0c1924878b8e36ae46bb
Signed-off-by: Simon Que <sque@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/10618

2 years agocrash-reporter: Send "error_type" field for crash-reporter errors
Michael Krebs [Thu, 5 Apr 2012 03:14:11 +0000 (20:14 -0700)]
crash-reporter: Send "error_type" field for crash-reporter errors

If the "error_type" field was set by crash_reporter (see benchan@'s
https://gerrit.chromium.org/gerrit/17166), then send it with the crash
report.  This currently only affects crashes with the
"crash_reporter-user-collection" error signature.

BUG=chromium-os:7871
TEST=Manually ran crash_sender

Change-Id: I34c5e055efb407d57a3f83b07e8d4fc0a6b8fac1
Reviewed-on: https://gerrit.chromium.org/gerrit/19641
Tested-by: Michael Krebs <mkrebs@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Michael Krebs <mkrebs@chromium.org>

2 years ago[crash-reporter] add OWNERS
Elly Jones [Fri, 6 Apr 2012 18:18:15 +0000 (14:18 -0400)]
[crash-reporter] add OWNERS

TEST=None
BUG=chromium-os:22007

Change-Id: I96e3743c5428ecb4fe628dfad1862659ddbd9570
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/19763
Reviewed-by: Ben Chan <benchan@chromium.org>
2 years agoBetter support 64bit x86 kernel crashes.
Bryan Freed [Tue, 3 Apr 2012 00:05:48 +0000 (17:05 -0700)]
Better support 64bit x86 kernel crashes.

FindCrashingFunction() fails to find the crashing kernel function because
the x86 64bit kernel code (arch/x86/kernel/dumpstack.c:die()) issues "RIP"
instead of "EIP".  So it falls back to using the panic string in the crash
signature.

This causes the logging_KernelCrash.py test to fail because it looks for the
crashing function in the signature string.

BUG=chromium-os:22353
TEST=logging_KernelCrash

Change-Id: Ic4790648facf5f0be2b82001f8e18b606eca16c7
Reviewed-on: https://gerrit.chromium.org/gerrit/19492
Reviewed-by: Ben Chan <benchan@chromium.org>
Tested-by: Bryan Freed <bfreed@chromium.org>
Commit-Ready: Bryan Freed <bfreed@chromium.org>

2 years agoUpdate crash_reporter_logs.conf to collect log files for cros-installer. factory-1987.B
Ben Chan [Wed, 14 Mar 2012 23:51:01 +0000 (16:51 -0700)]
Update crash_reporter_logs.conf to collect log files for cros-installer.

BUG=chromium-os:27821
TEST=emerge crash-reporter and verified the updated crash_reporter_logs.conf is installed.

Change-Id: Id2b7de30b36eaa57e6251261d8bca6810d5e8b82
Reviewed-on: https://gerrit.chromium.org/gerrit/18181
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Reviewed-by: Michael Krebs <mkrebs@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Ben Chan <benchan@chromium.org>

2 years agoclean up makefile and convert to SLOT-ed libbase
Mike Frysinger [Fri, 9 Mar 2012 19:06:24 +0000 (14:06 -0500)]
clean up makefile and convert to SLOT-ed libbase

This includes a couple of fixes:
 - use the right compiler flag names
 - execute pkg-config twice total, and not once per compile
 - build against SLOT-ed libbase

BUG=chromium-os:16623
TEST=`emerge-x86-alex crash-reporter` still works
TEST=`cros_run_unit_tests --board x86-alex -p crash-reporter` passes

Change-Id: I76fdf552de1c0e10367475f3ad22b6b0b33bfa66
Reviewed-on: https://gerrit.chromium.org/gerrit/17709
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
2 years agoImprove error diagnostics in UserCollector.
Ben Chan [Wed, 29 Feb 2012 20:10:44 +0000 (12:10 -0800)]
Improve error diagnostics in UserCollector.

This CL makes the following changes to improve error diagnostics in
UserCollector:
1. Add an error type to describe why the crash reporter fails to
   collects a user crash, which is reported to the crash server along
   with the "crash_reporter-user-collection" error signature.
2. Perform some preliminary validations of the core file before
   converting it to a minidump file using core2md.
3. Identify the case when a 32-bit core file is produced on a 64-bit
   platform as core2md currently cannot handle 32-bit core files on
   a 64-bit platform.

BUG=chromium-os:7871
TEST=Tested the following:
1. emerge-{x86,amd64,arm}-generic crash-reporter
2. FEATURES="test" emerge-{x86,amd64,arm}-generic crash-reporter
3. Run the following autotest tests on x86-mario and stumpy64:
   - logging_CrashSender
   - logging_UserCrash

Change-Id: Ib50b4cc81a91f7cd75f9440005200d4027ce1f6f
Reviewed-on: https://gerrit.chromium.org/gerrit/17166
Reviewed-by: Michael Krebs <mkrebs@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Ben Chan <benchan@chromium.org>

2 years agoFix KernelCollector code and unit tests.
Ben Chan [Thu, 1 Mar 2012 06:26:54 +0000 (22:26 -0800)]
Fix KernelCollector code and unit tests.

This CL fixes the KernelCollectorTest.LoadPreservedDump test due to
KernelCollector::records_ not being initialized. It also updates
KernelCollectorTest.CollectPreservedFileMissing and
KernelCollectorTest.CollectNoCrash.

BUG=chromium-os:27126
TEST=Tested the following:
1. emerge-{x86,amd64,arm}-generic crash-reporter
2. FEATURES="test" emerge-{x86,amd64,arm}-generic crash-reporter

Change-Id: If5a773fa77a2e66e539d204410140d1b4e66d062
Reviewed-on: https://gerrit.chromium.org/gerrit/17125
Reviewed-by: Kees Cook <keescook@chromium.org>
Commit-Ready: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
2 years agoRemove collected crash report from pstore
Kees Cook [Thu, 23 Feb 2012 01:15:15 +0000 (17:15 -0800)]
Remove collected crash report from pstore

Make sure that once collected, a crash report is removed from the pstore
filesystem so that the memory is cleared to avoid endless crash
duplicates.

BUG=chromium-os:26496
TEST=lumpy build & boot, triggered crashes ("echo bug > /proc/breakme") are
 saved to /var/spool/crash and removed from pstore.
STATUS=Fixed

Change-Id: Ic224f5880cdc34d1f75470ac71f27fcad146ff4b
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/16501
Reviewed-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Bryan Freed <bfreed@chromium.org>
2 years ago[crash-reporter] Move flag files to /var/run from /tmp
Chris Masone [Fri, 24 Feb 2012 22:38:57 +0000 (14:38 -0800)]
[crash-reporter] Move flag files to /var/run from /tmp

The kernel-crash-detected and unclean-shutdown-detected flag files
needed to move out of /tmp to protect against symlink attacks by
a non-root user.  /var/run is owned by root, so non-privileged
users can't write there.

BUG=chromium-os:17085
TEST=unit
TEST=logging_CrashSender,logging_UserCrash
STATUS=Fixed

Change-Id: Ibf9b314f1a03ee984eea2acf6007c120aa300dd1
Reviewed-on: https://gerrit.chromium.org/gerrit/16751
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Commit-Ready: Chris Masone <cmasone@chromium.org>

2 years ago[crash-reporter] drop unused crontab fragment
Mike Frysinger [Mon, 6 Feb 2012 21:47:56 +0000 (16:47 -0500)]
[crash-reporter] drop unused crontab fragment

The ebuild no longer installs this, so punt it.

BUG=chromium-os:25750
TEST=`emerge crash-reporter` still works

Change-Id: I94416b44ee87cc282a80128f5a3b2f190a191184
Reviewed-on: https://gerrit.chromium.org/gerrit/15402
Reviewed-by: Scott James Remnant <keybuk@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2 years ago[crash-reporter] use libchromeos.pc release-R18-1660.B
Elly Jones [Wed, 11 Jan 2012 20:33:28 +0000 (15:33 -0500)]
[crash-reporter] use libchromeos.pc

BUG=chromium-os:24959
TEST=build

Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/13997
Reviewed-by: Mike Frysinger <vapier@chromium.org>
(cherry picked from commit 6f7fb4aea569bb597c94194be1ad611b37ffcf40)

Change-Id: I75ea31a75d2e67facc2a38a9aabda2ae81b702a6
Reviewed-on: https://gerrit.chromium.org/gerrit/14406
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Elly Jones <ellyjones@chromium.org>
Tested-by: Elly Jones <ellyjones@chromium.org>
2 years agoRevert "[crash-reporter] use libchromeos.pc"
Scott James Remnant [Fri, 13 Jan 2012 01:59:03 +0000 (17:59 -0800)]
Revert "[crash-reporter] use libchromeos.pc"

This reverts commit 490634ffaefa3b3b93c623e376674ab5cd3763c8

Change-Id: I593c57ccd527d1294439ec730c3b805862fefd70
Reviewed-on: https://gerrit.chromium.org/gerrit/14122
Reviewed-by: Scott James Remnant <keybuk@chromium.org>
Tested-by: Scott James Remnant <keybuk@chromium.org>
2 years ago[crash-reporter] use libchromeos.pc
Elly Jones [Wed, 11 Jan 2012 20:33:28 +0000 (15:33 -0500)]
[crash-reporter] use libchromeos.pc

BUG=chromium-os:24959
TEST=build

Change-Id: I62d6e1f19b429c59f07a06372412b360713a16ef
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/13997
Reviewed-by: Mike Frysinger <vapier@chromium.org>
2 years agocrash-reporter: Read core from stdin even if proc files are unsuable.
Ben Chan [Mon, 9 Jan 2012 18:29:58 +0000 (10:29 -0800)]
crash-reporter: Read core from stdin even if proc files are unsuable.

This CL fixes commit c7c7914f49fbdef0d1f06c13854daabe176621ed such that
UserCollector continues to read the core file from stdin even if the proc
files are unusable.

BUG=chromium-os:24820
TEST=Tested the following:
1. Build crash-reporter and run unit tests.
2. Run the following autotest tests on a Cr48:
   - logging_CrashSender
   - logging_UserCrash

Change-Id: I04d09b15a80344b47f0512196c40e94384c5c323
Reviewed-on: https://gerrit.chromium.org/gerrit/13872
Reviewed-by: Ken Mixter <kmixter@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Ben Chan <benchan@chromium.org>

2 years agocrash-reporter: Validate proc files and log the state of crashed process.
Ben Chan [Fri, 6 Jan 2012 16:22:07 +0000 (08:22 -0800)]
crash-reporter: Validate proc files and log the state of crashed process.

This CL makes the following changes to UserCollector:
1. Check if the maps file is empty after copying proc files to the
   temporary container directory, which prevents the core-to-minidump
   conversion failure due to unusable maps file.
2. Obtain and log the state of the crashed process, which helps
   determine if the crashed process is in the zombie state.
3. Refactor the status file processing code.

BUG=chromium-os:24820
TEST=Tested the following:
1. Build crash-reporter and run unit tests.
2. Run the following autotest tests on a Cr48:
   - logging_CrashSender
   - logging_UserCrash
3. Check that the process state of a crashed process is logged in
   /var/log/messages.

Change-Id: Iebaf9c36c18185c703c18e7028ee4673dd9ebc93
Reviewed-on: https://gerrit.chromium.org/gerrit/13826
Reviewed-by: Ken Mixter <kmixter@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Ben Chan <benchan@chromium.org>

2 years agoUse hung thread stack for watchdog panics.
Luigi Semenzato [Thu, 29 Dec 2011 21:18:35 +0000 (13:18 -0800)]
Use hung thread stack for watchdog panics.

With this change the crash reporter tries to determine if the last stack
dump in the log file is from the hung thread watchdog, and in that case
creates a crash signature that's based on the previous stack dump.

When the previous stack is used because the watchdog function was detected,
prepend "(HANG)" to the function name or kernel message in the signature.

Also use an earlier stack signature if all functions in the last one are
uncertain.  This happens in many cases (about 1/2).  It's likely a
bug in the kernel but until we fix it this workaround will be helpful.

I tested this manually with the --generate_kernel_signature flag and
with the provided unit test.  I also added two unit tests for the two
new cases.  Finally, I tried to run the KernelCrashServer autotests,
but it doesn't run correctly in developer mode, even before my change.

BUG=chromium-os:24632
TEST=manually tested, unit tested, and autotested.  No further tests required.

Change-Id: Ib65177b06c207675cb7f6e33f1df8fa79dde6090
Reviewed-on: https://gerrit.chromium.org/gerrit/13541
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
Tested-by: Luigi Semenzato <semenzato@chromium.org>
Commit-Ready: Luigi Semenzato <semenzato@chromium.org>

2 years agocrash-reporter: Change layout for the container directory of procfs files.
Ben Chan [Thu, 5 Jan 2012 04:40:15 +0000 (20:40 -0800)]
crash-reporter: Change layout for the container directory of procfs files.

This CL modifies UserCollector to copy procfs files of a crashed process
into /tmp/crash_reporter/<pid> instead of /tmp/crash_reporter.<pid>.
The new directory layout makes it easier for autotest to archive
leftover files under /tmp/crash_reporter due to core2md failures.

BUG=chromium-os:24646
TEST=Tested the following:
1. Build crash-reporter and run unit tests.
2. Run the following autotest tests on a Cr48:
   - logging_CrashSender
   - logging_UserCrash

Change-Id: I435374eabc1574216881318ddacdfa9d1648c875
Reviewed-on: https://gerrit.chromium.org/gerrit/13697
Commit-Ready: Ben Chan <benchan@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
2 years agocrash-reporter: always write kernel crashes for dev builds factory-1412.B release-R17-1412.B
Ken Mixter [Tue, 25 Oct 2011 02:15:05 +0000 (02:15 +0000)]
crash-reporter: always write kernel crashes for dev builds

Added check for devloper build. Always write kernel crash files when
running devloper builds.

BUG=None
TEST=run "echo bug > /proc/breakme" and ensure the kcrash files get
created under /var/spool/crash

Change-Id: Iced35df9db1f997c41138f082ee50a3506a88eb2
Reviewed-on: https://gerrit.chromium.org/gerrit/10615
Reviewed-by: Sameer Nanda <snanda@chromium.org>
Tested-by: Sameer Nanda <snanda@chromium.org>
2 years agoSwitch away from /dev/mem to new ramoops pstore interface
Kees Cook [Fri, 4 Nov 2011 20:49:09 +0000 (20:49 +0000)]
Switch away from /dev/mem to new ramoops pstore interface

Use the new ramoops pstore interface instead of reading /dev/mem or
needing to know anything about the ramoops memory configurations.

BUG=chromium-os:12059
TEST=x86-alex build and boot, logging_KernelCrashServer passes,
  local "make tests" passes.

Change-Id: Ie713d4f93df7f666537c7181b1b438d7b85d4861
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/11245
Reviewed-by: Will Drewry <wad@chromium.org>
2 years agoRevert "crash-reporter: Activate updated BadDirectory test" factory-1235.B factory-1284.B firmware-kiev-2.112.B firmware-uboot_v2-1299.B release-R16-1193.B
Michael Krebs [Tue, 27 Sep 2011 03:04:04 +0000 (20:04 -0700)]
Revert "crash-reporter: Activate updated BadDirectory test"

This reverts commit 4a029228b93edcd9cf79c2578acd27eb56be5bce

Although this passes in my local checkout, it broke the buildbots.  Will investigate more.

Change-Id: Ib6e33bb916b43b1a42f8f8e4c0c69eb360c3181c
Reviewed-on: http://gerrit.chromium.org/gerrit/8332
Reviewed-by: Michael Krebs <mkrebs@chromium.org>
Tested-by: Michael Krebs <mkrebs@chromium.org>
2 years agocrash-reporter: Activate updated BadDirectory test
Sergiu Iordache [Fri, 5 Aug 2011 22:32:15 +0000 (15:32 -0700)]
crash-reporter: Activate updated BadDirectory test

Activated the BadDirectory test which was breaking the build.

BUG=chromium-os:18622
TEST=Ran the unit tests locally and it succeded.

Change-Id: I439d9fb40ec37261ef839c82817d6bc67e683c7d
Signed-off-by: Sergiu Iordache <sergiu@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/5433
Reviewed-by: Ken Mixter <kmixter@chromium.org>
Tested-by: Michael Krebs <mkrebs@chromium.org>
2 years agotouch up 64bit build cleanliness
Mike Frysinger [Wed, 21 Sep 2011 16:41:29 +0000 (12:41 -0400)]
touch up 64bit build cleanliness

Some of the types being used happened to work on 32bit systems because
size_t is pretty much an unsigned int.  But with a 64bit system, we see:

kernel_collector.cc: In member function
  'virtual bool KernelCollector::LoadParameters()':
kernel_collector.cc:141: error: cannot convert 'size_t*' to 'unsigned int*'
  for argument '2' to 'bool LoadValue(FilePath, unsigned int*)'

This is easy to fix by using the correct type in LoadValue().

Next up, we get a failure due to the assumption that int64 can be
displayed using the lld format string.  But on 64bit systems, this
doesn't work:

crash_collector.cc: In member function
  'void CrashCollector::WriteCrashMetaData(const FilePath&, const std::string&, const std::string&)':
crash_collector.cc:355: error:
  format '%lld' expects type 'long long int', but argument 6 has type 'int64'

This takes a little bit more magic to make work.  Since printf itself
does not provide a printf string to handle "64bit" types, use the macros
that POSIX provides in inttypes.h.  The printf string is a little uglier,
but now should work for all targets.

BUG=chromium-os:20636
TEST=`emerge-amd64-generic crash-reporter` now works
TEST=`emerge-x86-generic crash-reporter` still works
TEST=build+booting x86-alex still works

Change-Id: I8401f2ad932223085dfbe54541590e9b65297783
Reviewed-on: http://gerrit.chromium.org/gerrit/8051
Reviewed-by: Ken Mixter <kmixter@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Michael Krebs <mkrebs@chromium.org>
2 years agoAdd HWID information for ARM via crossystem
Katie Roberts-Hoffman [Tue, 20 Sep 2011 16:53:02 +0000 (09:53 -0700)]
Add HWID information for ARM via crossystem

Added HWID query via crossystem if not available via ACPI. This populates
the hwclass field for crash reports.

BUG=None
TEST=Manually confirmed ARM platform crash reports contains correct hwclass
and manually confirmed ZGB report contains previously reported hwclas

Change-Id: I1216ed13c0b04d829313103d3bb736f5227a772b
Reviewed-on: http://gerrit.chromium.org/gerrit/7982
Reviewed-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Micah Catlin <micahc@chromium.org>
Commit-Ready: Katie Roberts-Hoffman <katierh@chromium.org>
Tested-by: Katie Roberts-Hoffman <katierh@chromium.org>
3 years agocrash-reporter: Update crash-reporter to work with ramoops factory-1020.B factory-980.B release-1011.B test-982.B
Sergiu Iordache [Wed, 3 Aug 2011 23:11:36 +0000 (16:11 -0700)]
crash-reporter: Update crash-reporter to work with ramoops

The old crash reporter used preserved to get the memory dump. Updated it
to use the upstream ramoops module. Also updated the unit tests.

Depends on other patches related to this bug report:
The backport series starting with:
http://gerrit.chromium.org/gerrit/#change,5342 until 5347 (included)
The series starting with: http://gerrit.chromium.org/gerrit/#change,5426
until 5429 (included)
http://gerrit.chromium.org/gerrit/#change,5159

BUG=chromium-os:12059
TEST=Ran module unit tests, ran logging_KernelCrashServer and
platform_KernelErrorPaths, checked manually that the
crash file existed.

Change-Id: I37bdb30513acfab79997e478af5de35ca33557fd
Signed-off-by: Sergiu Iordache <sergiu@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/5432
Reviewed-by: Ken Mixter <kmixter@chromium.org>
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-by: Michael Krebs <mkrebs@chromium.org>
3 years agocrash-reporter: Dump crashes outside of cryptohome during autotests. 0.15.877.B firmware-881-u-boot-v1 firmware-u-boot-v1
Michael Krebs [Fri, 5 Aug 2011 20:54:52 +0000 (13:54 -0700)]
crash-reporter: Dump crashes outside of cryptohome during autotests.

If the file "/mnt/stateful_partition/etc/collect_chrome_crashes" exists on
the target, dump crashes to /var/spool/crash/ instead of
/home/chronos/user/crash/.  This is so they are easily available even after
logout.

BUG=chromium-os:18637
TEST=Ran unit and remote tests.

Change-Id: I340bbb0c1772123192c8bb87872bcda53fae5524
Reviewed-on: http://gerrit.chromium.org/gerrit/5419
Reviewed-by: Ken Mixter <kmixter@chromium.org>
Tested-by: Michael Krebs <mkrebs@chromium.org>
3 years agocrash-reporter: disable CollectBadDirectory
Elly Jones [Wed, 3 Aug 2011 15:30:11 +0000 (11:30 -0400)]
crash-reporter: disable CollectBadDirectory

Treecloser filed as crosbug.com/18622; temporarily disabling this test to reopen
the tree.

BUG=chromium-os:18622
TEST=Not anymore

Change-Id: I4b7467f6044e02ab1308f449d5aa530a15535933
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/5214
Reviewed-by: Chris Masone <cmasone@chromium.org>
3 years agoDon't ignore chrome crashes when autotesting.
Michael Krebs [Wed, 27 Jul 2011 21:13:22 +0000 (14:13 -0700)]
Don't ignore chrome crashes when autotesting.

If the file "/mnt/stateful_partition/etc/collect_chrome_crashes" exists on
the target, allow chrome crashes to be reported by crash reporter.  The
intention is that the autotest system will create this file.  This is a
relatively temporary fix to help track down chrome problems, until the
crashes can be handled by crash reporter in the field as well.

BUG=chromium-os:17987, chromium-os:17898
TEST=Ran unit tests.

Change-Id: I68a584a0b861669117d8e97f5687b4c8fc876011
Reviewed-on: http://gerrit.chromium.org/gerrit/4861
Reviewed-by: Ken Mixter <kmixter@chromium.org>
Tested-by: Ken Mixter <kmixter@chromium.org>
3 years ago[crash-reporter] bad merge broke the build 0.13.558.B 0.13.587.B 0.14.811.B 780.B
Chris Masone [Sat, 14 May 2011 18:44:04 +0000 (11:44 -0700)]
[crash-reporter] bad merge broke the build

BUG=chromium-os:14304
TEST=build, features-test

Change-Id: I9c2c77c818b9277c506d5186d42677069b1f0704
Reviewed-on: http://gerrit.chromium.org/gerrit/905
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
3 years ago[crash-reporter] rolling to libchrome 87480
Chris Masone [Fri, 13 May 2011 23:57:09 +0000 (16:57 -0700)]
[crash-reporter] rolling to libchrome 87480

BUG=chromium-os:14304
TEST=emerge with features=test

Change-Id: Ida7067b3578619bbb99c8b5c626fd6301cdccd8d
Reviewed-on: http://gerrit.chromium.org/gerrit/887
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
3 years agocrash-reporter: Make use of list_proxies to send crashes via a proxy when appropriate 0.12.433.B 0.12.433.B109 0.12.433.B62 0.13.434.B 0.13.509.B
Michael Krebs [Sat, 16 Apr 2011 04:20:19 +0000 (21:20 -0700)]
crash-reporter: Make use of list_proxies to send crashes via a proxy when appropriate

BUG=chromium-os:6828
TEST=Manually ran crash_sender to make sure it would run curl with appropriate --proxy option.  Manually ran curl using proxies from "http://proxyconfig.corp.google.com/wpad.dat".  Ran a modified crash_sender manually to make sure it passed the appropriate "--proxy" arguments correctly.

Review URL: http://codereview.chromium.org/6802003

Change-Id: Ie1414fca1a7dbc265d8aad0eea32a736a5d30d54

3 years agocrash-reporter: Create a list_proxies command
Michael Krebs [Sat, 16 Apr 2011 00:18:27 +0000 (17:18 -0700)]
crash-reporter: Create a list_proxies command

Create a list_proxies command to be used by crash_sender to determine the correct proxy for a URL.  This uses D-Bus to get them from either the browser or the session manager.

BUG=chromium-os:6828
TEST=Ran list_proxies command manually to test response for various URLs: "http://...", "https://...", empty/NULL, and invalid (eg. just "blah.com").  Also did this for the various proxy settings in the browser: direct, manual proxy configuration, and automatic proxy configuration.  Ran list_proxies command using invalid D-Bus method name for proxy_resolver.StartMonitoring() to make sure timeout works.  Ran a modified crash_sender manually to make sure it passed the appropriate "--proxy" arguments correctly.

Review URL: http://codereview.chromium.org/6730021

Change-Id: I738a4544f90218ffc7c2d36547de49b462ca749e

3 years agoRevert "Revert "crash-reporter: Don't send ps command lines with crash reporter"" 0.12.392.B
Michael Krebs [Thu, 7 Apr 2011 21:42:14 +0000 (14:42 -0700)]
Revert "Revert "crash-reporter: Don't send ps command lines with crash reporter""

This reverts commit 59d8695734dac2ce70b17d2a58049083e65e997d.

My original commit did not actually break anything, so this just puts it back.

BUG=chromium-os:13576
TEST=unit tests, logging_{UserCrash,CrashSender} autotests

Review URL: http://codereview.chromium.org/6765017

Change-Id: I5b9ebb2b210b86fb4efaf49c71dcd2562805c973

3 years agoStrip MAC addresses from dmesg sent w/ kcrash files.
Doug Anderson [Thu, 7 Apr 2011 16:40:05 +0000 (09:40 -0700)]
Strip MAC addresses from dmesg sent w/ kcrash files.

BUG=chromium-os:13579
TEST=Ran the kernel_collector_test

rm -f /build/x86-mario/tmp/portage/chromeos-base/crash-reporter-9999/.tested; cros_workon_make --test --board=x86-mario crash-reporter

[ RUN      ] KernelCollectorTest.StripSensitiveDataBasic
[       OK ] KernelCollectorTest.StripSensitiveDataBasic (1 ms)
[ RUN      ] KernelCollectorTest.StripSensitiveDataBulk
[       OK ] KernelCollectorTest.StripSensitiveDataBulk (2 ms)
[ RUN      ] KernelCollectorTest.StripSensitiveDataSample
[       OK ] KernelCollectorTest.StripSensitiveDataSample (0 ms)

Review URL: http://codereview.chromium.org/6777001

Change-Id: Ie2cd3d007f9ee2fb877d28280cfe62748c108bd2

3 years agoAdd ARM support
Simon Glass [Wed, 6 Apr 2011 17:47:01 +0000 (10:47 -0700)]
Add ARM support

Adds support for scanning ARM backtraces so that kernel crash reporting
can work on ARM.

BUG=chromium-os:12454
TEST=cat /sys/kernel/debug/preserved/kcrash > x
crash_reporter -generate_kernel_signature x
Verify that it finds a backtrace properly.

FEATURES=test emerge-x86-mario crash-reporter
- check all tests pass (this will run both ARM and X86 tests)

Change-Id: I4dc6d7a2bae53d05883da9425ec8e9ac4a5c2bba

Review URL: http://codereview.chromium.org/6599022

3 years agoRevert "crash-reporter: Don't send ps command lines with crash reporter" 0.12.362.B 0.12.369.B
Michael Krebs [Mon, 28 Mar 2011 20:41:07 +0000 (13:41 -0700)]
Revert "crash-reporter: Don't send ps command lines with crash reporter"

This reverts commit 78599c9f195a9c324d2b0eb5a048b677e6a4229c.

BUG=chromium-os:13576
TEST=

Review URL: http://codereview.chromium.org/6765002

Change-Id: I2c110e13199cc6d3741fa030065dbb405c2a049a

3 years agocrash-reporter: Don't send ps command lines with crash reporter
Michael Krebs [Fri, 25 Mar 2011 22:27:12 +0000 (15:27 -0700)]
crash-reporter: Don't send ps command lines with crash reporter

When unable to generate a crash, don't show the commands' arguments with
'ps' because they may contain PII.

Change-Id: I1e2f40e59535f4de08f43012727ab8e92bad8a0d

BUG=chromium-os:13206
TEST=unit tests, logging_UserCrash autotest

Review URL: http://codereview.chromium.org/6722017

3 years agocrash-reporter: keep ignoring chrome crashes even on dev builds
Ken Mixter [Wed, 16 Mar 2011 19:47:20 +0000 (12:47 -0700)]
crash-reporter: keep ignoring chrome crashes even on dev builds

Change-Id: Idd8859958e626dc782e511f35fca5d45a2977f53

BUG=chromium-os:12911
TEST=unit tests and UserCrash

Review URL: http://codereview.chromium.org/6673002

3 years agoModify crash-reporter to collect crash information for unofficial builds. 0.11.241.B 0.11.257.B 0.11.257.B90 11.1.241.B
Thieu Le [Thu, 3 Mar 2011 20:14:43 +0000 (12:14 -0800)]
Modify crash-reporter to collect crash information for unofficial builds.

The original code review link is here: http://codereview.chromium.org/6559003/

BUG=chromium-os:12207
TESTS=logging_UserCrash, logging_CrashSender, manual test which involves
purposely crashing a test to determine if minidump information is properly collected

Change-Id: I20274050cd698434951c65612e246f510c8082cb

TEST=

Review URL: http://codereview.chromium.org/6615021

3 years agocrash-reporter: Use standard logging and new libchromeos Process code
Ken Mixter [Thu, 3 Mar 2011 16:47:38 +0000 (08:47 -0800)]
crash-reporter: Use standard logging and new libchromeos Process code

Change-Id: Ie085d61d4d79c0df38e51debaa044d701a860c89

BUG=none
TEST=unit tests / UserCrash / CrashSender

Review URL: http://codereview.chromium.org/6517001

3 years agoRevert "Modify crash-reporter to collect crash information for unofficial builds."
Thieu Le [Mon, 28 Feb 2011 20:02:59 +0000 (12:02 -0800)]
Revert "Modify crash-reporter to collect crash information for unofficial builds."

This reverts commit cb5a147e46dbfa454df9d56b4da23480742597c8.

BUG=None
TEST=

Review URL: http://codereview.chromium.org/6596045

Change-Id: If07530a743b19a76e9a15ef08825c45c38f9dd2b

3 years agoModify crash-reporter to collect crash information for unofficial builds.
Thieu Le [Mon, 28 Feb 2011 18:51:18 +0000 (10:51 -0800)]
Modify crash-reporter to collect crash information for unofficial builds.

BUG=chromium-os:12207
TESTS=logging_UserCrash, logging_CrashSender, manual test which involves
purposely crashing a test to determine if minidump information is properly
collected

Change-Id: Id2195125289a695515b1722442116d6a6d9c4895

Review URL: http://codereview.chromium.org/6559003

3 years agocrash-reporter: when exe symlink read fails send diags and still ignore chrome crashes
Ken Mixter [Thu, 10 Feb 2011 02:23:00 +0000 (18:23 -0800)]
crash-reporter: when exe symlink read fails send diags and still ignore chrome crashes

Change-Id: I0f43d5f61936ebb6420c357e58df45761facd4d0

BUG=6299
TEST=unit tests and UserCrash/CrashSender

Review URL: http://codereview.chromium.org/6480009

3 years agocrash-reporter: Add diagnostics to help diagnose failures in the wild
Ken Mixter [Tue, 25 Jan 2011 21:33:05 +0000 (13:33 -0800)]
crash-reporter: Add diagnostics to help diagnose failures in the wild

We add logging messages that are generated during invocation of core2md, but we also enable sending arbitrary system info based on the configuration file.  In this case we add the list of running processes, meminfo, and dmesg.

Change-Id: Ifdf29b89dd60d56349fa39095d2aa07f6b5e2de2

BUG=chromium-os:6299,chromium-os:9345
TEST=UserCrash, unit tests

Review URL: http://codereview.chromium.org/6297004

3 years agocrash-reporter: Send systemwide stability information up to Chrome
Ken Mixter [Sat, 22 Jan 2011 14:16:40 +0000 (06:16 -0800)]
crash-reporter: Send systemwide stability information up to Chrome

Change-Id: Idcb3dff3b98951b41a55b9f48968c3608b44efae

BUG=9352
TEST=
1) UserCrash
2) Crash random process and verify Chrome indicates "other user" crashes
occurred in its stability UMA data.

Review URL: http://codereview.chromium.org/6138005

3 years agoChange path from /home/autotest to /usr/local/autotest.
Dale Curtis [Mon, 10 Jan 2011 19:49:50 +0000 (11:49 -0800)]
Change path from /home/autotest to /usr/local/autotest.

Additional change for the relocation of Autotest from /home/autotest to /usr/local/autotest. See http://codereview.chromium.org/6090004/

Change-Id: I2995fdc76f56d4efbb6450d4a7da3adc321eae91

BUG=chromium-os:10799
TEST=Will test as whole with rest of /usr/local changes.

Review URL: http://codereview.chromium.org/5964016

3 years agocrash-reporter: Capture and send recent update_engine logs when it crashes
Ken Mixter [Wed, 15 Dec 2010 01:44:11 +0000 (17:44 -0800)]
crash-reporter: Capture and send recent update_engine logs when it crashes

We also disallow more than 4 nested crashes.  This way we know if core2md crashes for instance, but not if crash_reporter crashes while handling the core2md crash that came from crash_reporter.  Note that the kernel does not know about parent/child process relationships, it just counts concurrent handling, so it is possible that some of many crashing processes will be discarded.

See crash report id 473c22ed428d33a9 for an example report with update_engine logs.

Change-Id: I9ff9f03a94dc87d2d42840511c2e5e42ee37cea8

BUG=9176
TEST=UserCrash,CrashSender,unit tests

Review URL: http://codereview.chromium.org/5814001

3 years agoCollect suspend and resume info from power manager
Simon Que [Wed, 1 Dec 2010 01:10:54 +0000 (17:10 -0800)]
Collect suspend and resume info from power manager

Updated the unclean shutdown collector to check and report the
modification times of trace files left by power manager to indicate that
the system was suspended and that it was running on low battery.

These files are interpreted by the unclean shutdown collector to
determine the cause of an unclean shutdown -- either the battery ran
out during suspend or the battery ran out after resuming from a low
battery-induced suspend and it continued to run on battery.

BUG=chromium-os:1472
TEST=Let the battery run below the cutoff, suspend & resume, and then
remove the battery to simulate running dry; check crash reporter
logs.  Alternatively/additionally, let it suspend and remove the battery
while suspended.  Restart and check crash reporter logs.

Signed-off-by: Simon Que <sque@chromium.org>
Change-Id: I8e6767e8457afb7abf1e7300eac020adda1ebb48

Review URL: http://codereview.chromium.org/3644007

3 years agocrash-reporter: use HTTPS when sending crashes
Ken Mixter [Fri, 19 Nov 2010 01:29:32 +0000 (17:29 -0800)]
crash-reporter: use HTTPS when sending crashes

Change-Id: Ibca5616ba449dd1f96ae418a46b372d1a2f55412

BUG=9352
TEST=manual update and User/CrashSender

Review URL: http://codereview.chromium.org/5092009