Muokkaa

Jaa


AddressSanitizer error examples

We list a subset of the errors supported by AddressSanitizer in Microsoft C/C++ (MSVC) in this section. This list is not an exhaustive error list. It's meant to show several kinds of errors you'll see in AddressSanitizer. In each article, we've included example code with build instructions and screenshots of the debugger in action. They'll help you learn to use the AddressSanitizer features supported by MSVC in your code. All screenshots were generated by using devenv.exe /debugexe example.exe. Some of these examples are based on sample code in the LLVM compiler-rt test suite.

Build the error examples

Each error example provides source code and compilation instructions for a command-line build. To build each example, open a developer command prompt. Create a folder for your example project, then make it the current directory. Then copy the example code into a source file with the appropriate name, such as example1.cpp. Follow the build instructions to generate and run the instrumented code in the debugger.

Errors with examples

See also

AddressSanitizer overview
AddressSanitizer known issues
AddressSanitizer build and language reference
AddressSanitizer runtime reference
AddressSanitizer shadow bytes
AddressSanitizer cloud or distributed testing
AddressSanitizer debugger integration