diff --git a/CHANGELOG.md b/CHANGELOG.md index d89c4015..afcf04e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ * Rename to detail::is_invocable * Rename project to http-bench * Fix flat_streambuf +* Add ub sanitizer blacklist WebSocket: diff --git a/CMakeLists.txt b/CMakeLists.txt index 24e48ade..01cbf44b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -114,20 +114,25 @@ if ("${VARIANT}" STREQUAL "coverage") "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage") set(CMAKE_BUILD_TYPE RELWITHDEBINFO) set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lgcov") + elseif ("${VARIANT}" STREQUAL "asan") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer") set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address") set(CMAKE_BUILD_TYPE RELWITHDEBINFO) + elseif ("${VARIANT}" STREQUAL "usan") set(CMAKE_CXX_FLAGS - "${CMAKE_CXX_FLAGS} -fsanitize=undefined -fno-omit-frame-pointer") + "${CMAKE_CXX_FLAGS} -fsanitize=undefined -fsanitize-blacklist=${PROJECT_SOURCE_DIR}/scripts/usan.supp -fno-omit-frame-pointer") set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=undefined") set(CMAKE_BUILD_TYPE RELWITHDEBINFO) + elseif ("${VARIANT}" STREQUAL "debug") set(CMAKE_BUILD_TYPE DEBUG) + elseif ("${VARIANT}" STREQUAL "release") set(CMAKE_BUILD_TYPE RELEASE) + endif() include_directories (extras) @@ -168,7 +173,7 @@ file(GLOB_RECURSE EXTRAS_INCLUDES add_subdirectory (examples) if (NOT OPENSSL_FOUND) - message("OpenSSL not found. Not building examples/ssl") + message("OpenSSL not found. Not building SSL tests and examples") else() add_subdirectory (examples/ssl) endif() diff --git a/Jamroot b/Jamroot index e5ef9f0a..40d3f770 100644 --- a/Jamroot +++ b/Jamroot @@ -72,7 +72,7 @@ variant msan : debug : - "-fsanitize=memory -fno-omit-frame-pointer -fsanitize-memory-track-origins=2 -fsanitize-memory-use-after-dtor" + "-fsanitize=memory -fsanitize-memory-track-origins=2 -fsanitize-memory-use-after-dtor -fno-omit-frame-pointer" "-fsanitize=memory" ; @@ -80,7 +80,7 @@ variant usan : debug : - "-fsanitize=undefined -fno-omit-frame-pointer" + "-fsanitize=undefined -fsanitize-blacklist=scripts/usan.supp -fno-omit-frame-pointer" "-fsanitize=undefined" ; diff --git a/scripts/usan.supp b/scripts/usan.supp new file mode 100644 index 00000000..09bc1abe --- /dev/null +++ b/scripts/usan.supp @@ -0,0 +1,29 @@ +# Remember that this blacklist file is GLOBAL to all sanitizers +# Be therefore extremely careful when considering to add a sanitizer +# filter here instead of using a runtime suppression +# +# Remember also that filters here quite literally completely +# remove instrumentation altogether, so filtering here means +# that sanitizers such as tsan will false positive on problems +# introduced by code filtered here. +# +# The main use for this file is ubsan, as it's the only sanitizer +# without a runtime suppression facility. +# +# Be ESPECIALLY careful when filtering out entire source files! +# Try if at all possible to filter only functions using fun:regex +# Remember you must use mangled symbol names with fun:regex + +# boost/lexical_cast.hpp:1625:43: runtime error: downcast of address 0x7fbb4fffbce8 which does not point to an object of type 'buffer_t' (aka 'parser_buf >, char>') +# Fixed in Boost 1.63.0 https://svn.boost.org/trac/boost/ticket/12889 +# +fun:*shl_input_streamable* + +## The well known ubsan failure in libstdc++ extant for years :) +# Line 96:24: runtime error: load of value 4294967221, which is not a valid value for type 'std::_Ios_Fmtflags' +# +#fun:*_Ios_Fmtflags* + +# boost/any.hpp:259:16: runtime error: downcast of address 0x000004392e70 which does not point to an object of type 'any::holder' +# +#fun:*any_cast*