Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ff6df343 authored by Jack He's avatar Jack He
Browse files

GD-Facade: Enable ASAN but disable container overflow check

* AddressSanitizerContainerOverflow has false positives because not
  all dependencies are compiled with ASAN according to:
  https://github.com/google/sanitizers/wiki/AddressSanitizerContainerOverflow
* Hence we need to disable container overflow check. We do this at
  compile time per instructiosn at:
  https://github.com/google/sanitizers/wiki/AddressSanitizerFlags#run-time-flags

Bug: 175033589
Test: gd/cert/run
Tag: #gd-refactor
Change-Id: I80a0fbcef022101b57d1c68919add6acf6aa81e4
parent ea59bc83
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -251,6 +251,10 @@ cc_binary {
            ],
        },
    },
    sanitize: {
        address: true,
        cfi: true,
    }
}

cc_test {
+4 −0
Original line number Diff line number Diff line
@@ -46,6 +46,10 @@ using ::bluetooth::StackManager;
using ::bluetooth::hal::HciHalHostRootcanalConfig;
using ::bluetooth::os::Thread;

extern "C" const char* __asan_default_options() {
  return "detect_container_overflow=0";
}

namespace {
::bluetooth::facade::GrpcRootServer grpc_root_server;

+4 −0
Original line number Diff line number Diff line
@@ -31,6 +31,10 @@ constexpr uint16_t kTestPort = 6401;
constexpr uint16_t kHciServerPort = 6402;
constexpr uint16_t kLinkServerPort = 6403;

extern "C" const char* __asan_default_options() {
  return "detect_container_overflow=0";
}

bool crash_callback(const void* crash_context, size_t crash_context_size,
                    __attribute__((unused)) void* context) {
  pid_t tid = BACKTRACE_CURRENT_THREAD;