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

Commit e7e54568 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge changes If9886370,I80a0fbce

* changes:
  GD-Cert: Symbolize ASAN triggered crashes
  GD-Facade: Enable ASAN but disable container overflow check
parents bb4cca25 73d3951b
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 {
+1 −0
Original line number Diff line number Diff line
@@ -99,6 +99,7 @@ $(bluetooth_cert_tests_py_package_zip): $(SOONG_ZIP) $(LOCAL_acts_zip) \
		-P llvm_binutils -C $(LLVM_PREBUILTS_BASE)/linux-x86/$(LLVM_PREBUILTS_VERSION) \
		-f $(LLVM_PREBUILTS_BASE)/linux-x86/$(LLVM_PREBUILTS_VERSION)/bin/llvm-cov \
		-f $(LLVM_PREBUILTS_BASE)/linux-x86/$(LLVM_PREBUILTS_VERSION)/bin/llvm-profdata \
		-f $(LLVM_PREBUILTS_BASE)/linux-x86/$(LLVM_PREBUILTS_VERSION)/bin/llvm-symbolizer \
		-f $(LLVM_PREBUILTS_BASE)/linux-x86/$(LLVM_PREBUILTS_VERSION)/lib64/libc++.so.1

$(call dist-for-goals,bluetooth_stack_with_facade,$(bluetooth_cert_tests_py_package_zip):bluetooth_cert_tests.zip)
+6 −0
Original line number Diff line number Diff line
@@ -301,6 +301,12 @@ class GdHostOnlyDevice(GdDeviceBase):
        self.backing_process_profraw_path = pathlib.Path(self.log_path_base).joinpath(
            "%s_%s_backing_coverage.profraw" % (self.type_identifier, self.label))
        self.environment["LLVM_PROFILE_FILE"] = str(self.backing_process_profraw_path)
        llvm_binutils = pathlib.Path(get_gd_root()).joinpath("llvm_binutils").joinpath("bin")
        llvm_symbolizer = llvm_binutils.joinpath("llvm-symbolizer")
        if llvm_symbolizer.is_file():
            self.environment["ASAN_SYMBOLIZER_PATH"] = llvm_symbolizer
        else:
            logging.warning("[%s] Cannot find LLVM symbolizer at %s" % (self.label, str(llvm_symbolizer)))

    def teardown(self):
        super().teardown()
+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;