Commit graph

245 commits

Author SHA1 Message Date
Steve Fung
33046dcbfa Merge "crash_reporter: Ensure crash_sender spread time is not negative" 2015-09-15 01:06:09 +00:00
Steve Fung
18ca9b364b crash_reporter: Ensure crash_sender spread time is not negative
When calculating the crash_sender spread time, make sure that the
random number is not negative when converted to a shell int variable.

Bug: 24004011
Change-Id: I3b95dc244a26270ef2b93d5af4b0593a93eedcad
2015-09-14 22:18:24 +00:00
Steve Fung
758db4dbe7 Merge "crash_reporter: Read crash server from property" 2015-09-14 22:06:19 +00:00
Steve Fung
44aec5f4af crash_reporter: Read crash server from property
Read the crash server URL from the crash_reporter.server
property.  If it is not set, return a configuration error.

Bug: 22874192
Change-Id: Iac341b6352fe9c1b54cd2e8561ed4a5bbe8ddddc
2015-09-14 20:50:33 +00:00
Steve Fung
4a1bc3824e crash_reporter: Fix a couple crash_sender issues
- Added grep to the list of required modules.
- Run crash_sender with the 'system' group to allow calls to
  metrics_client to read both metrics files owned by system and
  crash_reporter files owned by root.
- Fix periodic_scheduler's check delay to actually be 5 minutes.

Bug: 23122375
Change-Id: Iff214c4e591a676a516162a92ea5aedcf0824f46
2015-09-14 03:08:27 -07:00
Steve Fung
0e8746d895 crash_reporter: Fix crash_sender
- Remove all the ChromeOS specific logic.
- Fix paths to correct Android paths.
- Add periodic_scheduler, and add crash_sender to init.

Bug: 23231196
Bug: 23233267

Change-Id: I12de28bfbe5d5b08831eda9b28c6d7a669c22290
2015-09-09 17:06:33 -07:00
Steve Fung
6e68dd72c7 crash_reporter: Call dbus-send using chromeos::ProcessImpl
Convert the call to dbus-send from system() to chromeos::ProcessImpl
so that the shell_exec selinux policy can be removed.

Bug: 23280203
Change-Id: I692ebecf5b7f0611de252225cedabcdefd56dff8
2015-09-02 12:29:22 -07:00
Steve Fung
b440e50b6f crash_reporter: Run with supplemental groups
In order to use metrics_lib, crash_reporter needs to be run with
system group permissions.  To use dbus, it needs dbus group
permissions.

Bug: 23406290
Change-Id: Ic679a057afa46aaadd59429aab0aea072c1973c5
2015-08-24 23:56:07 -07:00
Steve Fung
f87f5f90c5 Merge "crash_reporter: Fix tmp directory location" 2015-08-24 03:26:21 +00:00
Steve Fung
ea1e07e940 Merge "crash_reporter: Relicense as Apache 2." 2015-08-24 01:03:14 +00:00
Steve Fung
da98133cc0 crash_reporter: Fix tmp directory location
It is unsafe to use /data/local/tmp.  Use our own temporary
directory under /data/misc/crash_reporter.

Bug: 23430484
Change-Id: I186ba6b146bd884064177a3bb29b18b8edcc0b62
2015-08-23 17:57:19 -07:00
Steve Fung
2e2dc00399 Merge "crash_reporter: Fix path to dbus-send" 2015-08-21 23:23:34 +00:00
Steve Fung
8b8878a7d1 crash_reporter: Fix path to dbus-send
Bug: 22486906
Change-Id: If70b387bf95709719bb781719e7d0c195385be78
2015-08-21 02:17:01 -07:00
Steve Fung
6c34c2576e crash_reporter: Relicense as Apache 2.
MODULE_LICENSE_BSD and NOTICE were removed as the license is no longer
different from the rest of system/core.

Bug: 23368756
Change-Id: I31e48eb7c3d153c7c5ec4f694c61474dedac2eeb
2015-08-20 18:54:43 +00:00
Steve Fung
f085a1f6b3 crash_reporter: Add Android.mk
This builds:
* crash_reporter: Client for collecting crash data.
* crash_sender: Installs the script for sending crash reports to the server.
* warn_collector: Flex client for monitoring /var/log/messages for kernel
  warnings.
* init.crash_reporter.rc: Init script for setting up crash reporting.
* crash_reporter_logs.conf: Conf file for handling core dumps.
* Unit tests for the different crash collectors.  These currently build, but
  not all of them pass as the crash reporter client isn't properly configured
  yet.

Bug: 22486906
Change-Id: I9337a566f35955d1d41ae94d535eb9e9730bbeb1
2015-08-19 18:34:57 -07:00
Steve Fung
ab2ac7d114 crash_reporter: Enable core dumps
Fix various path/directory locations to their Android equivalents
to enable collection of core dumps and generation of mini dumps
to work correctly.  Also add the init script to initialize
crash_reporter.

Bug: 22874832
Change-Id: Iffb1529e5259c5da5ba7f6977b2787e738f68a78
2015-08-18 23:38:27 -07:00
Steve Fung
8bafb3da8f crash_reporter: Fix initial compile issues with Android toolchain
Fix some issues to get crash_reporter to compile on Android.

C++ source:
* bits/wordsize.h is used for __WORDSIZE, but is unavailable for most
  Android toolchain architectures.  It instead is available in sys/cdefs.h

Flex source:
* The Flex compiler toolchain doesn't link against the default fl library
  using -lfl.  Thus there is no yywrap() function defined.  Since the
  default fl library implementation just returns 1 (true), instead add a
  directive to disable yywrap.
* The index(..) function has been deprecated in favor of strchr(..)
* Add a directive to disable the "deprecated conversion from string constant
  to 'char*'" warning in the generated code.
* Remove warning suppression for the input() function which doesn't get
  generated with Flex v2.5.39 and the arguments passed in the build command.

Bug: 22874187
Change-Id: I6d7dcf5f801010aeae06db9f0628a6652ee269ee
2015-08-10 15:10:32 -07:00
Steve Fung
c8b741428c crash_reporter: Remove Chrome collector, CrOS build files, DBus
Removed the ChromeOS specific code so that the code compiles.  The code
removed is not needed when running on Android, and includes:
* Chrome collector
* ChromeOS build's gyp file
* ChromeOS-specific DBus calls
* ChromeOS-specific collector path logic
* Chrome bypass logic in user collector

Bug: 22672752
Change-Id: I3c7d87c971a181d8f73293519318e3602d142927
2015-08-10 15:10:22 -07:00
Steve Fung
129bea543b crash_reporter: Fix header include paths
Fix the header include paths to be relative to the crash_reporter
base folder.

Bug: 22873331
Change-Id: Icdd0495a79cd7679f38c54a84e189bfb3c9d7f1c
2015-08-10 01:38:56 -07:00
Bertrand SIMONNET
45f59d634d crash_reporter: Add license information.
The license file was taken from the original repository at:
https://chromium.googlesource.com/chromiumos/platform2/+/master/LICENSE

Change-Id: I05a8284346ceb326fb80c692e24653bc446cc33d
2015-07-28 17:31:05 -07:00
Christopher Wiley
c686fd3cbd Remove superfluous legacy DBus includes
This header pulls in glib dependencies which aren't used in these
codebases.

BUG=chromium:508218
TEST=trybots

Change-Id: Iecf8dfcdd8064b1feb694382eea55c3f0df572d3
Reviewed-on: https://chromium-review.googlesource.com/284053
Tested-by: Christopher Wiley <wiley@chromium.org>
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Christopher Wiley <wiley@chromium.org>
Trybot-Ready: Christopher Wiley <wiley@chromium.org>
2015-07-14 18:19:44 +00:00
Dan Colish
8a59e11e33 crash: do not call list-proxies if it does not exist.
Additionally, this adds logging for list-proxies call failures.

BUG=chromium:396033
TEST=unittests, test_that logging_UserCrash

CQ-DEPEND=CL:275076

Change-Id: I0515e75476bdc7a0ace8ebc8318e82c337a87374
Reviewed-on: https://chromium-review.googlesource.com/275077
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Daniel Colish <colish@chromium.org>
Tested-by: Daniel Colish <colish@chromium.org>
2015-06-04 19:33:14 +00:00
Chris Masone
f3caa5a236 crash: Point to canonical org.chromium.SessionManagerInterface.xml
The session_manager already had a fully-specified .xml file
describing its DBus API, so toss the one created for use
by crash-reporter.gyp, and point the build to the canonical one.

BUG=None
TEST=build crash-reporter and run unit tests

Change-Id: Id14e1a5a3a2aa7be3caee309c04d85078e43a315
Reviewed-on: https://chromium-review.googlesource.com/267726
Trybot-Ready: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Steve Fung <stevefung@chromium.org>
Commit-Queue: Chris Masone <cmasone@chromium.org>
2015-04-29 00:21:31 +00:00
Ben Chan
f17a8387d4 crash: update OWNERS file
BUG=None
TEST=None

Change-Id: I5a43ab1aa1eda040ed58aea4f593ccca9bba128d
Reviewed-on: https://chromium-review.googlesource.com/267127
Commit-Queue: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
2015-04-27 23:29:42 +00:00
Alex Vakulenko
92c0eefe42 platform2: Explicitly use base:: namespace with CommandLine
The current revision of libchrome is removing CommandLine class
from global namespace and only retain the one in base::.

Sweep the code to use the correct namespace in anticpation of
libchrome revision roll.

BUG=None
TEST=./build_packages

Change-Id: Ib7ca448dac1204c1e36ab053e775a5a5214997ac
Reviewed-on: https://chromium-review.googlesource.com/263785
Trybot-Ready: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
2015-04-03 18:33:17 +00:00
Peter Qiu
6aa551ec41 crash-reporter: add support for device coredump
Copy the device coredump file to /var/spool/crash directory when
udev event "devcoredump" is detected. Also include the last 50 lines
of /var/log/messages and /var/log/net.log in the coredump file for
debugging purpose. Only perform the collection if feedback is allowed
(metrics are enabled) or the device is running a developer image.

By default, crash-reporter will not upload device coredumps to the crash
server. The user can enable device coredumps upload via a to-be-added
crosh command, which should only be done at the direction of CrOS engineers.

BUG=chromium:464872
TEST=USE="asan clang" FEATURES=test emerge-$BOARD crash-reporter
Manual Test:
1. Trigger wifi firmware error on a Clapper running developer image by
   running following command:
   "echo 1 > /sys/kernel/debug/iwlwifi/0000\:01\:00.0/iwlmvm/fw_restart"
2. Verify there is a device coredump file in "/var/spool/crash/"
   "devcoredump_iwlwifi*.devcore", as well as the additional log file
   ".log" and the meta file ".meta".

Change-Id: Ic4cf67d4b5715a6f422505f409276d1261b7d51f
Reviewed-on: https://chromium-review.googlesource.com/257091
Reviewed-by: Zeping Qiu <zqiu@chromium.org>
Commit-Queue: Zeping Qiu <zqiu@chromium.org>
Tested-by: Zeping Qiu <zqiu@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
2015-04-01 19:37:06 +00:00
Mike Frysinger
7458089196 delete __STDC_{FORMAT,LIMIT}_MACROS
With newer glibc versions (2.18+), these macros no longer exist (and the
functionality they protected are always enabled).  Delete them.

BUG=chromium:401360
TEST=precq passes

Change-Id: I21b0607a874b9f9e39dff050054a2928a6c55023
Reviewed-on: https://chromium-review.googlesource.com/262903
Trybot-Ready: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2015-03-29 10:02:23 +00:00
Steve Fung
040dffdb3e crash: Convert list_proxies to chromeos-dbus-bindings generator
Switch list_proxies to using chromeos-dbus-bindings generator
in order to remove the glib dependency.

BUG=brillo:89
TEST=`FEATURES=test emerge-panther crash-reporter`
TEST=manually tested `list_proxies --quiet      \
       https://clieents2.google.com/cr/report`

Change-Id: Ic52277b2e14514376f4d55e627e1651d9ef566c5
Reviewed-on: https://chromium-review.googlesource.com/248781
Reviewed-by: Dan Erat <derat@chromium.org>
Trybot-Ready: Dan Erat <derat@chromium.org>
Commit-Queue: Steve Fung <stevefung@chromium.org>
Tested-by: Steve Fung <stevefung@chromium.org>
2015-02-18 23:53:21 +00:00
Steve Fung
f5767af079 crash: Fix session manager D-Bus call service name
The D-Bus call to session manager was using the incorrect service
name field, causing the crash reporter session lookup to fail and
fallback to placing the crash in /home/chronos/crash.  Fix the
D-Bus call so that crashes are put in the right place.

Also, fixing this exposed an error with processing the results.
The previous D-Bus code treated an empty session response the
same as a D-Bus connection error, with the new code D-Bus errors
are handled separately, so also check whether the returned array
is empty.

BUG=chromium:458330
TEST=triggered crash with 'chrome://crash' page; crash files are
     placed in /home/chronos/user/crash
TEST=`test_that -b panther <IP> logging_UserCrash` passes

Change-Id: I77733adc5e4287d9eae83a749818d9cc38398c80
Reviewed-on: https://chromium-review.googlesource.com/249800
Reviewed-by: Dan Erat <derat@chromium.org>
Tested-by: Steve Fung <stevefung@chromium.org>
Commit-Queue: Steve Fung <stevefung@chromium.org>
2015-02-16 08:43:56 +00:00
Steve Fung
6e13952269 crash: Remove glib from crash_reporter
As part of the minimization effort, refactor crash_reporter code to
not depend directly on glib.

BUG=brillo:87, brillo:88, chromium:435314
TEST=`FEATURES=test emerge-panther libchromeos debugd crash-reporter`
TEST=Enabled crash reports; Browsed to chrome://crash; crash files \
     generated; `FORCE_OFFICIAL=1 SECONDS_SEND_SPREAD=1 crash_sender` \
     /var/log/messages shows crash id, report shows all expected files
TEST=`cbuildbot --remote -p chromiumos/platform2 amd64-generic-full`
CQ-DEPEND=I00331e0bf29195b41cd84d4495ab47738a5a41de
CQ-DEPEND=I9df752d8995773adb56fab34dd97626f3ddf1765

Change-Id: I48b366198a7f89ca55259603cf8470e4d59321bf
Reviewed-on: https://chromium-review.googlesource.com/246441
Reviewed-by: Dan Erat <derat@chromium.org>
Tested-by: Steve Fung <stevefung@chromium.org>
Commit-Queue: Steve Fung <stevefung@chromium.org>
2015-02-11 04:48:44 +00:00
Daniel Erat
efa91c05b1 crash: Shorten crash-reporter project alias.
Add a .project_alias file so that crash reporter changes
can/must be prefixed with "crash: " rather than
"crash-reporter: ".

BUG=none
TEST=uploaded this change

Change-Id: Iea849873cb061650909eecdc911d8805f17bc4c5
Reviewed-on: https://chromium-review.googlesource.com/244240
Reviewed-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Commit-Queue: Dan Erat <derat@chromium.org>
Tested-by: Dan Erat <derat@chromium.org>
2015-01-30 05:10:46 +00:00
Daniel Erat
731da3379b crash-reporter: Use chromeos::KeyValueStore.
Make the crash reporter use libchromeos's KeyValueStore
class to read its log-collection config file and
/etc/lsb-release instead of its own parsing code.

Also update the log-collection config file to split long
commands across multiple lines and to use '=' instead of ':'
to separate executable names from commands.

BUG=chromium:452520
TEST=updated tests; also triggered powerd and chrome crashes
     and checked that logs were attached

Change-Id: I4e2447712869608f32a4ae38f5d5cb9c6046af14
Reviewed-on: https://chromium-review.googlesource.com/244121
Reviewed-by: Dan Erat <derat@chromium.org>
Commit-Queue: Dan Erat <derat@chromium.org>
Tested-by: Dan Erat <derat@chromium.org>
2015-01-29 21:35:39 +00:00
Daniel Erat
d257ea1cbe crash-reporter: Clean up testing code.
Link all of the crash reporter's tests into a single
crash_reporter_test executable instead of building separate
binaries that lead to a bunch of duplication.

BUG=none
TEST=tests pass
CQ-DEPEND=I7f6623dd0ae36395efac89bdcfae54926ea6c918

Change-Id: I18e2d929d6545e7d05e88232bdaec089ae620544
Reviewed-on: https://chromium-review.googlesource.com/243940
Reviewed-by: Dan Erat <derat@chromium.org>
Commit-Queue: Dan Erat <derat@chromium.org>
Trybot-Ready: Dan Erat <derat@chromium.org>
Tested-by: Dan Erat <derat@chromium.org>
2015-01-29 03:48:19 +00:00
Daniel Erat
7e3b76d81f crash-reporter: Add session_manager logs to Chrome crashes.
Attach the last twenty session_manager messages from
/var/log/messages to Chrome crash reports.

BUG=chromium:233833
TEST=manual: triggered a crash and checked chrome.txt in the
     crash report (1f8c6ff259947e7a)

Change-Id: I733b448ccc6e01111556a5a632e185cc58dfd917
Reviewed-on: https://chromium-review.googlesource.com/243378
Tested-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
Commit-Queue: Dan Erat <derat@chromium.org>
2015-01-28 08:01:31 +00:00
Daniel Erat
8f5546adf9 crash-reporter: Attach Chrome logs to crash reports.
When Chrome crashes, gather the last 20 lines of each of the
latest two log files in /var/log/chrome and
/home/chronos/user/log. Attach them as gzipped metadata
using a "chrome.txt" key name and rename the GPU error state
key to "i915_error_state.log.xz".

(Re-landing after privacy review; originally reviewed at
https://chromium-review.googlesource.com/216427. Changes
since previous iteration include attaching the Chrome logs
and the GPU state separately and redirecting stderr to
/dev/null when listing user Chrome log files to avoid log
spam in the not-logged-in case.)

BUG=chromium:405732
TEST=triggered crashes and verified that logs were included
     in crash reports: b7c4d7f2bee32e2f, 6292f090468fcf28
CQ-DEPEND=CL:242492

Change-Id: I1642a8971f1373726e5b0e3977dbfdbcc2aa6667
Reviewed-on: https://chromium-review.googlesource.com/242457
Commit-Queue: Dan Erat <derat@chromium.org>
Trybot-Ready: Dan Erat <derat@chromium.org>
Tested-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
2015-01-24 17:00:50 +00:00
Ben Zhang
1c5533d4cd crash-reporter: add a sanity check for kernel dmesg records
On some devices, after a cold boot, a junk pstore record
/dev/pstore/dmesg-ramoops-0 is created which is just a chunk
of uninitialized memory containing random bits, and it's not
the result of a kernel crash.

The sanity check scans for the dmesg log level pattern to
avoid creating junk .kcrash files.

BUG=chromium:443764
TEST=platform_KernelErrorPaths with 3.8 and 3.14 kernel;
check no kcrash file is created for random binary ramoops dump
on stumpy.

Change-Id: I83041436cd8e5e0c7c0015c529f462032ce82f30
Signed-off-by: Ben Zhang <benzh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/242147
Reviewed-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Grant Grundler <grundler@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
2015-01-22 05:13:33 +00:00
Alex Vakulenko
859ee45cd2 Update libchrome to r307740 and fix build errors
Updated libchrome, libchrome_crypto, metrics, feedback to the
latest revisions from Chrome (r307740).

Fixed build breaks due to the changes in upstream code:

- scope_ptr no longer needs explicit PassAs<T>() calls.
- scope_ptr<T> no longer has implicit conversion to T*.
  Must use scope_ptr<T>::get() instead.
- base/file_util.h moved to base/files/file_util.h
- ARRAYSIZE_UNSAFE() removed in favor of arraysize()
- base::AppendToFile() and base::WriteFileDescriptor() now
  return bool instead of the number of bytes written.
- dbus::Bus::AddFilterFunction() now returns void.
- C++11 features are enabled in libchromeos, so all targets
  linking with it now have to support C++11
- OVERRIDE macro is removed in favor of native C++11
  'override' keyword.

BUG=chromium:416628, chromium:411508
TEST=Build the world on x86, x64, ARM. The following builders
     were tried:
       x86-generic-full amd64-generic-full arm-generic-full
       amd64-generic-asan daisy-full nyan-full pre-cq-group
       daisy-release-group sandybridge-release-group
       pineview-release-group
CQ-DEPEND=CL:234450,CL:234980

Change-Id: I374bebe2211d533c4431c82efb8be1cdcb1f405d
Reviewed-on: https://chromium-review.googlesource.com/234440
Reviewed-by: Bertrand Simonnet <bsimonnet@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
2014-12-15 07:18:09 +00:00
Kees Cook
554c898d6a crash-reporter: disable device coredumps in verified mode
Device coredumps should only be available in developer mode.

BUG=None
TEST=link boot with devcoredump series

Signed-off-by: Kees Cook <keescook@chromium.org>
Change-Id: Ia86c32310887199b268b1f71221c6eb8a02f7827
Reviewed-on: https://chromium-review.googlesource.com/231386
Reviewed-by: Mike Frysinger <vapier@chromium.org>
2014-11-26 06:07:52 +00:00
Ben Zhang
8e5340a1d8 crash-reporter: accept kernel dmesg records with no ramoops header
pstore compression has been added since kernel 3.12. In order to
decompress dmesg correctly, ramoops driver has to strip the header
before handing over the record to the pstore driver, so we don't
need to do it in KernelCollector anymore.

The corresponding kernel patch is at
https://chromium-review.googlesource.com/#/c/211389

BUG=chromium:392248
TEST=platform_KernelErrorPaths passed on 3.14 kernel

Change-Id: If1bec43e640e0978c7573cc90befc6d68072373c
Signed-off-by: Ben Zhang <benzh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/211460
Reviewed-by: Kees Cook <keescook@chromium.org>
2014-11-06 02:28:25 +00:00
Steve Fung
d6169a2a4f crash-reporter: remove gflags dependency
We are switching to using chromeos/flag_helper.h instead to standardize the
code everywhere.

BUG=chromium:402631
TEST=`FEATURES=test emerge-panther crash-reporter`
TEST=`test_that -b panther <ip> e:logging_.*`

Change-Id: I62b911a54f89d853235d0540460cbea119f66e9e
Reviewed-on: https://chromium-review.googlesource.com/212140
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Steve Fung <stevefung@chromium.org>
Commit-Queue: Steve Fung <stevefung@chromium.org>
2014-10-07 05:53:25 +00:00
Mike Frysinger
6f891c5b3f crash-reporter: fix pstore detection
The current Enable logic looks for an existing crash rather than the
crash dir itself, so when we boot up clean we get a warning that we
do not support kernel crashes.

BUG=chromium:417350
TEST=`FEATURES=test emerge-link crash-reporter` passes
TEST=`cbuildbot amd64-generic-full` passes
TEST=booted VM and checked syslogs

Change-Id: I076a37889ea10ed30ae522eba007619b001ec787
Reviewed-on: https://chromium-review.googlesource.com/219751
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
2014-09-25 10:45:28 +00:00
Ben Chan
c764139936 crash-reporter: Clean up angle brackets in template types.
C++11 no longer has the angle bracket pitfall in template types.

BUG=None
TEST=`FEATURES=test emerge-$BOARD crash-reporter`

Change-Id: I25410c458f730d8e0a38237b3711439262a1b774
Reviewed-on: https://chromium-review.googlesource.com/219194
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
2014-09-22 05:59:28 +00:00
Mike Frysinger
f27140dd07 crash-reporter: log notification for chrome crashes
The standard crash collector logs a warning message every time it receives
a crash which makes reviewing system logs nice.  The chrome collector does
not do this which makes it a bit harder to track what the system is doing.
Add such a message to the chrome collector too.

BUG=chromium:415220
TEST=`cbuildbot amd64-generic-full` passes

Change-Id: I2b4c9990d99b780ed06d72be40b6ce5b95c1ee51
Reviewed-on: https://chromium-review.googlesource.com/218593
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
2014-09-19 02:59:42 +00:00
Ben Chan
262d798b38 crash-reporter: Replace NULL with nullptr.
BUG=None
TEST=`FEATURES=test emerge-$BOARD crash-reporter`

Change-Id: If0804613ee0385752d01f7bbe01902ffef53bd94
Reviewed-on: https://chromium-review.googlesource.com/218870
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
2014-09-19 02:59:36 +00:00
Daniel Erat
732bd3bb85 Revert "crash-reporter: Attach Chrome logs to crash reports."
I'm reverting this until I get a privacy review.

BUG=chromium:405732
TEST=none

Change-Id: Ib3af4752533f76c340d9b853be985bfc774104da
Reviewed-on: https://chromium-review.googlesource.com/218010
Reviewed-by: Daniel Erat <derat@chromium.org>
Commit-Queue: Daniel Erat <derat@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
2014-09-13 01:18:55 +00:00
Daniel Erat
55cb40aa95 crash-reporter: Attach Chrome logs to crash reports.
When Chrome crashes, gather the last 20 lines of each of the
latest two log files in /var/log/chrome and
/home/chronos/user/log and include them in the archive file
that's attached to crash reports.

BUG=chromium:405732
TEST=triggered crashes at the login screen and after logging
     in and verified that logs were included in crash
     reports: bdf766f0d6d1e066, a9d410e1a86f996b

Change-Id: I09e3cee23af108dc216d64aae85d78751d5649d4
Reviewed-on: https://chromium-review.googlesource.com/216427
Reviewed-by: Ben Chan <benchan@chromium.org>
Tested-by: Daniel Erat <derat@chromium.org>
Commit-Queue: Daniel Erat <derat@chromium.org>
2014-09-12 03:40:34 +00:00
Benjamin Lerman
c8cb4ac7ba Revert "crash-reporter: Replace the crash_sender script by a service daemon."
This reverts commit 38c5ad3a94762945456f8e25c78f464d9221bb84.

Was think it will go to the CQ.

Change-Id: Icbe21da107375b0975f6328623fd9cdd38f71b09
Reviewed-on: https://chromium-review.googlesource.com/217740
Reviewed-by: Benjamin Lerman <qsr@chromium.org>
Tested-by: Benjamin Lerman <qsr@chromium.org>
2014-09-11 12:44:16 +00:00
Benjamin Lerman
8e774579a0 crash-reporter: Replace the crash_sender script by a service daemon.
BUG=chromium:391887
TEST=Integration tests
CQ-DEPEND=I02ce7593fcfae4ba1d7d3ebdf3912901e635f1c9
CQ-DEPEND=I00315ad47657cebd9e8a4a0121ecb54114a7e200

Change-Id: I2f4546c82fb3769b5f3da5d22949551412096b10
Reviewed-on: https://chromium-review.googlesource.com/208671
Tested-by: Benjamin Lerman <qsr@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
2014-09-11 12:41:43 +00:00
Ben Chan
ab6cc90503 Update code to include base/files/file_util.h
file_util.h was moved from base to base/files
(https://codereview.chromium.org/468253002). This CL updates platform2
code to include base/files/file_util.h instead of base/file_util.h.

BUG=chromium:411001
TEST=Trybot run on paladin, release, and chromiumos-sdk builders.

Change-Id: I488925b54615e131e508a460dc1a27f88168f936
Reviewed-on: https://chromium-review.googlesource.com/216851
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
2014-09-09 21:00:34 +00:00
Ben Chan
b63e528a56 Update to build against libchrome-293518.
libchrome is updated from revision 271506 to 293518. This CL updates
platform2 code to build against libchrome-293518 with the following
changes:

- LOG_ERROR_REPORT is removed
  (https://codereview.chromium.org/331143007)

- StringToLowerASCII is moved to base namespace
  (https://codereview.chromium.org/448853002)

BUG=chromium:411001
CQ-DEPEND=CL:216584
CQ-DEPEND=CL:216585
CQ-DEPEND=CL:216586
CQ-DEPEND=CL:216511
CQ-DEPEND=CL:217084
CQ-DEPEND=CL:217085
TEST=Trybot run on paladin, release, and chromiumos-sdk builders.

Change-Id: I9fbdad30b3a7c79c1ec4e208664b8befea31a3ec
Reviewed-on: https://chromium-review.googlesource.com/216589
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
2014-09-09 21:00:00 +00:00