vscode-swift icon indicating copy to clipboard operation
vscode-swift copied to clipboard

Add options to enable thread/address sanitizer

Open adam-fowler opened this issue 2 years ago • 2 comments

Slightly more complex than just adding --sanitize=thread to swift build command line. Need to set environment variable DYLD_INSERT_LIBRARIES to point to sanitizer library (on macOS) when running tests.

Not totally sure how to get path to sanitizer library. On macOS with Xcode 13 installed it is /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/13.0.0/lib/darwin/libclang_rt.tsan_osx_dynamic.dylib

adam-fowler avatar Jan 04 '22 08:01 adam-fowler

Note: TSAN is not available on Windows, ASAN however is (though it may require some work in packaging to make easier to use). I think that the packaging stuff should be relatively easy to tackle when ready (i.e. the functionality is easy to use).

compnerd avatar Mar 03 '22 03:03 compnerd

I have code for this but TestExplorer can get into a very bad situation where it leaves an SPM process running for ever. See https://bugs.swift.org/browse/SR-16079 so don't want to add this yet

adam-fowler avatar Apr 13 '22 15:04 adam-fowler

#542

adam-fowler avatar May 30 '23 11:05 adam-fowler