This is an archive of the discontinued LLVM Phabricator instance.

[sanitizer] Add strchr* to the common interceptors
ClosedPublic

Authored by bruening on Mar 21 2016, 1:45 PM.

Details

Reviewers
samsonov
eugenis
Summary

Adds strchr, strchrnul, and strrchr to the common interceptors, under a new
common flag intercept_strchr.

Removes the now-duplicate strchr interceptor from asan and all 3
interceptors from tsan. Previously, asan did not intercept strchrnul, but
does now; previously, msan did not intercept strchr, strchrnul, or strrchr,
but does now.

Diff Detail

Event Timeline

bruening updated this revision to Diff 51222.Mar 21 2016, 1:45 PM
bruening retitled this revision from to [sanitizer] Add strchr* to the common interceptors.
bruening updated this object.
bruening added a reviewer: eugenis.
bruening added subscribers: kcc, llvm-commits, zhaoqin.
bruening edited reviewers, added: samsonov; removed: eugenis.Mar 21 2016, 1:45 PM
eugenis accepted this revision.Mar 21 2016, 2:11 PM
eugenis added a reviewer: eugenis.
eugenis added a subscriber: eugenis.

LGTM

This revision is now accepted and ready to land.Mar 21 2016, 2:11 PM

Thank you for the review. I am not yet an LLVM committer: could you commit this for me? Thank you.

eugenis closed this revision.Mar 21 2016, 2:41 PM

r263992

OK, a Windows test fails and needs an additional patch -- it will take me some time to set up the Windows environment. Let me know whether you're waiting on me to create that patch.

I can try doing what the test output suggests, maybe that will fix it.

Presumably just adding this to projects/compiler-rt/lib/asan/asan_win_dll_thunk.cc should do it:

INTERCEPT_LIBRARY_FUNCTION(strrchr);

Yes, r263998
Lets see if it helps.