From 50eb12a8e304b345552d353668d1140b61057dd9 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Sun, 8 Jan 2017 15:57:23 +0100 Subject: [PATCH] external/boost: Silence -fsanitize=nonnull-attribute ...as reported e.g. during CppunitTest_sw_odfimport: > /workdir/UnpackedTarball/boost/boost/circular_buffer/debug.hpp:37:17: runtime error: null pointer passed as argument 1, which is declared to never be null > /usr/include/string.h:62:62: note: nonnull attribute specified here > #0 0x2b24bc0e6389 in void boost::cb_details::do_fill_uninitialized_memory(SwFrameFormat**, unsigned long) /workdir/UnpackedTarball/boost/boost/circular_buffer/debug.hpp:37:5 > #1 0x2b24bc0e5b48 in boost::circular_buffer >::allocate(unsigned long) /workdir/UnpackedTarball/boost/boost/circular_buffer/base.hpp:2375:9 > #2 0x2b24bc0e545a in boost::circular_buffer >::initialize_buffer(unsigned long) /workdir/UnpackedTarball/boost/boost/circular_buffer/base.hpp:2482:18 > #3 0x2b24bc0cfaa7 in boost::circular_buffer >::circular_buffer(unsigned long, std::allocator const&) /workdir/UnpackedTarball/boost/boost/circular_buffer/base.hpp:1036:9 > #4 0x2b24bc068cd7 in AppendAllObjs(SwFrameFormats const*, SwFrame const*) /sw/source/core/layout/frmtool.cxx:1100:44 ... Change-Id: Id96a6127990548ab0ae2e8a02b7bec2d61094c37 --- external/boost/ubsan.patch.0 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/external/boost/ubsan.patch.0 b/external/boost/ubsan.patch.0 index 6ff6649dd1ee..19a77856c777 100644 --- a/external/boost/ubsan.patch.0 +++ b/external/boost/ubsan.patch.0 @@ -1,4 +1,4 @@ -Work around -fsanitize=bool +Work around -fsanitize=bool and -fsanitize=nonnull-attribute --- boost/algorithm/string/find_iterator.hpp +++ boost/algorithm/string/find_iterator.hpp @@ -11,3 +11,14 @@ Work around -fsanitize=bool {} //! Constructor +--- boost/circular_buffer/debug.hpp ++++ boost/circular_buffer/debug.hpp +@@ -34,7 +34,7 @@ + + template + inline void do_fill_uninitialized_memory(T* data, std::size_t size_in_bytes) BOOST_NOEXCEPT { +- std::memset(static_cast(data), UNINITIALIZED, size_in_bytes); ++ if (size_in_bytes != 0) std::memset(static_cast(data), UNINITIALIZED, size_in_bytes); + } + + template