Loading debuggerd/debuggerd_test.cpp +18 −0 Original line number Diff line number Diff line Loading @@ -1680,6 +1680,24 @@ TEST_P(GwpAsanCrasherTest, DISABLED_run_gwp_asan_test) { if (params.free_before_access) free(static_cast<void*>(const_cast<char*>(p))); p[params.access_offset] = 42; if (!params.free_before_access) free(static_cast<void*>(const_cast<char*>(p))); bool recoverable = std::get<1>(GetParam()); ASSERT_TRUE(recoverable); // Non-recoverable should have crashed. // As we're in recoverable mode, trigger another 2x use-after-frees (ensuring // we end with at least one in a different slot), make sure the process still // doesn't crash. p = reinterpret_cast<char* volatile>(malloc(params.alloc_size)); char* volatile p2 = reinterpret_cast<char* volatile>(malloc(params.alloc_size)); free(static_cast<void*>(const_cast<char*>(p))); free(static_cast<void*>(const_cast<char*>(p2))); *p = 42; *p2 = 42; // Under clang coverage (which is a default TEST_MAPPING presubmit target), the // recoverable+seccomp tests fail because the minijail prevents some atexit syscalls that clang // coverage does. Thus, skip the atexit handlers. _exit(0); } TEST_F(CrasherTest, fdsan_warning_abort_message) { Loading Loading
debuggerd/debuggerd_test.cpp +18 −0 Original line number Diff line number Diff line Loading @@ -1680,6 +1680,24 @@ TEST_P(GwpAsanCrasherTest, DISABLED_run_gwp_asan_test) { if (params.free_before_access) free(static_cast<void*>(const_cast<char*>(p))); p[params.access_offset] = 42; if (!params.free_before_access) free(static_cast<void*>(const_cast<char*>(p))); bool recoverable = std::get<1>(GetParam()); ASSERT_TRUE(recoverable); // Non-recoverable should have crashed. // As we're in recoverable mode, trigger another 2x use-after-frees (ensuring // we end with at least one in a different slot), make sure the process still // doesn't crash. p = reinterpret_cast<char* volatile>(malloc(params.alloc_size)); char* volatile p2 = reinterpret_cast<char* volatile>(malloc(params.alloc_size)); free(static_cast<void*>(const_cast<char*>(p))); free(static_cast<void*>(const_cast<char*>(p2))); *p = 42; *p2 = 42; // Under clang coverage (which is a default TEST_MAPPING presubmit target), the // recoverable+seccomp tests fail because the minijail prevents some atexit syscalls that clang // coverage does. Thus, skip the atexit handlers. _exit(0); } TEST_F(CrasherTest, fdsan_warning_abort_message) { Loading