Forewarning: This patch looks big in #LOC changed. I promise it's not that bad, it just moves a lot of content from one file to another. I've gone ahead and left inline comments on Phabricator for sections where this has happened.
This patch:
- Introduces the crash handler API (crash_handler_api.h).
- Moves information required for out-of-process crash handling into an AllocatorState. This is a trivially-copied POD struct that designed to be recovered from a deceased process, and used by the crash handler to create a GWP-ASan report (along with the other trivially-copied Metadata struct).
- Implements the crash handler API using the AllocatorState and Metadata.
- Adds tests for the crash handler.
- Reimplements the (now optionally linked by the supporting allocator) in-process crash handler (i.e. the segv handler) using the new crash handler API.
- Minor updates Scudo & Scudo Standalone to fix compatibility.
- Changed capitalisation of errors (e.g. /s/Use after free/Use After Free).
Why not return the metadata pointer and null if it could not be found, and then pass it to all other query functions?