[libc-commits] [libc] [libc] Remove LlvmLibcStackChkFail.Smash test (PR #125919)
via libc-commits
libc-commits at lists.llvm.org
Wed Feb 5 12:22:34 PST 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libc
Author: Roland McGrath (frobtech)
<details>
<summary>Changes</summary>
This test was problematic, and also unnecessary. It's not really
a test of the libc functionality or ABI. That's already covered
by the LlvmLibcStackChkFail.Death test. The Smash test was in
fact just testing that the compiler produces the call in the
expected situation. That's a compiler test, not a libc test.
It's not really feasible to make a test like this both reliable
and safe. Since it's not something libc needs to test, it's not
worth trying.
---
Full diff: https://github.com/llvm/llvm-project/pull/125919.diff
1 Files Affected:
- (modified) libc/test/src/compiler/stack_chk_guard_test.cpp (-15)
``````````diff
diff --git a/libc/test/src/compiler/stack_chk_guard_test.cpp b/libc/test/src/compiler/stack_chk_guard_test.cpp
index 4ec8398c9fc95dc..301031ff47bd5e4 100644
--- a/libc/test/src/compiler/stack_chk_guard_test.cpp
+++ b/libc/test/src/compiler/stack_chk_guard_test.cpp
@@ -7,24 +7,9 @@
//===----------------------------------------------------------------------===//
#include "hdr/signal_macros.h"
-#include "src/__support/macros/sanitizer.h"
#include "src/compiler/__stack_chk_fail.h"
-#include "src/string/memset.h"
#include "test/UnitTest/Test.h"
TEST(LlvmLibcStackChkFail, Death) {
EXPECT_DEATH([] { __stack_chk_fail(); }, WITH_SIGNAL(SIGABRT));
}
-
-// Disable the test when asan is enabled so that it doesn't immediately fail
-// after the memset, but before the stack canary is re-checked.
-#ifndef LIBC_HAS_ADDRESS_SANITIZER
-TEST(LlvmLibcStackChkFail, Smash) {
- EXPECT_DEATH(
- [] {
- int arr[20];
- LIBC_NAMESPACE::memset(arr, 0xAA, 2001);
- },
- WITH_SIGNAL(SIGABRT));
-}
-#endif // LIBC_HAS_ADDRESS_SANITIZER
``````````
</details>
https://github.com/llvm/llvm-project/pull/125919
More information about the libc-commits
mailing list