[PATCH] D76533: [clangd] Skip ClangdVFSTest.TestStackOverflow when address sanitizer is used

Bjorn Pettersson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 20 15:45:12 PDT 2020


bjope created this revision.
bjope added reviewers: sammccall, Dmitry.Kozhevnikov.
Herald added subscribers: cfe-commits, usaxena95, kadircet, arphaman, jkorous, MaskRay, ilya-biryukov.
Herald added a project: clang.
bjope added a comment.
bjope added subscribers: uabelho, dstenb.

I don't know if this is a good solution. But we've had problems with our downstream bots that builds llvm with asan, and runs check-all, for awhile (probably since we merged https://reviews.llvm.org/D50993).


The ClangdVFSTest.TestStackOverflow unittest does not seem to work
when building the test with address sanitizer activated. Afaict the
goal is to get a constexpr depth error, rather than stack overflow.
But with asan instrumentation we do get stack overflow complaints
from asan. As a workaround this patch simply disables the test case,
when being built with address sanitizer activated.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D76533

Files:
  clang-tools-extra/clangd/unittests/ClangdTests.cpp


Index: clang-tools-extra/clangd/unittests/ClangdTests.cpp
===================================================================
--- clang-tools-extra/clangd/unittests/ClangdTests.cpp
+++ clang-tools-extra/clangd/unittests/ClangdTests.cpp
@@ -1083,6 +1083,9 @@
                                 Field(&CodeCompletion::Scope, "ns::"))));
 }
 
+// Tests fails when built with asan due to stack overflow. So skip running the
+// test as a workaround.
+#if !defined(__has_feature) || !__has_feature(address_sanitizer)
 TEST_F(ClangdVFSTest, TestStackOverflow) {
   MockFSProvider FS;
   ErrorCheckingCallbacks DiagConsumer;
@@ -1103,6 +1106,7 @@
   // overflow
   EXPECT_TRUE(DiagConsumer.hadErrorInLastDiags());
 }
+#endif
 
 } // namespace
 } // namespace clangd


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76533.251787.patch
Type: text/x-patch
Size: 757 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200320/7790a903/attachment-0001.bin>


More information about the cfe-commits mailing list