summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2021-05-13 01:03:01 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2021-05-13 01:03:01 +0000
commit683053ece8f7886a4406f774a6981cf816795a27 (patch)
tree5e1e85016be16b395eef3d2c25a902ee8fa01c58
parentebc3cc9d8cb9a97a9483a2b515df2e7080c373de (diff)
parentd8ce6a5e15b8567d1a4e35e34ba7644b877c9787 (diff)
downloadgwp_asan-android12-d1-s3-release.tar.gz
Change-Id: I677139a3454b77b91f9893631b16f3869eac0f2c
-rw-r--r--gwp_asan/common.h2
-rw-r--r--gwp_asan/optional/backtrace_fuchsia.cpp10
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; }