You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The C & C++ languages are powerful, but they can suffer from different types of bugs which affect program correctness and program security. Starting with Visual Studio 2019 16.9, the Microsoft Visual C++ compiler and IDE support Address Sanitizer technology to help light up [hard-to-find bugs](#error-types).
13
+
The C & C++ languages are powerful, but they can suffer from different types of bugs which affect program correctness and program security. Starting with Visual Studio 2019 16.9, the Microsoft Visual C++ compiler and IDE support Address Sanitizer technology to help light up [hard-to-find bugs](#error-types) with zero false positives.
14
14
15
15
Using this flag can reduce your time spent on:
16
16
@@ -20,17 +20,19 @@ Using this flag can reduce your time spent on:
20
20
- Stress testing
21
21
- Integrating new source code
22
22
23
-
The Address Sanitizer is a compiler and runtime runtime [introduced by Google](https://www.usenix.org/conference/atc12/technical-sessions/presentation/serebryany). Starting with Visual Studio 2019 16.9 this technology is offered in the Visual C++ compiler toolchain. Many projects can enable Address Sanitizer with a project setting, or a single additional compiler switch. There are known limitations in certain (!!! link !!!) compilation modes (incremental linking, or the [/RTC](https://docs.microsoft.com/en-us/cpp/build/reference/rtc-run-time-error-checks?view=msvc-160)switch, for example), but otherwise all configurations of x86 and x64 are supported.
23
+
The Address Sanitizer is a compiler and runtime runtime [introduced by Google](https://www.usenix.org/conference/atc12/technical-sessions/presentation/serebryany). Starting with Visual Studio 2019 16.9 this technology is offered in the Visual C++ compiler tool chain. Many projects can enable Address Sanitizer with a project setting, or a single additional compiler switch. The new flag is compatible with all levels of optimization. There are conflicts in three compilation modes: [edit-and-continue](), [incremental linking](), and [/RTC](https://docs.microsoft.com/en-us/cpp/build/reference/rtc-run-time-error-checks?view=msvc-160)switches), otherwise all configurations of x86 and x64 are supported.
24
24
25
-
`-fsanitize=address` is a powerful alternative to [/RTC](https://docs.microsoft.com/en-us/cpp/build/reference/rtc-run-time-error-checks?view=msvc-160), and in addition to [/analyze](https://docs.microsoft.com/en-us/cpp/code-quality/code-analysis-for-c-cpp-overview?view=msvc-160), it provides run-time bug-finding technologies which leverage your existing build systems and existing test assets.
25
+
Compiling with `-fsanitize=address` is a powerful alternative to both [/RTC](https://docs.microsoft.com/en-us/cpp/build/reference/rtc-run-time-error-checks?view=msvc-160), and [/analyze](https://docs.microsoft.com/en-us/cpp/code-quality/code-analysis-for-c-cpp-overview?view=msvc-160). It provides run-time bug-finding technologies which leverage your existing build systems and existing test assets.
26
26
27
27
For CI/CD systems and Cloud based work flows, use the ASAN_SAVE_DUMPS environment variable to store crash dumps for post-mortem debugging specific to the Address Sanitizer.
28
28
29
-
By setting a new environment variable **`set ASAN_SAVE_DUMPS=”MyFileName.dmpx”`** your program will create a new type of dump file that will contain extra meta-data. These dump files can be an enabler for work flows requiring:
29
+
By setting a new environment variable via **`set ASAN_SAVE_DUMPS=”MyFileName.dmpx”`** your program will create a new type of dump file that will contain extra meta-data. These dump files can be displayed with Visual Studio using the new debugger IDE. These dump files can be an enabler for work flows requiring:
30
30
31
31
- On-premises testing
32
32
- Cloud based workflows for testing
33
33
34
+
These systems can store these dump files off line, with **precisely diagnosed bugs** which can be viewed against your source code, in the IDE.
35
+
34
36
## Installing the Address Sanitizer
35
37
36
38
Simply [**install the Address Sanitizer functionality**]().
@@ -46,6 +48,7 @@ Microsoft recommends using the Address Sanitizer in these **three standard workf
46
48
- Visual Studio - [Command line](#Using-the-Address-Sanitizer-from-a-Developer-Command-Prompt)
47
49
- Visual Studio - [Project system](#Using-the-Address-Sanitizer-from-Visual-Studio)
48
50
- Visual Studio - [CMake]([CMake](#Using-the-Address-Sanitizer-from-Visual-Studio:-CMake))
51
+
49
52
50
53
-**CI/CD** - continuous integration / continuous development
This article will cover the information needed to enable the three workflows listed above. The information will be specific to the **platform dependent** Windows 10 implementation and supplement existing documentation from [Google, Apple and GCC](#Google,-Apple-and-GCC-documentation).
60
+
This article will cover the information needed to enable the three workflows listed above. The information will be specific to the **platform dependent** Windows 10 implementation of the Address Sanitizer and supplement existing documentation from [Google, Apple and GCC](#Google,-Apple-and-GCC-documentation).
58
61
59
62
> [!NOTE] Current support is limited to x86 and AMD64 on Windows 10. **Customer feedback** would help us prioritize shipping these sanitizers in the future: -fsanitize=thread, -fsanitize=leak, -fsanitize=memory, -fsanitize=hwaddress or -fsanitize=undefined.
0 commit comments