This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Add a CI job running MSAN
ClosedPublic

Authored by ldionne on Mar 2 2022, 2:50 PM.

Details

Reviewers
None
Group Reviewers
Restricted Project
Restricted Project
Commits
rGcb055e51f994: [libc++] Add a CI job running MSAN
Summary

For some reason, we've been going without a MSAN CI job, even though
even run-buildbot defined a generic-msan job. This must have been an
oversight that went unnoticed. Thanks to @EricWF for the catch.

Diff Detail

Event Timeline

ldionne created this revision.Mar 2 2022, 2:50 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 2 2022, 2:50 PM
Herald added a subscriber: arichardson. · View Herald Transcript
ldionne requested review of this revision.Mar 2 2022, 2:50 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 2 2022, 2:50 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
philnik added a subscriber: philnik.Mar 2 2022, 3:02 PM

I'm not sure this will be that easy. MSAN is tricky. According to documentation, even libc has to be instrumented for this to work properly. See https://clang.llvm.org/docs/MemorySanitizer.html#id11. And AFAIK we don't build libc on the nodes.

ldionne updated this revision to Diff 419161.Mar 30 2022, 8:34 AM

Add markup for failing tests in libunwind. I still think it's worth enabling for the libc++ tests.

Herald added a project: Restricted Project. · View Herald TranscriptMar 30 2022, 8:34 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript

I'm not sure this will be that easy. MSAN is tricky. According to documentation, even libc has to be instrumented for this to work properly. See https://clang.llvm.org/docs/MemorySanitizer.html#id11. And AFAIK we don't build libc on the nodes.

It also says they implement various interceptors for common libc functionality, and we don't use anything super fancy, so perhaps we'll be good! So far it looks like only libunwind is having trouble.

My guess is that all that's needed here are MSAN annotations around the functions written in inline assembly (saving/restoring all registers).

My guess is that all that's needed here are MSAN annotations around the functions written in inline assembly (saving/restoring all registers).

I'm really not familiar with those -- would you like to take a look? You can commandeer if you'd like.

Otherwise, I'll ship this once CI is green and we can tackle post-commit.

ldionne accepted this revision as: Restricted Project, Restricted Project.Mar 31 2022, 6:31 AM
This revision was not accepted when it landed; it landed in state Needs Review.Mar 31 2022, 6:31 AM
This revision was automatically updated to reflect the committed changes.