From bf4c7340f32c1e673e6a37b91fc65305757f52d1 Mon Sep 17 00:00:00 2001 From: zmiao Date: Tue, 7 Apr 2020 16:30:30 +0300 Subject: [build] Fix undefined behavour sanitizer (#16375) * [build] Fix integer overflow runtime error for core part Temporarily remove circle ci UBSAN build precondition * [build] Enable all of the ubsans [build] Check runtime error [build] Update UBSAN_OPTION * [build] Add UBSAN blacklist [build] Ignore system libraries [build] Ignore vendor library * [build] Fix implicit conversion runtime error in core * [build] Fix division by zero runtime error * [build] Add unfixed error to ubsan blacklist * [build] Make UBSAN halt on error Revert "Temporary remove build precondition" * [build] Fix division by zero error * [build] Make UBSAN officially work without FIXME prefix * [build] Fix implicit conversion from int64_t to uint64_t * [build] Rename style test json file name * Address review findings --- scripts/ubsan.blacklist | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 scripts/ubsan.blacklist (limited to 'scripts') diff --git a/scripts/ubsan.blacklist b/scripts/ubsan.blacklist new file mode 100644 index 0000000000..2248b00012 --- /dev/null +++ b/scripts/ubsan.blacklist @@ -0,0 +1,28 @@ +############################################################################# +# Ignore system libraries. +src:*/usr/* + +############################################################################# +# Mostly hash functions where integer overflow is OK. +src:*/mbgl/util/hash.hpp + +############################################################################# +# vendor libs + +# unsigned integer overflow: unsigned interger index in for loop +src:*/vendor/earcut.hpp/include/mapbox/earcut.hpp + +# unsigned integer overflow: hash function: str_hash +src:*/vendor/eternal/*/eternal.hpp + +# unsigned integer overflow +src:*/vendor/*/rapidjson/reader.h + +# division by zero: ill usage of test data in 'render-tests/filter/in', latitude shouldn't be +/-90 +src:*/vendor/*/geojsonvt/convert.hpp + +# Boost bug: Implicit conversion +src:*/include/boost/locale/utf.hpp + +# Boost bug: unsigned integer overflow +src:*/include/boost/crc.hpp \ No newline at end of file -- cgit v1.2.1