This is an archive of the discontinued LLVM Phabricator instance.

[DFSan] Fix flakey release_shadow_space.c accounting for Origin chains.
ClosedPublic

Authored by browneee on Oct 10 2021, 11:14 PM.

Details

Summary

Test sometimes fails on buildbot (after two non-Origins executions):

/usr/bin/ld: warning: Cannot export local symbol 'dfsan_flush'
RSS at start: 4620, after mmap: 107020, after mmap+set label: 209424, after fixed map: 4624, after another mmap+set label: 209424, after munmap: 4624
/usr/bin/ld: warning: Cannot export local symbol 'dfsan_flush'
RSS at start: 4620, after mmap: 107020, after mmap+set label: 209424, after fixed map: 4624, after another mmap+set label: 209424, after munmap: 4624
/usr/bin/ld: warning: Cannot export local symbol 'dfsan_flush'
RSS at start: 4620, after mmap: 107020, after mmap+set label: 317992, after fixed map: 10792, after another mmap+set label: 317992, after munmap: 10792
release_shadow_space.c.tmp: /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/dfsan/release_shadow_space.c:91: int main(int, char **): Assertion `after_fixed_mmap <= before + delta' failed.

Diff Detail

Event Timeline

browneee created this revision.Oct 10 2021, 11:14 PM
browneee requested review of this revision.Oct 10 2021, 11:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 10 2021, 11:15 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
browneee added inline comments.Oct 10 2021, 11:18 PM
compiler-rt/test/dfsan/release_shadow_space.c
100–101

Note: This delta could probably be reduced (maybe removed?), but I won't change it in this CL.

browneee added inline comments.Oct 10 2021, 11:25 PM
compiler-rt/test/dfsan/release_shadow_space.c
100–101

Another more revealing test failure log:

/usr/bin/ld: warning: Cannot export local symbol 'dfsan_flush'
RSS at start: 2516, after mmap: 104916, after mmap+set label: 207320, after fixed map: 2520, after another mmap+set label: 207320, after munmap: 2520
/usr/bin/ld: warning: Cannot export local symbol 'dfsan_flush'
RSS at start: 4552, after mmap: 106952, after mmap+set label: 209356, after fixed map: 4556, after another mmap+set label: 209356, after munmap: 4556
/usr/bin/ld: warning: Cannot export local symbol 'dfsan_flush'
RSS at start: 4552, after mmap: 106952, after mmap+set label: 313836, after fixed map: 6636, after another mmap+set label: 313836, after munmap: 6636
/usr/bin/ld: warning: Cannot export local symbol 'dfsan_flush'
RSS at start: 4552, after mmap: 106952, after mmap+set label: 317924, after fixed map: 10724, after another mmap+set label: 317924, after munmap: 10724
release_shadow_space.c.tmp: /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/test/dfsan/release_shadow_space.c:91: int main(int, char **): Assertion `after_fixed_mmap <= before + delta' failed.
  • It looks like the origin chain data is more like 6636-4556 = 2080kb
  • The delta should not be removed, there is some variation even in the first two executions (no origin chain involved).
  • The delta can be fairly large 10724-6636=4088kb (possibly larger in some cases, so keeping at 5000 seems reasonable)
browneee updated this revision to Diff 378574.Oct 10 2021, 11:26 PM

Reduce estimate for origin chain size.

vitalybuka accepted this revision.Oct 11 2021, 12:26 AM

Sorry, just noticed this.

This revision is now accepted and ready to land.Oct 11 2021, 12:26 AM