• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

dbus_bindings/22-Nov-2023-2119

init/22-Nov-2023-5321

.project_aliasD22-Nov-20236 21

99-crash-reporter.rulesD22-Nov-2023861 76

Android.mkD22-Nov-20234.6 KiB14898

OWNERSD22-Nov-202333 32

README.mdD22-Nov-20233 KiB6248

TEST_WARNINGD22-Nov-20233.5 KiB3231

crash_collector.ccD22-Nov-202314 KiB414309

crash_collector.hD22-Nov-20236.8 KiB16887

crash_collector_test.ccD22-Nov-20238.8 KiB249193

crash_collector_test.hD22-Nov-20231.1 KiB3614

crash_reporter.ccD22-Nov-202311.1 KiB332234

crash_reporter.rcD22-Nov-20231.4 KiB3830

crash_reporter_logs.confD22-Nov-20235.1 KiB12355

crash_reporter_logs_test.ccD22-Nov-20231.4 KiB4215

crash_senderD22-Nov-202321.5 KiB720487

kernel_collector.ccD22-Nov-202320 KiB604413

kernel_collector.hD22-Nov-20234 KiB12465

kernel_collector_test.ccD22-Nov-202330.4 KiB678570

kernel_collector_test.hD22-Nov-2023992 3211

kernel_log_collector.shD22-Nov-20231.9 KiB6028

kernel_warning_collector.ccD22-Nov-20233.5 KiB11478

kernel_warning_collector.hD22-Nov-20231.4 KiB4818

list_proxies.ccD22-Nov-202310.1 KiB303207

periodic_schedulerD22-Nov-20232.3 KiB8144

testrunner.ccD22-Nov-2023775 246

udev_collector.ccD22-Nov-20239 KiB245175

udev_collector.hD22-Nov-20232.8 KiB7733

udev_collector_test.ccD22-Nov-20236.4 KiB184120

unclean_shutdown_collector.ccD22-Nov-20232.9 KiB9461

unclean_shutdown_collector.hD22-Nov-20231.9 KiB6326

unclean_shutdown_collector_test.ccD22-Nov-20234.5 KiB154108

user_collector.ccD22-Nov-202323.2 KiB670517

user_collector.hD22-Nov-20237.5 KiB190106

user_collector_test.ccD22-Nov-202314.4 KiB439340

warn_collector.lD22-Nov-202310 KiB336217

warn_collector_test.cD22-Nov-2023850 265

warn_collector_test.shD22-Nov-20232.4 KiB9149

warn_collector_test_reporter.shD22-Nov-2023862 285

README.md

1# crash_reporter
2
3`crash_reporter` is a deamon running on the device that saves the call stack of
4crashing programs. It makes use of the
5[Breakpad](https://chromium.googlesource.com/breakpad/breakpad/) library.
6
7During a build, Breakpad symbol files are generated for all binaries.  They are
8packaged into a zip file when running `m dist`, so that a developer can upload
9them to the crash server.
10
11On a device, if the user has opted in to metrics and crash reporting, a
12Breakpad minidump is generated when an executable crashes, which is then
13uploaded to the crash server.
14
15On the crash server, it compares the minidump's signature to the symbol files
16that the developer has uploaded, and extracts and symbolizes the stack trace
17from the minidump.
18
19## SELinux policies
20
21In order to correctly generate a minidump, `crash_reporter` needs to be given
22the proper SELinux permissions for accessing the domain of the crashing
23executable.  By default, `crash_reporter` has only been given access to a select
24number of system domains, such as `metricsd`, `weave`, and `update_engine`.  If
25a developer wants their executable's crashes to be caught by `crash_reporter`,
26they will have to set their SELinux policies in their .te file to allow
27`crash_reporter` access to their domain.  This can be done through a simple
28[macro](https://android.googlesource.com/device/generic/brillo/+/master/sepolicy/te_macros):
29
30    allow_crash_reporter(domain_name)
31
32Replace *domain_name* with whatever domain is assigned to the executable in
33the `file_contexts` file.
34
35## Configuration
36
37`crash_reporter` has a few different configuration options that have to be set.
38
39- Crashes are only handled and uploaded if analytics reporting is enabled,
40  either via the weave call to set `_metrics.enableAnalyticsReporting` or by
41  manually creating the file `/data/misc/metrics/enabled` (for testing only).
42- The `BRILLO_CRASH_SERVER` make variable should be set in the `product.mk`
43  file to the URL of the crash server.  For Brillo builds, it is set
44  automatically through the product configuration.  Setting this variable will
45  populate the `/etc/os-release.d/crash_server` file on the device, which is
46  read by `crash_sender`.
47- The `BRILLO_PRODUCT_ID` make variable should be set in the `product.mk` file
48  to the product's ID.  For Brillo builds, it is set automatically through the
49  product configuration.  Setting this variable will populate the
50  `/etc/os-release.d/product_id`, which is read by `crash_sender`.
51
52## Uploading crash reports in *eng* builds
53
54By default, crash reports are only uploaded to the server for production
55*user* and *userdebug* images.  In *eng* builds, with crash reporting enabled
56the device will generate minidumps for any crashing executables but will not
57send them to the crash server.  If a developer does want to force an upload,
58they can do so by issuing the command `SECONDS_SEND_SPREAD=5 FORCE_OFFICIAL=1
59crash_sender` from an ADB shell.  This will send the report to the server, with
60the *image_type* field set to *force-official* so that these reports can be
61differentiated from normal reports.
62