Page MenuHomePhabricator

[MSAN] Update tests due to widespread eager checking
Needs ReviewPublic

Authored by guiand on Jul 8 2020, 2:18 PM.



Adds lit configuration to be able to test MSAN's interaction
with widespread eager checking due to clang emitting noundef attrs.

Diff Detail

Unit TestsFailed

710 mslinux > MemorySanitizer-eager-X86_64.MemorySanitizer-eager-X86_64::Unknown Unit Message ("")
Script: -- : 'RUN: at line 1'; /mnt/disks/ssd0/agent/llvm-project/build/./bin/clang --driver-mode=g++ -fsanitize=memory -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -m64 -mllvm -msan-eager-checks -DTEST_MSAN_EAGER_CHECKS -gline-tables-only -std=c++11 -O0 /mnt/disks/ssd0/agent/llvm-project/compiler-rt/test/msan/signal_stress_test.cpp -o /mnt/disks/ssd0/agent/llvm-project/build/projects/compiler-rt/test/msan/eager-X86_64/Output/signal_stress_test.cpp.tmp && /mnt/disks/ssd0/agent/llvm-project/build/projects/compiler-rt/test/msan/eager-X86_64/Output/signal_stress_test.cpp.tmp

Event Timeline

guiand created this revision.Jul 8 2020, 2:18 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJul 8 2020, 2:18 PM
Herald added subscribers: llvm-commits, Restricted Project, hiraditya, mgorny. · View Herald Transcript

Each of these can be a separate patch

Additionally introduces tests for:
- Bitfield handling
- Different sized function parameters
- MSAN and struct padding (when passing structs by value)

And It would be nice if you cut off some other pieces

guiand updated this revision to Diff 279894.Jul 22 2020, 11:22 AM
guiand edited the summary of this revision. (Show Details)

Kept only core of patch: adding new LIT configration for eager-checks

The patch is missing context

guiand updated this revision to Diff 279926.Jul 22 2020, 1:11 PM

Sorry about that. Reuploaded with full context.

eugenis added inline comments.Jul 22 2020, 1:26 PM

I think REQUIRES: makes more sense here.


This test becomes super confusing, I no longer understand all the combinations.
Why do you need explicit __msan_unpoison_param?
It would help to rename EXPECT_PASS and EXPECT_FAIL to reflect what they do (pass uninit or not) instead of what they expect to happen.

vitalybuka added inline comments.Aug 18 2020, 7:11 PM

is volatile needed here?
noinline should be enough?

guiand added inline comments.Oct 16 2020, 1:03 PM

I wasn't sure if just using noinline would also prevent the compiler from doing dead code elimination on a call to an empty function.


That's fair. I think this test could just be restored to its original state with the changes for noundef.