Convert the crash reporter upload log to be json objects.
Report the product_id in the crash report upload log. Also add
the exec name to the log to make it easier finding specific
crash reports if multiple binaries are crashing.
Bug: 25121166
Change-Id: I48ad88fcb0bb00b4a21dc6f2aa54f94cead971ea
When doing a clean build, creating this file fails because the dir does
not yet exist:
echo "" > out/target/product/brilloemulator_arm/obj/ETC/crash_server_intermediates/crash_server
/bin/bash: out/target/product/brilloemulator_arm/obj/ETC/crash_server_intermediates/crash_server: No such file or directory
Bug: 24989289
Change-Id: If204dc0eb32e95ee66f97b568b4b9ae4050d3591
Since all of the other configs use os-release.d rather than
system properties, switch the crash server url as well. This also
makes the product configuration more straightforward.
Bug: 24989289
Change-Id: Ia4b423e59937a917c882e74b110b5ea520ca6016
The /data directory isn't guaranteed to be mounted during the
"on boot" trigger, so switch them to using "on post-fs-data".
Bug: 24941965
Change-Id: Iee84ca0e934967cff7bc4d968d9939d398c73980
The product_id and product_version has been moved into the
/etc/os-release.d key-value store, update crash_reporter to
use these values.
Bug: 22874192
Change-Id: I71886574d1aa4e0a3ac18e1c361ec65684af9b49
libchromeos is transitioning to libbrillo and chromeos namespaces
and include directory is changing to brillo.
Bug: 24872993
Change-Id: I797613a38c7444a113f12e38366a424388477276
Rather than assuming the UID and GID of crashing processes is
the same, report and use the actual GID that the process was
running as.
Bug: 24678424
Change-Id: I3cfc415be2feb2863a4f4b850bfd4a3267217a44
In order to read the /proc/<pid> files from non-root users without
using CAP_SYS_PTRACE and CAP_DAC_OVERRIDE, use setresuid(..) and
setresgid(..) to switch to the process's user to copy off necessary
files for generating the breakpad minidump.
Bug: 24678424
Change-Id: I4a43583033587441394483ce678c40c4161808b9
Read in the ro.build.id property for version, and
ro.product.product_id for the Product ID.
Bug: 22874192
Change-Id: I9a3fbf375d49d04fc7bf6700c5987cb9e435c318
Instead of grepping the build description for "Official", use
the property ro.secure.
Bug: 24404853
Change-Id: Ia0423b3524ac9472db6a782509b56c9834c8d26e
We can use the LOCAL_INIT_RC variable for init.rc files.
Also, switch to use <service>.rc for the filename, since this is what
Android does now.
Bug: 24465893
Change-Id: I924acbe758ba9994020093005e27c8c06d0686ff
Rather than share the guid with metrics, crash_reporter should
use its own guid that is persistent across reboots but not
across factory resets.
Bug: 24102242
Change-Id: I1bcc1a10aa8e1c09372386fe8e1661a8894b8d70
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
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
- 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
- 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
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
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
It is unsafe to use /data/local/tmp. Use our own temporary
directory under /data/misc/crash_reporter.
Bug: 23430484
Change-Id: I186ba6b146bd884064177a3bb29b18b8edcc0b62
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
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
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
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
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
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>
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>
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>
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>
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>
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>