[PATCH] D15363: [UBSan] Implement runtime suppressions (PR25066).
Alexey Samsonov via cfe-commits
cfe-commits at lists.llvm.org
Tue Dec 8 16:54:31 PST 2015
samsonov created this revision.
samsonov added reviewers: rsmith, kcc.
samsonov added a subscriber: cfe-commits.
Add the ability to suppress UBSan reports for files/functions/modules
at runtime. The user can now pass UBSAN_OPTIONS=suppressions=supp.txt
with the contents of the form:
signed-integer-overflow:file-with-known-overflow.cpp
alignment:function_doing_unaligned_access
vptr:shared_object_with_vptr_failures.so
Suppression categories match the arguments passed to -fsanitize=
flag (although, see below). There is no overhead if suppressions are
not provided. Otherwise there is extra overhead for symbolization.
Limitations:
1) sometimes suppressions need debug info / symbol table to function
properly (although sometimes frontend generates enough info to
do the match).
2) it's only possible to suppress recoverable UB kinds - if you've
built the code with -fno-sanitize-recover=undefined, suppressions
will not work.
3) categories are fine-grained check kinds, not groups like "undefined"
or "integer", so you can't write "undefined:file_with_ub.cc".
http://reviews.llvm.org/D15363
Files:
lib/sanitizer_common/sanitizer_suppressions.h
lib/ubsan/ubsan_diag.cc
lib/ubsan/ubsan_diag.h
lib/ubsan/ubsan_handlers.cc
lib/ubsan/ubsan_handlers_cxx.cc
test/ubsan/TestCases/Integer/suppressions.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15363.42250.patch
Type: text/x-patch
Size: 15483 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151209/2e2c57b3/attachment-0001.bin>
More information about the cfe-commits
mailing list