4 ms·
Good one, thanks. Note that it requires Clang; GCC 12.2 doesn't have it.
by hddqsb 4y ago
Good one, thanks. Note that it requires Clang; GCC 12.2 doesn't have it.
- gavinray 4y agoWow nice, I didn't know about this one. I can add some more which are less known. This is my current sanitize invocation (minus the addition of "integer" which I'll be adding, unless one of these other ones covers it): -fsanitize=address,leak,undefined,cfi,function CFI has checks for unrelated casts and mismatched vtables which is very useful. It requires that you pass -flto or -flto=thin and -fvisibility=hidden. You can read a comparison with -fsanitize=function here: https://clang.llvm.org/docs/ControlFlowIntegrity.html#fsanitize-cfi-icall-and-fsanitize-function https://clang.llvm.org/docs/ControlFlowIntegrity.html#fsanit... There's also TypeSanitizer, which isn't officially released, but is really interesting and should be able to be applied via a patch from the branch: https://www.youtube.com/watch?v=vAXJeN7k32Y https://www.youtube.com/watch?v=vAXJeN7k32Y https://reviews.llvm.org/D32199 https://reviews.llvm.org/D32199 $ curl -L 'https://reviews.llvm.org/D32199?download=1' | patch -p1
- nwellnhof 4y agoI think "leak" is always enabled by "address". It's only useful if you want run LeakSanitizer in stand-alone mode. "integer" is only enabled on demand because it warns about well-defined (but still dangerous) code. You can also enable "unsigned-integer-overflow" and "implicit-conversion" separately. See https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#available-checks https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#...
- gavinray 4y agoAh I wasn't sure if LSAN was always enabled with ASAN, good to know -- ty!