gecko-dev/mfbt
Christian Holler b8ee76ebd8 Bug 1373256 - Changes to support -fsanitize=integer in the codebase. r=froydnj
The -fsanitize=integer analysis from UBSan can be helpful to detect signed and unsigned integer overflows in the codebase. Unfortunately, those occur very frequently, making it impossible to test anything with it without the use of a huge blacklist. This patch includes a blacklist that is broad enough to silence everything that would drain performance too much. But even with this blacklist, neither tests nor fuzzing is "clean". We can however in the future combine this with static analysis to limit ourselves to interesting places to look at, or improve the dynamic analysis to omit typical benign overflows.

It also adds another attribute that can be used on functions. It is not used right now because it was initially easier to add things to the compile-time blacklist to get started.

Finally, it includes a runtime suppression list and patches various parts in the test harnesses to support that. It is currently empty and it should not be used on frequent overflows because it is expensive. However, it has the advantage that it can be used to differentiate between signed and unsigned overflows while the compile-time blacklist cannot do that. So it can be used to e.g. silence unsigned integer overflows on a file or function while still reporting signed issues. We can also use this suppression list for any other UBSan related suppressions, should we ever want to use other features from that sanitizer.

MozReview-Commit-ID: C5ofhfJdpCS

--HG--
extra : rebase_source : 952043a441b41b2f58ec4abc51ac15fa71fc142f
2017-04-09 12:59:26 +02:00
..
decimal Bug 1332797 - Move mfbt/double-conversion source files into a new source/ subdirectory, to segregate upstream files from update.sh and our local patches. r=froydnj 2017-01-23 15:11:50 -08:00
double-conversion Bug 1332797 - Delete the temporary directory used to store the double-conversion clone when all's said and done. r=froydnj 2017-01-26 13:26:40 -08:00
staticruntime
tests Bug 1373525 - mfbt: Use unused GetPrev() member function in DoublyLinkedList test. r=froydnj 2017-06-11 14:39:42 -07:00
Alignment.h Bug 1341951 - Remove mozilla::AlignedStorage, and inline its sole use into js::jit::RInstructionStorage. r=nbp 2017-02-22 18:27:51 -08:00
AllocPolicy.h
AlreadyAddRefed.h Bug 1162335 - Remove already_AddRefed::MatchNullptr. r=froydnj 2017-06-01 15:01:40 +10:00
Array.h Bug 1319626 - Part 2: Add BorderLayer class and basic support for them. r=mstange 2016-11-24 18:11:30 +13:00
ArrayUtils.h
Assertions.cpp Bug 1338574 - Assertions.cpp can't use MOZ_CRASH_ANNOTATE, so set the crash reason directly. r=froydnj 2017-02-22 15:42:00 -05:00
Assertions.h Bug 1369622 - Add a static_assert when no variadic argument is given to MOZ_CRASH_UNSAFE_PRINTF. r=froydnj 2017-06-02 15:11:47 +09:00
Atomics.h Bug 1363426 - part 3 - minor cleanups to Atomics.h; r=erahm 2017-05-10 09:58:28 -04:00
Attributes.h Bug 1373256 - Changes to support -fsanitize=integer in the codebase. r=froydnj 2017-04-09 12:59:26 +02:00
BinarySearch.h
BloomFilter.h
BufferList.h Bug 1373579: Part 3 - Require fallible Init method rather than infallible constructor when using fallible allocator. r=billm 2017-06-20 12:06:13 -07:00
Casting.h Bug 1295611 - Add mozilla::Span. r=froydnj,gerv. 2017-03-31 13:32:18 +03:00
ChaosMode.cpp
ChaosMode.h
Char16.h Bug 1353593 - Part 1: Allow implicit conversion of non-const char16ptr_t to wchar*. r=froydnj 2017-06-12 16:20:47 -07:00
CheckedInt.h Bug 1350790 - Add constexpr to CheckedInt. r=froydnj 2017-03-27 10:59:31 +08:00
Compiler.h Bug 1322792 - require GCC 4.9 to build; r=glandium 2016-12-23 05:47:31 -05:00
Compression.cpp Bug 1345331: Include <intrin.h> at top-level before lz4.c can include it in a namespace. r=Waldo 2017-03-09 15:11:15 +13:00
Compression.h
DebugOnly.h
DoublyLinkedList.h Bug 935809 - Part 0: Include assertion header in DoublyLinkedList.h. r=waldo 2017-05-03 19:22:39 -07:00
EndianUtils.h
EnumeratedArray.h Initial import of Advanced Layers. (bug 1365879 part 20, r=bas) 2017-06-23 14:23:12 -07:00
EnumeratedRange.h
EnumSet.h
EnumTypeTraits.h
FastBernoulliTrial.h
FloatingPoint.cpp
FloatingPoint.h
GuardObjects.h
HashFunctions.cpp
HashFunctions.h Bug 1312001 - Scramble hash codes securely, to avoid leaking bits of object and symbol addresses. 2016-11-30 15:31:56 -06:00
IndexSequence.h Bug 1287006 - Adjust media/ code to not pass Maybe (or any class containing a Maybe member) by value, only by reference or pointer. r=jw_wang, r=rjesup 2017-02-13 09:07:40 -08:00
IntegerPrintfMacros.h Bug 1357873 - Fix up 64-bit Android macros in IntegerPrintfMacros.h; r=Waldo 2017-05-01 14:46:00 -04:00
IntegerRange.h Bug 1315274 - rename mozilla::MakeRange to mozilla::IntegerRange; r=Waldo 2017-01-06 09:22:53 -05:00
IntegerTypeTraits.h
JSONWriter.cpp
JSONWriter.h
Likely.h
LinkedList.h Bug 1359653: Part 3 - Add a clear() method and move asssignment operator to AutoCleanLinkedList. r=waldo 2017-05-02 17:54:18 -07:00
LinuxSignal.h
lz4.c
lz4.h
MacroArgs.h Bug 1369622 - Fix MOZ_FOR_EACH with an empty list. r=froydnj 2017-06-02 14:53:54 +09:00
MacroForEach.h Bug 1368932 - Allow MOZ_PASTE_PREFIX_AND_ARG_COUNT to work with 0 arguments. r=froydnj 2017-05-25 15:47:21 +09:00
MathAlgorithms.h
Maybe.h Bug 1356063 - Make Maybe<T> inherit static analysis annotations from T, r=mystor 2017-04-13 11:35:01 -07:00
MaybeOneOf.h Bug 1339555 - Make various operator-news into a known-non-null pointer use a ::operator new overload that odesn't null-check. r=froydnj 2017-02-14 11:23:18 -08:00
MemoryChecking.h
MemoryReporting.h
Move.h
moz.build Bug 1331718 - Part 1: Add small pointer array. r=froydnj 2017-05-10 05:07:37 +02:00
NotNull.h Bug 1374629 - Ensure that mozilla::NotNull has zero space overhead. r=njn 2017-06-22 00:52:28 +09:00
NullPtr.h
objs.mozbuild Bug 1332797 - Move mfbt/double-conversion source files into a new source/ subdirectory, to segregate upstream files from update.sh and our local patches. r=froydnj 2017-01-23 15:11:50 -08:00
Opaque.h
OperatorNewExtensions.h
Pair.h
PodOperations.h
Poison.cpp Bug 1158445 - posix_madvise() should be used instead of madvise on Solaris. r=froydnj, r=jandem 2017-06-09 00:59:32 -07:00
Poison.h
Range.h Bug 1295611 - Add mozilla::Span. r=froydnj,gerv. 2017-03-31 13:32:18 +03:00
RangedArray.h
RangedPtr.h Bug 1319740 - Parametrize ComputeSingleDisplayName based on the character type of the key string, and iterate through the string using iterators, not using null-termination. r=arai 2016-12-02 14:02:36 -08:00
ReentrancyGuard.h
RefCounted.h Bug 1313351 - Fix js::RefCounted to not do leak checking. r=jandem 2016-12-23 21:13:26 +01:00
RefCountType.h
RefPtr.h Bug 1354642 - Add MakeRefPtr<> helper class. r=Ehsan 2017-04-07 15:08:42 -04:00
Result.h Bug 1325073 - Rename mozilla::MakeGenericErrorResult to mozilla::Err. r=Waldo 2017-03-08 13:33:07 +00:00
ReverseIterator.h
RollingMean.h
Saturate.h
Scoped.h
ScopeExit.h
SegmentedVector.h Bug 1358761 - replace PurpleBlock with SegmentedVector to reduce indirect memory accesses when calling suspect, r=mccr8,nfroyd 2017-05-05 00:49:22 +03:00
SHA1.cpp
SHA1.h
SizePrintfMacros.h Bug 1368406 Use non-Windows Printf Format Specifiers in MinGW r=froydnj 2017-05-29 00:38:57 -05:00
SmallPointerArray.h Bug 1331718 - Part 1: Add small pointer array. r=froydnj 2017-05-10 05:07:37 +02:00
Span.h Bug 1359874 - Make Span::Elements() always return a non-null pointer. r=froydnj. 2017-06-13 13:22:34 +03:00
SplayTree.h
Sprintf.h Bug 1334279 - mark vsprintf-likes with MOZ_FORMAT_PRINTF; r=froydnj 2017-05-04 12:10:19 -06:00
StaticAnalysisFunctions.h
STYLE Bug 1332797 - Move mfbt/double-conversion source files into a new source/ subdirectory, to segregate upstream files from update.sh and our local patches. r=froydnj 2017-01-23 15:11:50 -08:00
TaggedAnonymousMemory.cpp
TaggedAnonymousMemory.h
TemplateLib.h Bug 1338374 - Make tl::Min/Max variadic. r=froydnj 2017-01-30 15:56:05 -08:00
ThreadLocal.h merge mozilla-inbound to mozilla-central a=merge 2017-04-26 08:41:31 +02:00
ToString.h
Tuple.h
TypedEnumBits.h
Types.h
TypeTraits.h Bug 1318677 part 3 - mozilla::Result: Add a new packing strategy to pack small enumerated values in a single word. r=Waldo 2017-02-07 18:57:43 +00:00
UniquePtr.h
UniquePtrExtensions.h
Unused.cpp
Unused.h Bug 1368616 - Error compiling TestBlockingProcess.exe with MinGW: undefined reference to _imp___ZN7mozilla6UnusedE r=froydnj 2017-06-21 11:47:11 +02:00
Variant.h Bug 1365802 - In VariantImplementation::moveConstruct, move the aRhs rvalue to the next moveConstruct - r=froydnj 2017-05-18 15:39:40 +12:00
Vector.h Bug 1352073: Fix off-by-one in Vector::insert; r=luke 2017-03-30 16:20:30 +02:00
WeakPtr.h Backed out 12 changesets (bug 1356103) for build bustage at PostTraversalTask.h 2017-05-04 17:56:25 +08:00
WindowsVersion.h Bug 1368150: Add IsWindows10BuildOrNewer to MFBT; r=froydnj 2017-06-06 11:14:58 -06:00
XorShift128PlusRNG.h