]> granicus.if.org Git - llvm/commitdiff
Merging r291918:
authorHans Wennborg <hans@hanshq.net>
Fri, 27 Jan 2017 22:55:50 +0000 (22:55 +0000)
committerHans Wennborg <hans@hanshq.net>
Fri, 27 Jan 2017 22:55:50 +0000 (22:55 +0000)
------------------------------------------------------------------------
r291918 | krasin | 2017-01-13 09:30:10 -0800 (Fri, 13 Jan 2017) | 13 lines

Fix UBSan bots by blacklisting bits/stl_tree.h.

Summary:
libstdc++ has some undefined behavior in bits/stl_tree.h that
has recently became excercised by some of the LLVM code.
Given that fixing libstdc++ will take years, adding the file
into a blacklist to fix bots seems like a necessity.

Reviewers: vitalybuka

Subscribers: llvm-commits, mgorny

Differential Revision: https://reviews.llvm.org/D28686
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_40@293342 91177308-0d34-0410-b5e6-96231b3b80d8

cmake/modules/HandleLLVMOptions.cmake
utils/sanitizers/ubsan_blacklist.txt [new file with mode: 0644]

index 4ce7f57403c4f9023b59640f0e2b00de3f2b085f..1825b55ed54b92b96398b78908f612e88c04360c 100644 (file)
@@ -555,6 +555,8 @@ if(LLVM_USE_SANITIZER)
       append_common_sanitizer_flags()
       append("-fsanitize=undefined -fno-sanitize=vptr,function -fno-sanitize-recover=all"
               CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+      append("-fsanitize-blacklist=${CMAKE_SOURCE_DIR}/utils/sanitizers/ubsan_blacklist.txt"
+             CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
     elseif (LLVM_USE_SANITIZER STREQUAL "Thread")
       append_common_sanitizer_flags()
       append("-fsanitize=thread" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
diff --git a/utils/sanitizers/ubsan_blacklist.txt b/utils/sanitizers/ubsan_blacklist.txt
new file mode 100644 (file)
index 0000000..4997586
--- /dev/null
@@ -0,0 +1,7 @@
+# This blacklist should be applied when LLVM is built
+# with -fsanitize=undefined instrumentation. It exists
+# because libstdc++ has some undefined behavior issues
+# in some of the headers, in particular, stl_tree.h.
+
+# upcast of address with insufficient space for an object of type std::_Rb_tree_node<...>
+src:*bits/stl_tree.h