AddressSanitizer known issues
Note
Send us feedback on what you'd like to see in future releases, and report bugs if you run into issues.
Incompatible options and functionality
These options and functionality are incompatible with /fsanitize=address and should be disabled or avoided.
- The
/RTCoptions are incompatible with AddressSanitizer and should be disabled. - Incremental linking is unsupported, and should be disabled.
- Edit-and-Continue is unsupported, and should be disabled.
- Coroutines are incompatible with AddressSanitizer, and resumable functions are exempt from instrumentation.
- OpenMP is unsupported, and should be disabled.
- Managed C++ is unsupported, and should be disabled.
- C++ AMP is unsupported, and should be disabled.
- Universal Windows Platform (UWP) applications are unsupported.
- Special case list files are unsupported.
Standard library support
The MSVC standard library (STL) isn't enlightened to understand the AddressSanitizer. AddressSanitizer exceptions raised in STL code do identify true bugs. However, they aren't as precise as they could be.
This example demonstrates the lack of precision:
// Compile with: cl /fsanitize=address /Zi
#include <vector>
int main() {
// Create a vector of size 10, but with a capacity of 20.
std::vector<int> v(10);
v.reserve(20);
// Currently, MSVC ASan does NOT raise an exception here.
// While this is an out-of-bounds write to 'v', MSVC ASan
// ensures the write is within the heap allocation size (20).
v[10] = 1;
// MSVC ASan DOES raise an exception here, as this write
// is out of bounds from the heap allocation.
v[20] = 1;
}
Windows versions
As there are dependencies with specific Windows versions, support is focused on Windows 10. MSVC AddressSanitizer was tested on 10.0.14393 (RS1), and 10.0.21323 (pre-release insider build). Report a bug if you run into issues.
Memory usage
The AddressSanitizer runtime doesn't release memory back to the OS during execution. From the OS's point of view, it may look like there's a memory leak. This design decision is intentional, so as not to allocate all the required memory up front.
AddressSanitizer runtime DLL locations
The clang_rt.asan*.dll runtime files are installed next to the compilers in %VSINSTALLDIR%\VC\Tools\MSVC\<version>\bin\<host-arch>\<target-arch>\. These locations are on the path in debugging sessions, and in Visual Studio developer command prompts. These files are never placed in C:\Windows\System32 or C:\Windows\SysWOW64.
Custom property sheet support
The Property Manager window in the Visual Studio IDE allows you to add custom .props files to your projects. Even though the Enable Address Sanitizer property (<EnableASAN>) is shown, it's not honored by the build. That's because the custom .props files get included after Microsoft.cpp.props, which uses the <EnableASAN> value to set other properties.
As a workaround, you can create a Directory.Build.props file in the root of your project to define the <EnableASAN> property. For more information, see Customize C++ builds.
See also
AddressSanitizer overview
AddressSanitizer build and language reference
AddressSanitizer runtime reference
AddressSanitizer shadow bytes
AddressSanitizer cloud or distributed testing
AddressSanitizer debugger integration
AddressSanitizer error examples