This is an archive of the discontinued LLVM Phabricator instance.

[Sanitizer] Disable LSan when testing on iOS simulators
ClosedPublic

Authored by yln on Dec 15 2021, 11:46 AM.

Details

Summary

LSan (ASAN_OPTIONS=detect_leaks=1) is supported on macOS, but disabled
by default on Darwin (SANITIZER_MAC):

COMMON_FLAG(bool, detect_leaks, !SANITIZER_MAC, "Enable memory leak detection.")

We enable it here for ASan tests to prevent regressions (per comment).
However, LSan is not supported for the iOS simulator and the tests fail
when it is enabled.

Make this "Is macOS?" check more precise since the current one (`Darwin
&& x86_64`) has two issues:

  • Includes the simulators
  • Excludes macOS on Apple Silicon

This will allow us to (re)enable simulator testing on Green dragon to
give open source better feedback about sanitizer changes:
https://green.lab.llvm.org

rdar://86529234

Diff Detail

Unit TestsFailed

Event Timeline

yln created this revision.Dec 15 2021, 11:46 AM
yln requested review of this revision.Dec 15 2021, 11:46 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 15 2021, 11:46 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
This revision is now accepted and ready to land.Dec 16 2021, 12:31 PM
This revision was landed with ongoing or failed builds.Dec 16 2021, 12:38 PM
This revision was automatically updated to reflect the committed changes.