|
| 1 | +--- |
| 2 | +title: "AddressSanitizer error reference" |
| 3 | +description: "Top-level description of the AddressSanitizer errors and examples in Microsoft C/C++." |
| 4 | +ms.date: 03/01/2021 |
| 5 | +helpviewer_keywords: ["ASan error examples", "AddressSanitizer error examples", "Address Sanitizer error examples", "Error examples for AddressSanitizer"] |
| 6 | +--- |
| 7 | +# AddressSanitizer error examples |
| 8 | + |
| 9 | +In this section, we list a set of the errors supported by AddressSanitizer in Microsoft C/C++ (MSVC). In each article, we've ported some examples that help you learn to use the AddressSanitizer features supported by MSVC in your code. These examples are based on sources in the [LLVM compiler-rt test suite](https://github.com/llvm/llvm-project/tree/main/compiler-rt/test/asan/TestCases). |
| 10 | + |
| 11 | +## Build the error examples |
| 12 | + |
| 13 | +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. |
| 14 | + |
| 15 | +## Errors with examples |
| 16 | + |
| 17 | +- [Error: `alloc-dealloc-mismatch`](./error-alloc-dealloc-mismatch.md) |
| 18 | + |
| 19 | +- [Error: `allocation-size-too-big`](./error-allocation-size-too-big.md) |
| 20 | + |
| 21 | +- [Error: `calloc-overflow`](./error-calloc-overflow.md) |
| 22 | + |
| 23 | +- [Error: `double-free`](./error-double-free.md) |
| 24 | + |
| 25 | +- [Error: `dynamic-stack-buffer-overflow`](./error-dynamic-stack-buffer-overflow.md) |
| 26 | + |
| 27 | +- [Error: `global-overflow`](./error-global-buffer-overflow.md) |
| 28 | + |
| 29 | +- [Error: `heap-buffer-overflow`](./error-heap-buffer-overflow.md) |
| 30 | + |
| 31 | +- [Error: `heap-use-after-free`](./error-heap-use-after-free.md) |
| 32 | + |
| 33 | +- [Error: `invalid-allocation-alignment`](./error-invalid-allocation-alignment.md) |
| 34 | + |
| 35 | +- [Error: `memcpy-param-overlap`](./error-memcpy-param-overlap.md) |
| 36 | + |
| 37 | +- [Error: `new-delete-type-mismatch`](./error-new-delete-type-mismatch.md) |
| 38 | + |
| 39 | +- [Error: `stack-buffer-overflow`](./error-stack-buffer-overflow.md) |
| 40 | + |
| 41 | +- [Error: `stack-buffer-underflow`](./error-stack-buffer-underflow.md) |
| 42 | + |
| 43 | +- [Error: `stack-use-after-return`](./error-stack-use-after-return.md) |
| 44 | + |
| 45 | +- [Error: `stack-use-after-scope`](./error-stack-use-after-scope.md) |
| 46 | + |
| 47 | +- [Error: `strncat-param-overlap`](./error-strncat-param-overlap.md) |
| 48 | + |
| 49 | +- [Error: `use-after-poison`](./error-use-after-poison.md) |
| 50 | + |
| 51 | +## See also |
| 52 | + |
| 53 | +[AddressSanitizer overview](./asan.md)\ |
| 54 | +[AddressSanitizer known issues](./asan-known-issues.md)\ |
| 55 | +[AddressSanitizer build and language reference](./asan-building.md)\ |
| 56 | +[AddressSanitizer runtime reference](./asan-runtime.md)\ |
| 57 | +[AddressSanitizer shadow bytes](./asan-shadowbytes.md)\ |
| 58 | +[AddressSanitizer cloud or distributed testing](./asan-offline-crash-dumps.md)\ |
| 59 | +[AddressSanitizer debugger integration](./asan-debugger-integration.md) |
0 commit comments