From 0b18289a85325d7f5d37c0df27226eee31b3241a Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 22 Jan 2018 05:21:08 +0200 Subject: [PATCH 1/3] Avoid unused expression warning by using the expression --- test/initialization_test.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/initialization_test.cpp b/test/initialization_test.cpp index 9c89a50..c5ea03c 100644 --- a/test/initialization_test.cpp +++ b/test/initialization_test.cpp @@ -10,19 +10,19 @@ // This test verifiies that the error_category vtable does not suffer from // order-of-initialization problems. -#include #include +#include struct foo { foo() { boost::system::error_code ec; - ec == boost::system::errc::permission_denied; + BOOST_TEST_NE( ec, boost::system::errc::permission_denied ); } } f; -int main( int, char ** ) +int main() { - return ::boost::report_errors(); + return boost::report_errors(); } From 22189fce9528cdb17ae88993e3091fe5f2afc40a Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 22 Jan 2018 05:40:41 +0200 Subject: [PATCH 2/3] Disable std_mismatch_test when UBSAN is defined --- test/std_mismatch_test.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/std_mismatch_test.cpp b/test/std_mismatch_test.cpp index 37a606b..af24196 100644 --- a/test/std_mismatch_test.cpp +++ b/test/std_mismatch_test.cpp @@ -12,10 +12,13 @@ # define _CRT_SECURE_NO_WARNINGS #include +#include #include #if defined(BOOST_NO_CXX11_HDR_SYSTEM_ERROR) +BOOST_PRAGMA_MESSAGE("Skipping test, BOOST_NO_CXX11_HDR_SYSTEM_ERROR is defined") + int main() { std::cout @@ -23,6 +26,11 @@ int main() " support header so interoperation will not be tested.\n"; } +#elif defined(UBSAN) + +BOOST_PRAGMA_MESSAGE("Skipping test, UBSAN is defined") +int main() {} + #else #include From ca5357699a77f8afdf8fdf1e6522ebe54f1e584f Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 22 Jan 2018 07:17:56 +0200 Subject: [PATCH 3/3] Enable stack trace on UBSAN Travis configurations --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index fc9ef29..52e6a0a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -109,7 +109,7 @@ matrix: - os: linux compiler: g++-7 - env: UBSAN=1 TOOLSET=gcc COMPILER=g++-7 CXXSTD=03,11,14,17 + env: UBSAN=1 TOOLSET=gcc COMPILER=g++-7 CXXSTD=03,11,14,17 UBSAN_OPTIONS=print_stacktrace=1 addons: apt: packages: @@ -219,7 +219,7 @@ matrix: - os: linux compiler: clang++-5.0 - env: UBSAN=1 TOOLSET=clang COMPILER=clang++-5.0 CXXSTD=03,11,14,1z + env: UBSAN=1 TOOLSET=clang COMPILER=clang++-5.0 CXXSTD=03,11,14,1z UBSAN_OPTIONS=print_stacktrace=1 addons: apt: packages: @@ -238,7 +238,7 @@ matrix: - os: linux compiler: clang++-libc++ - env: UBSAN=1 TOOLSET=clang COMPILER=clang++-libc++ CXXSTD=03,11,14,1z + env: UBSAN=1 TOOLSET=clang COMPILER=clang++-libc++ CXXSTD=03,11,14,1z UBSAN_OPTIONS=print_stacktrace=1 addons: apt: packages: @@ -264,7 +264,7 @@ install: script: - |- echo "using $TOOLSET : : $COMPILER ;" > ~/user-config.jam - - ./b2 -j3 libs/system/test toolset=$TOOLSET cxxstd=$CXXSTD variant=debug,release ${UBSAN:+cxxflags=-fsanitize=undefined} ${UBSAN:+cxxflags=-fno-sanitize-recover=undefined} ${UBSAN:+linkflags=-fsanitize=undefined} ${UBSAN:+define=UBSAN=1} + - ./b2 -j3 libs/system/test toolset=$TOOLSET cxxstd=$CXXSTD variant=debug,release ${UBSAN:+cxxflags=-fsanitize=undefined cxxflags=-fno-sanitize-recover=undefined linkflags=-fsanitize=undefined define=UBSAN=1 debug-symbols=on} notifications: email: