This patch describes the shared crash handler interface into GWP-ASan that can
be used by both in-process and out-of-process crash handlers.
This interface yet is to be implemented. This patch is primarily to discuss the
requirements of the interface, and how to expose the metadata in an stable,
robust API. Please review and leave your comments.
Some careful design decisions have been made, and I'll try and identify some
key aspects:
- Out-of-process crash handlers need to be able to retrieve the requisite information from the crashed process. This API introduces a new (opaque at this time) struct called gwp_asan::AllocatorState. This is designed to be a flat structure (i.e. no internal pointers) that contains all metadata required for these API calls. This is similar to the design of Chromium's GWP-ASan, and will allow us to trivially memcpy() out all required information from the crashed process in order to make these API calls.
- This API must be stable and backwards compatible. Implementing this into Android must allow libdebuggerd and the Firebase Crashlytics SDK to talk with libc (where GWP-ASan will live) in a stable way. libdebuggerd poses less risk, as the platform version will generally be in sync with libc. Applications built with Crashlytics may be built on vastly different major version of Android.