This is an archive of the discontinued LLVM Phabricator instance.

Enable lsan test suite for darwin x86-64
ClosedPublic

Authored by fjricci on Apr 18 2017, 2:24 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

fjricci created this revision.Apr 18 2017, 2:24 PM
alekseyshl added inline comments.Apr 19 2017, 1:59 PM
test/lsan/lit.common.cfg
78 ↗(On Diff #95631)

I think it would be more sustainable to come up with the readable way to merge both Linux (line 71) and Darwin conditions into one.

I've been running this on some large internal FB programs, and I've found a couple issues with dyld memory which I think stem from the fact that sanitizer_procmaps_mac behaves differently than sanitizer_procmaps_linux. I'm also not very pleased with the performance, although I haven't dug into that too much yet.

I think I'll modify this patch to still enable the tests (to prevent regressions), but leave lsan disabled by default until I'm more confident things are working well.

fjricci updated this revision to Diff 95965.Apr 20 2017, 9:06 AM

Disable by default, but keep testing enabled

alekseyshl accepted this revision.Apr 20 2017, 2:05 PM
alekseyshl added inline comments.
test/lsan/lit.common.cfg
73 ↗(On Diff #95965)

Too many negatives :) maybe break it up?

supported_linux = config.host_os is 'Linux' and config.host_arch in ['x86_64', 'mips64', 'arm', 'armhf', 'armv7l']
supported_darwin = config.host_os is 'Darwin' and config.target_arch is 'x86_64'
if not (supported_linux or supported_darwin):
  config.unsupported = True
This revision is now accepted and ready to land.Apr 20 2017, 2:05 PM
fjricci added inline comments.Apr 20 2017, 2:07 PM
test/lsan/lit.common.cfg
73 ↗(On Diff #95965)

Didn't even think to use intermediate variables - will do

fjricci updated this revision to Diff 96018.Apr 20 2017, 2:17 PM

Refactor to address comments

fjricci retitled this revision from Enable lsan by default on 64-bit darwin, and enable lsan test suite to Enable lsan test suite for darwin x86-64.Apr 20 2017, 2:25 PM
kubamracek added inline comments.Apr 20 2017, 2:38 PM
test/asan/lit.cfg
44–45 ↗(On Diff #96018)

Does the ASan test suite pass with that? Specifically, the tests in Testcases/Darwin/?

This revision was automatically updated to reflect the committed changes.
fjricci added inline comments.Apr 20 2017, 2:45 PM
test/asan/lit.cfg
44–45 ↗(On Diff #96018)

They do on my local macbook, yes.

44–45 ↗(On Diff #96018)

(The failures there were addressed by this patch a while back: D31978)

fjricci reopened this revision.Apr 21 2017, 6:20 AM

Looks like this caused a large number of test failures. I'm a bit confused, since things worked fine locally, but I'm going to try to do a totally clean build with the buildbot config to see if I can repro.

This revision is now accepted and ready to land.Apr 21 2017, 6:20 AM

The failures still don't repro with a clean build, but it looks like I can just download the buildbot state from here: http://green.lab.llvm.org/green/job/clang-stage1-configure-RA/ws/, so hopefully I can cherry-pick into that and see the failures.

Well, looks like the zips that get downloaded are invalid zips, and extraction fails midway through. I've been looking into the actual failures, and it's actually a bit interesting. It's almost as if the tests are being run on a pretty old version of lsan, as pretty much all of the failures look like things that I've seen before and fixed (ie false-positive leaks from libxpc, etc).

Oh wow, it is. If you look in the source-code browser, it appears to be running on out-of-date code (note the CHECK(0 && "unimplemented") in StopTheWorld): http://green.lab.llvm.org/green/job/clang-stage1-configure-RA/ws/compiler-rt.src/lib/lsan/lsan_common_mac.cc

nvm, looks like the source browser is now up-to-date

This revision was automatically updated to reflect the committed changes.

Yeah, I xfail-ed those two tests for now to fix the buildbots, since I figure it's worth the test coverage (and this doesn't enable lsan by default outside the test suite anyway). Looking into the failures currently.

I'm running the tests in a "repeat while test passes" loop, and neither of them are failing for me on 10.11 or 10.12.

Looks like XFAIL doesn't work, because they pass in LeakSanitizer-AddressSanitizer, and are just very flaky in LeakSanitizer-Standalone, so they end up XPASS-ing. I'll move them to UNSUPPORTED to fix the buildbot, and then we can go from there. I don't think it's reverting all of the lsan test suite for 2 flaky tests that I can't repro on 10.11 or 10.12.