[clang-tools-extra] 1407833 - [clangd] Disable SerializationTest.NoCrashOnBadArraySize with ASAN

Kirill Bobyrev via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 19 04:25:20 PST 2020


Author: Kirill Bobyrev
Date: 2020-11-19T13:24:55+01:00
New Revision: 140783347afb6e1848c81617d7fa3e556087cadd

URL: https://github.com/llvm/llvm-project/commit/140783347afb6e1848c81617d7fa3e556087cadd
DIFF: https://github.com/llvm/llvm-project/commit/140783347afb6e1848c81617d7fa3e556087cadd.diff

LOG: [clangd] Disable SerializationTest.NoCrashOnBadArraySize with ASAN

Address Sanitizer crashes on large allocations:

```c++
// Try to crash rather than hang on large allocation.
ScopedMemoryLimit MemLimit(1000 * 1024 * 1024); // 1GB
```

Added: 
    

Modified: 
    clang-tools-extra/clangd/unittests/SerializationTests.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/unittests/SerializationTests.cpp b/clang-tools-extra/clangd/unittests/SerializationTests.cpp
index ca7d3ba7e3e1..68d1d1a0df8b 100644
--- a/clang-tools-extra/clangd/unittests/SerializationTests.cpp
+++ b/clang-tools-extra/clangd/unittests/SerializationTests.cpp
@@ -332,6 +332,7 @@ class ScopedMemoryLimit {
 };
 #endif
 
+#ifndef LLVM_ADDRESS_SANITIZER_BUILD
 // Test that our deserialization detects invalid array sizes without allocating.
 // If this detection fails, the test should allocate a huge array and crash.
 TEST(SerializationTest, NoCrashOnBadArraySize) {
@@ -382,6 +383,7 @@ TEST(SerializationTest, NoCrashOnBadArraySize) {
   EXPECT_EQ(llvm::toString(CorruptParsed.takeError()),
             "malformed or truncated include uri");
 }
+#endif
 
 } // namespace
 } // namespace clangd


        


More information about the cfe-commits mailing list