This is an archive of the discontinued LLVM Phabricator instance.

[GWP-ASan] Add in-proc/out-of-proc crash handler interface.
AbandonedPublic

Authored by hctim on Dec 13 2019, 4:37 PM.

Details

Summary

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:

  1. 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.
  2. 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.

Diff Detail

Event Timeline

hctim created this revision.Dec 13 2019, 4:37 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptDec 13 2019, 4:37 PM
Herald added subscribers: llvm-commits, Restricted Project. · View Herald Transcript

Unit tests: pass. 60863 tests passed, 0 failed and 726 were skipped.

clang-format: pass.

Build artifacts: console-log.txt, CMakeCache.txt, test-results.xml, diff.json

hctim planned changes to this revision.Dec 16 2019, 1:35 PM
hctim abandoned this revision.Feb 28 2020, 3:08 PM

Merged in D73557.