This is an archive of the discontinued LLVM Phabricator instance.

[asan] Relax a flaky invalid-pointer-pairs test
ClosedPublic

Authored by zaks.anna on Jun 21 2016, 6:34 PM.

Details

Summary

This test is flaky. Specifically, on some Mac configurations we see the __sanitizer_ptr_cmp as the 0th frame. Let's relax it to not require that f is in frame #0.

61396==ERROR: AddressSanitizer: invalid-pointer-pair: 0x01e00510 0x01e004d0

#0 0x18f5a3 in __sanitizer_ptr_cmp ... libclang_rt.asan_osx_dynamic.dylib+0xaf5a3)
#1 0xdd924 in f(char, char*, char*) ... invalid-pointer-pairs.cc:14:14

Diff Detail

Event Timeline

zaks.anna updated this revision to Diff 61482.Jun 21 2016, 6:34 PM
zaks.anna retitled this revision from to [asan] Relax a flaky invalid-pointer-pairs test.
zaks.anna updated this object.
zaks.anna added reviewers: filcab, kubamracek.
zaks.anna added subscribers: aizatsky, llvm-commits.
filcab accepted this revision.Jun 22 2016, 5:27 AM
filcab edited edge metadata.

LGTM.

Do you have any idea why we get this difference? Would be nice to know, and possibly to account for.

Thank you,

Filipe

This revision is now accepted and ready to land.Jun 22 2016, 5:27 AM

Do you have any idea why we get this difference? Would be nice to know, and possibly to account for.

Unfortunately, I don't know. I do know that we call llvm-symbolizer in both cases, so it's either the inconsitancy in that or the debug info.

This revision was automatically updated to reflect the committed changes.
kubamracek edited edge metadata.Jun 26 2016, 12:50 PM

Do you have any idea why we get this difference? Would be nice to know, and possibly to account for.

This is due to INLINE on CheckForInvalidPointerPair. The function doesn’t get inlined in Debug builds, and the inlining is not even guaranteed for Release builds. If we never need the __sanitizer_ptr_cmp frame, we should use ALWAYS_INLINE, which seems to resolve the issue as well.