tree: fb8e977a29bbb4a1c7267f2807e310ed3f161853 [path history] [tgz]
  1. configs/
  2. info/
  3. tests/
  4. annotation_map.h
  5. BUILD.gn
  6. config.cc
  7. config.h
  8. constants.h
  9. crash_register.cc
  10. crash_register.h
  11. crash_reporter.cc
  12. crash_reporter.h
  13. crash_server.cc
  14. crash_server.h
  15. dart_module_parser.cc
  16. dart_module_parser.h
  17. default_annotations.cc
  18. default_annotations.h
  19. errors.h
  20. log_tags.cc
  21. log_tags.h
  22. network_watcher.cc
  23. network_watcher.h
  24. OWNERS
  25. product.cc
  26. product.h
  27. product_quotas.cc
  28. product_quotas.h
  29. queue.cc
  30. queue.h
  31. README.md
  32. report.cc
  33. report.h
  34. report_id.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_manager.cc
  44. snapshot_manager.h
  45. store.cc
  46. store.h
  47. store_metadata.cc
  48. store_metadata.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 the config telling to upload to a crash server and which server to upload to.

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

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.