This is an archive of the discontinued LLVM Phabricator instance.

tsan: disable munmap_invalid.cpp test on darwin
ClosedPublic

Authored by dvyukov on Dec 2 2021, 9:43 AM.

Diff Detail

Event Timeline

dvyukov requested review of this revision.Dec 2 2021, 9:43 AM
dvyukov created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptDec 2 2021, 9:43 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
melver accepted this revision.Dec 2 2021, 9:49 AM

Maybe Darwin kernel behaves a little differently here and crashes the program?
Maybe yln@ knows?

This revision is now accepted and ready to land.Dec 2 2021, 9:49 AM

Maybe Darwin kernel behaves a little differently here and crashes the program?
Maybe yln@ knows?

Also failed on clang-s390x-linux-lnt with similar symptoms.

I am not sure kernel must behave "atomically" here and either fail or unmap the whole range. Maybe on some arches it starts unmapping things and then realizes the range is bogus?...
I see mmap_stress.cpp says:

test/tsan/mmap_stress.cpp:// REQUIRES: linux, x86_64-target-arch

maybe we should do the same?

https://lab.llvm.org/buildbot#builders/45/builds/5224

******************** TEST 'ThreadSanitizer-s390x :: munmap_invalid.cpp' FAILED ********************
Script:
--
: 'RUN: at line 1';      /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/./bin/clang  -fsanitize=thread -Wall     -gline-tables-only -I/home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/llvm/compiler-rt/test/tsan/../ -O1 /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/llvm/compiler-rt/test/tsan/munmap_invalid.cpp -o /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/projects/compiler-rt/test/tsan/S390XConfig/Output/munmap_invalid.cpp.tmp &&  /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/projects/compiler-rt/test/tsan/S390XConfig/Output/munmap_invalid.cpp.tmp 2>&1 | FileCheck /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/llvm/compiler-rt/test/tsan/munmap_invalid.cpp
--
Exit Code: 137

Command Output (stderr):
--
/home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/projects/compiler-rt/test/tsan/S390XConfig/Output/munmap_invalid.cpp.script: line 1: 1719558 Broken pipe             /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/stage1/projects/compiler-rt/test/tsan/S390XConfig/Output/munmap_invalid.cpp.tmp 2>&1
     1719559 Killed                  | FileCheck /home/uweigand/sandbox/buildbot/clang-s390x-linux-lnt/llvm/compiler-rt/test/tsan/munmap_invalid.cpp

--

********************
dvyukov updated this revision to Diff 391562.Dec 3 2021, 12:03 AM

only enable the test on linux/x86_64

I will unblock the bots for now.

This revision was landed with ongoing or failed builds.Dec 3 2021, 12:03 AM
This revision was automatically updated to reflect the committed changes.
yln added a subscriber: yln.Dec 3 2021, 2:55 PM

Maybe yln@ knows?

Noticed this by accident! ;)

For this test we crash on Darwin even without TSan on this line:

void *p =
    mmap(0, 4096, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0);
munmap(p, (1ull << 60));  << we crash here; if commented out test succeeds
munmap(p, -10000);

lldb is not able to provide the stack trace.

It's probably easiest to leave this test disabled on Darwin for now.