This is an archive of the discontinued LLVM Phabricator instance.

[asan] suppress new-delete-type-mismatch per ASAN_OPTIONS suppressions settings
Needs ReviewPublic

Authored by sberg on Jun 15 2016, 6:40 AM.

Details

Reviewers
kcc
eugenis

Diff Detail

Event Timeline

sberg updated this revision to Diff 60829.Jun 15 2016, 6:40 AM
sberg retitled this revision from to [asan] suppress new-delete-type-mismatch per ASAN_OPTIONS suppressions settings.
sberg updated this object.
sberg added a reviewer: kcc.
sberg added a subscriber: llvm-commits.
sberg added a comment.Jun 15 2016, 6:42 AM

I had asked previously about this topic at http://lists.llvm.org/pipermail/cfe-dev/2016-June/049387.html "[cfe-dev] ASan: suppress new-delete-type-mismatch via ASAN_OPTIONS suppressions?" but got no answer there, so thought I'd go ahead with a patch.

adding more reviewers as I'll be OOO.

In general, I don't mind, but see my comments.

test/asan/TestCases/allocator-suppressions.cc
1

this test may need to be moved to test/asan/TestCases/Linux
or simply be made part of test/asan/TestCases/Linux/new_delete_mismatch.cc
There were problems with new-delete mismatch on other platforms due to ]
different interception mechanisms.

Also, a better test would have to bugs, one suppressed and one not.
Otherwise we may miss a bug where a suppression will match any stack trace.

4

the bug type prefix should clearly be different (new_delete_type_mismatch or some such)

vitalybuka added a subscriber: vitalybuka.
sberg added inline comments.Aug 24 2016, 2:37 AM
test/asan/TestCases/allocator-suppressions.cc
4

what do you mean with "bug type prefix"?

kcc added inline comments.Aug 24 2016, 5:30 PM
test/asan/TestCases/allocator-suppressions.cc
4

every suppression entry has a suppression type followed by the wildcard
http://clang.llvm.org/docs/SanitizerSpecialCaseList.html#format

What you are trying to do is clearly unrelated to "interceptor_via_fun" suppression type

sberg added a comment.Aug 25 2016, 6:16 AM

(Please also see the question about documentation I had raised at http://lists.llvm.org/pipermail/cfe-dev/2016-June/049648.html.)

test/asan/TestCases/allocator-suppressions.cc
4

I'd assumed ASan's operator new/delete interception could be considered interception, too, so the existing interceptor_via_{fun,src} would fit. So we'd need a pair of new_delete_type_mismatch_via_{fun,src} suppression types?

kcc added a comment.Aug 25 2016, 10:05 AM

Looking at it more carefully I think it should look like

src:/my/path/*=new_delete_type_mismatch
fun:foo*=new_delete_type_mismatch