This is an archive of the discontinued LLVM Phabricator instance.

[msan] Add bsearch interceptor
ClosedPublic

Authored by vitalybuka on Aug 3 2021, 12:28 PM.

Details

Summary

Similar to qsort, bsearch can be called from non-instrumented
code of glibc. When it happends tls for arguments can be in uninitialized
state.

Unlike to qsort, bsearch does not move data, so we don't need to
check or initialize searched memory or key. Intrumented comparator will
do that on it's own.

Diff Detail

Event Timeline

vitalybuka requested review of this revision.Aug 3 2021, 12:28 PM
vitalybuka created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptAug 3 2021, 12:29 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript

clang-format and remove lambda

morehouse added inline comments.Aug 3 2021, 2:33 PM
compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
10047
vitalybuka updated this revision to Diff 363890.Aug 3 2021, 3:26 PM

qsort -> bsearch

vitalybuka marked an inline comment as done.Aug 3 2021, 3:26 PM
This revision is now accepted and ready to land.Aug 3 2021, 3:27 PM
This revision was landed with ongoing or failed builds.Aug 3 2021, 6:39 PM
This revision was automatically updated to reflect the committed changes.