This is an archive of the discontinued LLVM Phabricator instance.

sanitizers: Implement sig{and,or}set interceptors
ClosedPublic

Authored by guiand on Jun 23 2020, 2:10 PM.

Details

Summary

Also adds a sanitizers-wide test, and a msan test, for these functions.

Diff Detail

Event Timeline

guiand created this revision.Jun 23 2020, 2:10 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 23 2020, 2:10 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript

The sanitizer_common test seems excessive, but I'm inclined to take it anyway simply because it costs us very little to have it there.

compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
4013

These are glibc extensions, move them under a different, linux-only macro.

compiler-rt/test/msan/sigandorset.cpp
26 ↗(On Diff #272822)

Test that "s" is now considered initialized.
Move the test case under Linux.

compiler-rt/test/sanitizer_common/TestCases/Linux/signal_send.cpp
11

unused function

52

WIFEXITED

guiand updated this revision to Diff 272848.Jun 23 2020, 3:36 PM

Addressed comments

guiand marked 3 inline comments as done.Jun 23 2020, 3:37 PM
vitalybuka added inline comments.Jul 6 2020, 10:29 PM
compiler-rt/test/sanitizer_common/TestCases/Linux/signal_send.cpp
38

why do you need to fork
isn't simple test similar to msan is not enough?

guiand marked an inline comment as done.Jul 7 2020, 9:41 AM
guiand added inline comments.
compiler-rt/test/sanitizer_common/TestCases/Linux/signal_send.cpp
38

I figured I'd have a test to check the actual behavior and see if it's working correctly (this one) and one that just checks things are initialized correctly (the msan one). This one has the added benefit of testing a few of the other signal functions for all the sanitizers too :)

vitalybuka accepted this revision.Jul 17 2020, 12:21 AM
This revision is now accepted and ready to land.Jul 17 2020, 12:21 AM