diff options
-rw-r--r-- | gwp_asan/common.h | 2 | ||||
-rw-r--r-- | gwp_asan/optional/backtrace_fuchsia.cpp | 10 |
2 files changed, 10 insertions, 2 deletions
diff --git a/gwp_asan/common.h b/gwp_asan/common.h index ee8f9d1..7ce367e 100644 --- a/gwp_asan/common.h +++ b/gwp_asan/common.h @@ -83,6 +83,8 @@ struct AllocationMetadata { // crash handler. This, in conjunction with the Metadata array, forms the entire // set of information required for understanding a GWP-ASan crash. struct AllocatorState { + constexpr AllocatorState() {} + // Returns whether the provided pointer is a current sampled allocation that // is owned by this pool. GWP_ASAN_ALWAYS_INLINE bool pointerIsMine(const void *Ptr) const { diff --git a/gwp_asan/optional/backtrace_fuchsia.cpp b/gwp_asan/optional/backtrace_fuchsia.cpp index 879312a..09b0325 100644 --- a/gwp_asan/optional/backtrace_fuchsia.cpp +++ b/gwp_asan/optional/backtrace_fuchsia.cpp @@ -8,12 +8,18 @@ #include "gwp_asan/optional/backtrace.h" -// GWP-ASan on Fuchsia doesn't currently support backtraces. +#include <zircon/sanitizer.h> namespace gwp_asan { namespace backtrace { -options::Backtrace_t getBacktraceFunction() { return nullptr; } +// Fuchsia's C library provides safe, fast, best-effort backtraces itself. +options::Backtrace_t getBacktraceFunction() { + return __sanitizer_fast_backtrace; +} + +// These are only used in fatal signal handling, which is not used on Fuchsia. + PrintBacktrace_t getPrintBacktraceFunction() { return nullptr; } SegvBacktrace_t getSegvBacktraceFunction() { return nullptr; } |