Combination of compile-time instrumentation and run-time checking
If you want to use sanitisers with libc++ you have to have libc++ compiled with that sanitiser
Sanitiser support in some languages
Support costs to consider
e.g. memory allocation/use checking
Some are cheap at run time (e.g. undefined behaviour), others are less so.
ubsan often compiles down to a single predict-false branch
Some have SafeStack-like ABI ????
Ship pre-compiled versions… on the side?
Multi-arch? We use for 32-bit, soft/hard, …
Scope: key libraries? All of base? Ports/packages?
ASAN is only 2x slower. MSAN is quick, no penalty. TSAN is hard, can be 5-10x slower.
Possible to have “ready to instrument libraries”?
Linux KASAN includes some built-in memory allocation (of zeroes) to support runtime decision
Up to 50% increase in binary size
Linux KASAN checks general memory allocation, heap allocation, perhaps BSS etc
Question: Can we shift sanitisation to LLVM IR?
ASAN gets speed up from being inserted into IR early, so it can be optimised
Might break some applications
Fancy scheme discussed
But are they better than multicrch???