[libc-commits] [libc] [libc] disable asan for LlvmLibcStackChkFail.Smash (PR #75966)

Nick Desaulniers via libc-commits libc-commits at lists.llvm.org
Tue Dec 19 12:36:37 PST 2023


https://github.com/nickdesaulniers created https://github.com/llvm/llvm-project/pull/75966

Otherwise for ASAN configured runs of the test, the test will fail due to the
sanitizer rather than via SIGABRT.


>From ea7eecbe9d8cd2ff4307d57b68f6155335d40092 Mon Sep 17 00:00:00 2001
From: Nick Desaulniers <ndesaulniers at google.com>
Date: Tue, 19 Dec 2023 12:35:25 -0800
Subject: [PATCH] [libc] disable asan for LlvmLibcStackChkFail.Smash

Otherwise for ASAN configured runs of the test, the test will fail due to the
sanitizer rather than via SIGABRT.
---
 libc/test/src/compiler/stack_chk_guard_test.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libc/test/src/compiler/stack_chk_guard_test.cpp b/libc/test/src/compiler/stack_chk_guard_test.cpp
index 84c54ddeccc956..5cbcfe19c980b2 100644
--- a/libc/test/src/compiler/stack_chk_guard_test.cpp
+++ b/libc/test/src/compiler/stack_chk_guard_test.cpp
@@ -17,7 +17,7 @@ TEST(LlvmLibcStackChkFail, Death) {
 
 TEST(LlvmLibcStackChkFail, Smash) {
   EXPECT_DEATH(
-      [] {
+      [] [[gnu::no_sanitize]]{
         int arr[20];
         LIBC_NAMESPACE::memset(arr, 0xAA, 2001);
       },



More information about the libc-commits mailing list