Commit graph

86 commits

Author SHA1 Message Date
Michael Krebs
7672bfb67e 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>
2012-04-16 14:57:56 -07:00
Michael Krebs
87a495030d 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>
2012-04-12 19:19:02 -07:00
Mike Frysinger
57b261cf04 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>
2012-04-12 11:25:29 -07:00
Simon Que
f70060c5e6 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
2012-04-11 19:00:42 -07:00
Michael Krebs
e1b21e95d3 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>
2012-04-11 12:57:51 -07:00
Elly Jones
fff57dbc2e [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>
2012-04-06 12:47:17 -07:00
Bryan Freed
b87375957e 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>
2012-04-03 17:47:37 -07:00
Ben Chan
557bf456f7 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>
2012-03-15 07:32:31 -07:00
Mike Frysinger
c55dbfd6d8 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>
2012-03-09 13:47:35 -08:00
Ben Chan
6e709a1103 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>
2012-03-05 17:14:29 -08:00
Ben Chan
2076b9011d 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>
2012-03-01 09:09:59 -08:00
Kees Cook
5825d5a642 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>
2012-02-27 12:11:45 -08:00
Chris Masone
d3ac79663f [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>
2012-02-24 15:15:58 -08:00
Mike Frysinger
4b37d0ed65 [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>
2012-02-07 19:54:13 -08:00
Elly Jones
91ad60a7fc [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>
2012-01-19 11:37:29 -08:00
Scott James Remnant
b3121a7b7a 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>
2012-01-12 18:01:08 -08:00
Elly Jones
758e16615a [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>
2012-01-12 12:26:56 -08:00
Ben Chan
ec7d7835a2 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>
2012-01-09 12:37:03 -08:00
Ben Chan
f13bb58358 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>
2012-01-06 15:25:29 -08:00
Luigi Semenzato
f640099ceb 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>
2012-01-06 14:57:32 -08:00
Ben Chan
294d5d1eee 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>
2012-01-05 13:17:10 -08:00
Ken Mixter
9ee1f5f034 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>
2011-11-17 15:19:02 -08:00
Kees Cook
ce9556e1c4 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>
2011-11-15 16:20:03 -08:00
Michael Krebs
b1ac89bb1f 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>
2011-09-26 20:05:40 -07:00
Sergiu Iordache
ae33866aea 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>
2011-09-26 15:48:35 -07:00
Mike Frysinger
65b4c1efb0 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>
2011-09-22 10:11:49 -07:00
Katie Roberts-Hoffman
e2c1b17904 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>
2011-09-21 14:07:56 -07:00
Sergiu Iordache
1ea8abecd3 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>
2011-09-01 16:42:15 -07:00
Michael Krebs
4fe30db140 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>
2011-08-08 14:50:01 -07:00
Elly Jones
4bd4da26d3 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>
2011-08-03 08:34:17 -07:00
Michael Krebs
538ecbf7d5 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>
2011-07-29 12:19:16 -07:00
Chris Masone
8a68c7cb30 [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>
2011-05-14 11:44:55 -07:00
Chris Masone
3ba6c5b657 [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>
2011-05-14 11:10:51 -07:00
Michael Krebs
543eee323d 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
2011-04-15 21:20:19 -07:00
Michael Krebs
57a942f516 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
2011-04-15 17:18:27 -07:00
Michael Krebs
c046f57ef3 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
2011-04-07 14:42:14 -07:00
Doug Anderson
1e6b8bdbba 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
2011-04-07 09:40:05 -07:00
Simon Glass
d74cc09bbd 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
2011-04-06 10:47:01 -07:00
Michael Krebs
c7dcf3f52c 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
2011-03-28 13:41:07 -07:00
Michael Krebs
ec951c7613 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
2011-03-25 15:27:12 -07:00
Ken Mixter
5d3a1a2c35 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
2011-03-16 12:47:20 -07:00
Thieu Le
1652fb2cc2 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
2011-03-03 12:14:43 -08:00
Ken Mixter
a324932e06 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
2011-03-03 08:47:38 -08:00
Thieu Le
f92f4caa84 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
2011-02-28 12:02:59 -08:00
Thieu Le
604f5c0d3d 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
2011-02-28 10:51:18 -08:00
Ken Mixter
d49d362f61 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
2011-02-09 18:23:00 -08:00
Ken Mixter
1b8fe01558 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
2011-01-25 13:33:05 -08:00
Ken Mixter
1d3c304083 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
2011-01-22 06:16:40 -08:00
Dale Curtis
c4e01cc146 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
2011-01-10 11:49:50 -08:00
Ken Mixter
c49dbd4775 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
2010-12-14 17:44:11 -08:00