tree: eb7729376c16e52830a4a9b8f2c1c792e4a02645 [path history] [tgz]
  1. info/
  2. tests/
  3. annotation_map.h
  4. BUILD.gn
  5. constants.h
  6. crash_register.cc
  7. crash_register.h
  8. crash_reporter.cc
  9. crash_reporter.h
  10. crash_server.cc
  11. crash_server.h
  12. dart_module_parser.cc
  13. dart_module_parser.h
  14. errors.h
  15. filing_result.cc
  16. filing_result.h
  17. item_location.cc
  18. item_location.h
  19. log_tags.cc
  20. log_tags.h
  21. product.cc
  22. product.h
  23. product_quotas.cc
  24. product_quotas.h
  25. queue.cc
  26. queue.h
  27. README.md
  28. report.cc
  29. report.h
  30. report_id.h
  31. report_store.cc
  32. report_store.h
  33. report_store_metadata.cc
  34. report_store_metadata.h
  35. report_util.cc
  36. report_util.h
  37. reporting_policy_watcher.cc
  38. reporting_policy_watcher.h
  39. sized_data_reader.cc
  40. sized_data_reader.h
  41. snapshot.cc
  42. snapshot.h
  43. snapshot_collector.cc
  44. snapshot_collector.h
  45. snapshot_persistence.cc
  46. snapshot_persistence.h
  47. snapshot_persistence_metadata.cc
  48. snapshot_persistence_metadata.h
  49. snapshot_store.cc
  50. snapshot_store.h
src/developer/forensics/crash_reports/README.md

Crash reporting

For development, it is often easier to dump the crash information in the logs as the crash happens on device. For devices in the field, we want to be able to send a report to a remote crash server as well as we might not have access to the devices' logs. We use Crashpad as the third-party client library to talk to the remote crash server.

We control via JSON configuration files whether we upload the reports to a crash server and if so, to which crash server. By default, we create a report, but we do not upload it.

Testing

To test your changes, on a real device, we have some unit tests and some helper programs to simulate various crashes.

For the helper programs, you first need to add the package wrapping a config which enables crash report uploading and give your device consent to share data in its settings.

(host)$ fx set core.x64 --with-base
//src/developer/forensics:userdebug_configs_for_eng

Note, the above config only works for eng builds and product assembly will fail it used on user/userdebug builds.

Then, after running each one of the helper programs (see commands in sections below), you should then look each time for the following line in the syslog:

(host)$ fx syslog --tag crash
...
successfully uploaded report at $URL...
...

Click on the URL (contact OWNERS if you don't have access and think you should) and check that the report matches your expectations, e.g., the new annotation is set to the expected value.

Unit tests

To run the unit and integration tests:

(host) $ fx test crash-reports-tests

Kernel crash

The following command will cause a kernel panic:

(target)$ k crash

The device will then reboot and the system should detect the kernel crash log, attach it to a crash report and try to upload it. Look at the syslog upon reboot.

C userspace crash

The following command will cause a write to address 0x0:

(target)$ crasher

You can immediately look at the syslog.

Question? Bug? Feature request?

Contact OWNERS.