This is an archive of the discontinued LLVM Phabricator instance.

sanitizer_common: add test that calls wcslen
ClosedPublic

Authored by thurston on May 19 2023, 2:32 PM.

Details

Summary

This is a very simple test that calls wsclen. There are currently no other HWASan tests that call wsclen, which is why the wcslen interceptor issue (triggered by https://reviews.llvm.org/D150708 and fixed in https://reviews.llvm.org/D150909) was only detected by stage2/hwasan check on the buildbots. With this test, the issue would have been caught by stage1 check-sanitizer, with a more obvious diagnosis.

Diff Detail

Event Timeline

thurston created this revision.May 19 2023, 2:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 19 2023, 2:32 PM
Herald added a subscriber: Enna1. · View Herald Transcript
thurston requested review of this revision.May 19 2023, 2:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 19 2023, 2:32 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
vitalybuka accepted this revision.May 19 2023, 3:54 PM
vitalybuka added inline comments.
compiler-rt/test/sanitizer_common/TestCases/wcslen_test.c
2

-O0 to make sure compiler will not optimize this out?

This revision is now accepted and ready to land.May 19 2023, 3:54 PM
thurston updated this revision to Diff 523958.May 19 2023, 4:06 PM

Add -O0 flag, per Vitaly's suggestion

thurston marked an inline comment as done.May 19 2023, 4:06 PM
thurston added inline comments.
compiler-rt/test/sanitizer_common/TestCases/wcslen_test.c
2

Done

This revision was automatically updated to reflect the committed changes.
thurston marked an inline comment as done.