diff --git a/docs/sanitizers/error-alloc-dealloc-mismatch.md b/docs/sanitizers/error-alloc-dealloc-mismatch.md index 22cf7f620f..ad48d631fc 100644 --- a/docs/sanitizers/error-alloc-dealloc-mismatch.md +++ b/docs/sanitizers/error-alloc-dealloc-mismatch.md @@ -9,6 +9,8 @@ helpviewer_keywords: ["alloc-dealloc-mismatch error", "AddressSanitizer error al > Address Sanitizer Error: Mismatch between allocation and deallocation APIs +## Remarks + Enables runtime detection of mismatched memory operations that may lead to undefined behavior, such as: - `malloc` must be paired with `free`, not `delete` or `delete[]`. - `new` must be paired with `delete`, not `free` or `delete[]`. diff --git a/docs/sanitizers/error-allocation-size-too-big.md b/docs/sanitizers/error-allocation-size-too-big.md index 80638c6880..8cfe9d8538 100644 --- a/docs/sanitizers/error-allocation-size-too-big.md +++ b/docs/sanitizers/error-allocation-size-too-big.md @@ -10,6 +10,8 @@ helpviewer_keywords: ["allocation-size-too-big error", "AddressSanitizer error a > Address Sanitizer Error: allocation-size-too-big +## Remarks + This example shows the error found when an allocation is too large for the heap. Example sourced from [LLVM compiler-rt test suite](https://github.com/llvm/llvm-project/tree/main/compiler-rt/test/asan/TestCases). ## Example @@ -50,11 +52,11 @@ devenv /debugexe example1.exe ## See also -[AddressSanitizer overview](./asan.md)\ -[AddressSanitizer known issues](./asan-known-issues.md)\ -[AddressSanitizer build and language reference](./asan-building.md)\ -[AddressSanitizer runtime reference](./asan-runtime.md)\ -[AddressSanitizer shadow bytes](./asan-shadow-bytes.md)\ -[AddressSanitizer cloud or distributed testing](./asan-offline-crash-dumps.md)\ -[AddressSanitizer debugger integration](./asan-debugger-integration.md)\ -[AddressSanitizer error examples](./asan-error-examples.md) +[AddressSanitizer overview](asan.md)\ +[AddressSanitizer known issues](asan-known-issues.md)\ +[AddressSanitizer build and language reference](asan-building.md)\ +[AddressSanitizer runtime reference](asan-runtime.md)\ +[AddressSanitizer shadow bytes](asan-shadow-bytes.md)\ +[AddressSanitizer cloud or distributed testing](asan-offline-crash-dumps.md)\ +[AddressSanitizer debugger integration](asan-debugger-integration.md)\ +[AddressSanitizer error examples](asan-error-examples.md) diff --git a/docs/sanitizers/error-calloc-overflow.md b/docs/sanitizers/error-calloc-overflow.md index 5b944307d8..eff22183f3 100644 --- a/docs/sanitizers/error-calloc-overflow.md +++ b/docs/sanitizers/error-calloc-overflow.md @@ -9,6 +9,8 @@ helpviewer_keywords: ["calloc-overflow error", "AddressSanitizer error calloc-ov > Address Sanitizer Error: calloc-overflow +## Remarks + The CRT function [`calloc`](../c-runtime-library/reference/calloc.md) creates an array in memory with elements initialized to 0. The arguments can create an internal error that leads to a NULL pointer as the return value. ## Example @@ -45,11 +47,11 @@ devenv /debugexe example1.exe ## See also -[AddressSanitizer overview](./asan.md)\ -[AddressSanitizer known issues](./asan-known-issues.md)\ -[AddressSanitizer build and language reference](./asan-building.md)\ -[AddressSanitizer runtime reference](./asan-runtime.md)\ -[AddressSanitizer shadow bytes](./asan-shadow-bytes.md)\ -[AddressSanitizer cloud or distributed testing](./asan-offline-crash-dumps.md)\ -[AddressSanitizer debugger integration](./asan-debugger-integration.md)\ -[AddressSanitizer error examples](./asan-error-examples.md) +[AddressSanitizer overview](asan.md)\ +[AddressSanitizer known issues](asan-known-issues.md)\ +[AddressSanitizer build and language reference](asan-building.md)\ +[AddressSanitizer runtime reference](asan-runtime.md)\ +[AddressSanitizer shadow bytes](asan-shadow-bytes.md)\ +[AddressSanitizer cloud or distributed testing](asan-offline-crash-dumps.md)\ +[AddressSanitizer debugger integration](asan-debugger-integration.md)\ +[AddressSanitizer error examples](asan-error-examples.md) diff --git a/docs/sanitizers/error-container-overflow.md b/docs/sanitizers/error-container-overflow.md index b4c1e4c783..39b471251d 100644 --- a/docs/sanitizers/error-container-overflow.md +++ b/docs/sanitizers/error-container-overflow.md @@ -10,6 +10,8 @@ helpviewer_keywords: ["container-overflow error", "AddressSanitizer error contai > Address Sanitizer Error: Container overflow +## Remarks + In Visual Studio 2022 version 17.2 and later, the Microsoft Visual C++ standard library (STL) is partially enlightened to work with the AddressSanitizer. The following container types have annotations to detect memory access issues: | Standard container type | Disable annotations macro | Supported in version | @@ -90,11 +92,11 @@ If you want the implementation to trust that your custom allocator is handling t ## See also -[AddressSanitizer overview](./asan.md)\ -[AddressSanitizer known issues](./asan-known-issues.md)\ -[AddressSanitizer build and language reference](./asan-building.md)\ -[AddressSanitizer runtime reference](./asan-runtime.md)\ -[AddressSanitizer shadow bytes](./asan-shadow-bytes.md)\ -[AddressSanitizer cloud or distributed testing](./asan-offline-crash-dumps.md)\ -[AddressSanitizer debugger integration](./asan-debugger-integration.md)\ -[AddressSanitizer error examples](./asan-error-examples.md) +[AddressSanitizer overview](asan.md)\ +[AddressSanitizer known issues](asan-known-issues.md)\ +[AddressSanitizer build and language reference](asan-building.md)\ +[AddressSanitizer runtime reference](asan-runtime.md)\ +[AddressSanitizer shadow bytes](asan-shadow-bytes.md)\ +[AddressSanitizer cloud or distributed testing](asan-offline-crash-dumps.md)\ +[AddressSanitizer debugger integration](asan-debugger-integration.md)\ +[AddressSanitizer error examples](asan-error-examples.md) diff --git a/docs/sanitizers/error-double-free.md b/docs/sanitizers/error-double-free.md index 84b4dd4274..7623468b3f 100644 --- a/docs/sanitizers/error-double-free.md +++ b/docs/sanitizers/error-double-free.md @@ -11,6 +11,8 @@ ms.custom: sfi-image-nochange > Address Sanitizer Error: Deallocation of freed memory +## Remarks + In C, you can call `free` erroneously. In C++, you can call `delete` more than once. In these examples, we show errors with `delete`, `free`, and `HeapCreate`. ## Example C++ - double `operator delete` @@ -106,11 +108,11 @@ devenv /debugexe example3.exe ## See also -[AddressSanitizer overview](./asan.md)\ -[AddressSanitizer known issues](./asan-known-issues.md)\ -[AddressSanitizer build and language reference](./asan-building.md)\ -[AddressSanitizer runtime reference](./asan-runtime.md)\ -[AddressSanitizer shadow bytes](./asan-shadow-bytes.md)\ -[AddressSanitizer cloud or distributed testing](./asan-offline-crash-dumps.md)\ -[AddressSanitizer debugger integration](./asan-debugger-integration.md)\ -[AddressSanitizer error examples](./asan-error-examples.md) +[AddressSanitizer overview](asan.md)\ +[AddressSanitizer known issues](asan-known-issues.md)\ +[AddressSanitizer build and language reference](asan-building.md)\ +[AddressSanitizer runtime reference](asan-runtime.md)\ +[AddressSanitizer shadow bytes](asan-shadow-bytes.md)\ +[AddressSanitizer cloud or distributed testing](asan-offline-crash-dumps.md)\ +[AddressSanitizer debugger integration](asan-debugger-integration.md)\ +[AddressSanitizer error examples](asan-error-examples.md) diff --git a/docs/sanitizers/error-dynamic-stack-buffer-overflow.md b/docs/sanitizers/error-dynamic-stack-buffer-overflow.md index 4b0da9350d..3ff4780ae6 100644 --- a/docs/sanitizers/error-dynamic-stack-buffer-overflow.md +++ b/docs/sanitizers/error-dynamic-stack-buffer-overflow.md @@ -9,6 +9,8 @@ helpviewer_keywords: ["dynamic-stack-buffer-overflow error", "AddressSanitizer e > Address Sanitizer Error: dynamic-stack-buffer-overflow +## Remarks + This example shows the error that results from a buffer access outside the bounds of a stack-allocated object. ## Example - `alloca` overflow (right) @@ -170,11 +172,11 @@ devenv /debugexe example3.exe ## See also -[AddressSanitizer overview](./asan.md)\ -[AddressSanitizer known issues](./asan-known-issues.md)\ -[AddressSanitizer build and language reference](./asan-building.md)\ -[AddressSanitizer runtime reference](./asan-runtime.md)\ -[AddressSanitizer shadow bytes](./asan-shadow-bytes.md)\ -[AddressSanitizer cloud or distributed testing](./asan-offline-crash-dumps.md)\ -[AddressSanitizer debugger integration](./asan-debugger-integration.md)\ -[AddressSanitizer error examples](./asan-error-examples.md) +[AddressSanitizer overview](asan.md)\ +[AddressSanitizer known issues](asan-known-issues.md)\ +[AddressSanitizer build and language reference](asan-building.md)\ +[AddressSanitizer runtime reference](asan-runtime.md)\ +[AddressSanitizer shadow bytes](asan-shadow-bytes.md)\ +[AddressSanitizer cloud or distributed testing](asan-offline-crash-dumps.md)\ +[AddressSanitizer debugger integration](asan-debugger-integration.md)\ +[AddressSanitizer error examples](asan-error-examples.md) diff --git a/docs/sanitizers/error-global-buffer-overflow.md b/docs/sanitizers/error-global-buffer-overflow.md index 1f7885ddf8..68f2fbb17d 100644 --- a/docs/sanitizers/error-global-buffer-overflow.md +++ b/docs/sanitizers/error-global-buffer-overflow.md @@ -9,6 +9,8 @@ helpviewer_keywords: ["global-buffer-overflow error", "AddressSanitizer error gl > Address Sanitizer Error: Global buffer overflow +## Remarks + The compiler generates metadata for any variable in the `.data` or `.bss` sections. These variables have language scope of global or file static. They're allocated in memory before `main()` starts. Global variables in C are treated much differently than in C++. This difference is because of the complex rules for linking C. In C, a global variable can be declared in several source files, and each definition can have different types. The compiler can't see all the possible definitions at once, but the linker can. For C, the linker defaults to selecting the largest-sized variable out of all the different declarations. @@ -152,11 +154,11 @@ devenv /debugexe example3.exe -l ## See also -[AddressSanitizer overview](./asan.md)\ -[AddressSanitizer known issues](./asan-known-issues.md)\ -[AddressSanitizer build and language reference](./asan-building.md)\ -[AddressSanitizer runtime reference](./asan-runtime.md)\ -[AddressSanitizer shadow bytes](./asan-shadow-bytes.md)\ -[AddressSanitizer cloud or distributed testing](./asan-offline-crash-dumps.md)\ -[AddressSanitizer debugger integration](./asan-debugger-integration.md)\ -[AddressSanitizer error examples](./asan-error-examples.md) +[AddressSanitizer overview](asan.md)\ +[AddressSanitizer known issues](asan-known-issues.md)\ +[AddressSanitizer build and language reference](asan-building.md)\ +[AddressSanitizer runtime reference](asan-runtime.md)\ +[AddressSanitizer shadow bytes](asan-shadow-bytes.md)\ +[AddressSanitizer cloud or distributed testing](asan-offline-crash-dumps.md)\ +[AddressSanitizer debugger integration](asan-debugger-integration.md)\ +[AddressSanitizer error examples](asan-error-examples.md) diff --git a/docs/sanitizers/error-heap-buffer-overflow.md b/docs/sanitizers/error-heap-buffer-overflow.md index 497f9847db..728edfe057 100644 --- a/docs/sanitizers/error-heap-buffer-overflow.md +++ b/docs/sanitizers/error-heap-buffer-overflow.md @@ -9,6 +9,8 @@ helpviewer_keywords: ["heap-buffer-overflow error", "AddressSanitizer error heap > Address Sanitizer Error: Heap buffer overflow +## Remarks + This example demonstrates the error that results when a memory access occurs outside the bounds of a heap-allocated object. ## Example - classic heap buffer overflow @@ -109,11 +111,11 @@ devenv /debugexe example3.exe ## See also -[AddressSanitizer overview](./asan.md)\ -[AddressSanitizer known issues](./asan-known-issues.md)\ -[AddressSanitizer build and language reference](./asan-building.md)\ -[AddressSanitizer runtime reference](./asan-runtime.md)\ -[AddressSanitizer shadow bytes](./asan-shadow-bytes.md)\ -[AddressSanitizer cloud or distributed testing](./asan-offline-crash-dumps.md)\ -[AddressSanitizer debugger integration](./asan-debugger-integration.md)\ -[AddressSanitizer error examples](./asan-error-examples.md) +[AddressSanitizer overview](asan.md)\ +[AddressSanitizer known issues](asan-known-issues.md)\ +[AddressSanitizer build and language reference](asan-building.md)\ +[AddressSanitizer runtime reference](asan-runtime.md)\ +[AddressSanitizer shadow bytes](asan-shadow-bytes.md)\ +[AddressSanitizer cloud or distributed testing](asan-offline-crash-dumps.md)\ +[AddressSanitizer debugger integration](asan-debugger-integration.md)\ +[AddressSanitizer error examples](asan-error-examples.md) diff --git a/docs/sanitizers/error-heap-use-after-free.md b/docs/sanitizers/error-heap-use-after-free.md index f0c827d5d2..6ddd65cbb5 100644 --- a/docs/sanitizers/error-heap-use-after-free.md +++ b/docs/sanitizers/error-heap-use-after-free.md @@ -9,6 +9,8 @@ helpviewer_keywords: ["heap-use-after-free error", "AddressSanitizer error heap- > Address Sanitizer Error: Use of deallocated memory +## Remarks + We show three examples where storage in the heap can be allocated via `malloc`, `realloc` (C), and `new` (C++), along with a mistaken use of `volatile`. ## Example - `malloc` @@ -144,11 +146,11 @@ The exception thrown dialog points to line 12, *x = 42, and says: Address Saniti ## See also -[AddressSanitizer overview](./asan.md)\ -[AddressSanitizer known issues](./asan-known-issues.md)\ -[AddressSanitizer build and language reference](./asan-building.md)\ -[AddressSanitizer runtime reference](./asan-runtime.md)\ -[AddressSanitizer shadow bytes](./asan-shadow-bytes.md)\ -[AddressSanitizer cloud or distributed testing](./asan-offline-crash-dumps.md)\ -[AddressSanitizer debugger integration](./asan-debugger-integration.md)\ -[AddressSanitizer error examples](./asan-error-examples.md) +[AddressSanitizer overview](asan.md)\ +[AddressSanitizer known issues](asan-known-issues.md)\ +[AddressSanitizer build and language reference](asan-building.md)\ +[AddressSanitizer runtime reference](asan-runtime.md)\ +[AddressSanitizer shadow bytes](asan-shadow-bytes.md)\ +[AddressSanitizer cloud or distributed testing](asan-offline-crash-dumps.md)\ +[AddressSanitizer debugger integration](asan-debugger-integration.md)\ +[AddressSanitizer error examples](asan-error-examples.md) diff --git a/docs/sanitizers/error-invalid-allocation-alignment.md b/docs/sanitizers/error-invalid-allocation-alignment.md index 87b091b869..bb3a05c022 100644 --- a/docs/sanitizers/error-invalid-allocation-alignment.md +++ b/docs/sanitizers/error-invalid-allocation-alignment.md @@ -9,6 +9,8 @@ helpviewer_keywords: ["invalid-allocation-alignment error", "AddressSanitizer er > Address Sanitizer Error: invalid-allocation-alignment +## Remarks + The [`_aligned_malloc`](../c-runtime-library/reference/aligned-malloc.md) function requires a power of 2 for expressing the alignment. We simulate the "external" calculation of some alignment factor using an unoptimized global variable. ## Example @@ -42,11 +44,11 @@ devenv /debugexe example1.exe ## See also -[AddressSanitizer overview](./asan.md)\ -[AddressSanitizer known issues](./asan-known-issues.md)\ -[AddressSanitizer build and language reference](./asan-building.md)\ -[AddressSanitizer runtime reference](./asan-runtime.md)\ -[AddressSanitizer shadow bytes](./asan-shadow-bytes.md)\ -[AddressSanitizer cloud or distributed testing](./asan-offline-crash-dumps.md)\ -[AddressSanitizer debugger integration](./asan-debugger-integration.md)\ -[AddressSanitizer error examples](./asan-error-examples.md) +[AddressSanitizer overview](asan.md)\ +[AddressSanitizer known issues](asan-known-issues.md)\ +[AddressSanitizer build and language reference](asan-building.md)\ +[AddressSanitizer runtime reference](asan-runtime.md)\ +[AddressSanitizer shadow bytes](asan-shadow-bytes.md)\ +[AddressSanitizer cloud or distributed testing](asan-offline-crash-dumps.md)\ +[AddressSanitizer debugger integration](asan-debugger-integration.md)\ +[AddressSanitizer error examples](asan-error-examples.md) diff --git a/docs/sanitizers/error-memcpy-param-overlap.md b/docs/sanitizers/error-memcpy-param-overlap.md index 5c5c46173d..419cbeb803 100644 --- a/docs/sanitizers/error-memcpy-param-overlap.md +++ b/docs/sanitizers/error-memcpy-param-overlap.md @@ -9,6 +9,8 @@ helpviewer_keywords: ["memcpy-param-overlap error", "AddressSanitizer error memc > Address Sanitizer Error: memcpy-param-overlap +## Remarks + > [!NOTE] > The `/Oi` flag is required to reliably detect `memcpy-param-overlap` errors. This flag tells the compiler to treat `memcpy` and other functions as intrinsics, which is necessary because some versions of the standard library implement them as such. Since ASan is a dynamic analysis tool, it can only detect errors with an observable runtime effect. Note that when `/O2` is also set, ASan may not be able to reliably detect `memcpy-param-overlap` errors because the intrinsic variant of these functions isn't guaranteed to be used. For more information, see [`/Oi` docs](../build/reference/oi-generate-intrinsic-functions.md). @@ -48,11 +50,11 @@ devenv /debugexe example1.exe ## See also -[AddressSanitizer overview](./asan.md)\ -[AddressSanitizer known issues](./asan-known-issues.md)\ -[AddressSanitizer build and language reference](./asan-building.md)\ -[AddressSanitizer runtime reference](./asan-runtime.md)\ -[AddressSanitizer shadow bytes](./asan-shadow-bytes.md)\ -[AddressSanitizer cloud or distributed testing](./asan-offline-crash-dumps.md)\ -[AddressSanitizer debugger integration](./asan-debugger-integration.md)\ -[AddressSanitizer error examples](./asan-error-examples.md) +[AddressSanitizer overview](asan.md)\ +[AddressSanitizer known issues](asan-known-issues.md)\ +[AddressSanitizer build and language reference](asan-building.md)\ +[AddressSanitizer runtime reference](asan-runtime.md)\ +[AddressSanitizer shadow bytes](asan-shadow-bytes.md)\ +[AddressSanitizer cloud or distributed testing](asan-offline-crash-dumps.md)\ +[AddressSanitizer debugger integration](asan-debugger-integration.md)\ +[AddressSanitizer error examples](asan-error-examples.md) diff --git a/docs/sanitizers/error-new-delete-type-mismatch.md b/docs/sanitizers/error-new-delete-type-mismatch.md index 2c19b710af..708b39a76c 100644 --- a/docs/sanitizers/error-new-delete-type-mismatch.md +++ b/docs/sanitizers/error-new-delete-type-mismatch.md @@ -9,6 +9,8 @@ helpviewer_keywords: ["new-delete-type-mismatch error", "AddressSanitizer error > Address Sanitizer Error: Deallocation size different from allocation size +## Remarks + In this example, only `~Base`, and not `~Derived`, is called. The compiler generates a call to `~Base()` because the `Base` destructor isn't **`virtual`**. When we call `delete b`, the object's destructor is bound to the default definition. The code deletes an empty base class (or 1 byte on Windows). A missing **`virtual`** keyword on the destructor declaration is a common C++ error when using inheritance. ## Example - virtual destructor @@ -64,11 +66,11 @@ devenv /debugexe example1.exe ## See also -[AddressSanitizer overview](./asan.md)\ -[AddressSanitizer known issues](./asan-known-issues.md)\ -[AddressSanitizer build and language reference](./asan-building.md)\ -[AddressSanitizer runtime reference](./asan-runtime.md)\ -[AddressSanitizer shadow bytes](./asan-shadow-bytes.md)\ -[AddressSanitizer cloud or distributed testing](./asan-offline-crash-dumps.md)\ -[AddressSanitizer debugger integration](./asan-debugger-integration.md)\ -[AddressSanitizer error examples](./asan-error-examples.md) +[AddressSanitizer overview](asan.md)\ +[AddressSanitizer known issues](asan-known-issues.md)\ +[AddressSanitizer build and language reference](asan-building.md)\ +[AddressSanitizer runtime reference](asan-runtime.md)\ +[AddressSanitizer shadow bytes](asan-shadow-bytes.md)\ +[AddressSanitizer cloud or distributed testing](asan-offline-crash-dumps.md)\ +[AddressSanitizer debugger integration](asan-debugger-integration.md)\ +[AddressSanitizer error examples](asan-error-examples.md) diff --git a/docs/sanitizers/error-stack-buffer-overflow.md b/docs/sanitizers/error-stack-buffer-overflow.md index c02011aaef..403ee7b16b 100644 --- a/docs/sanitizers/error-stack-buffer-overflow.md +++ b/docs/sanitizers/error-stack-buffer-overflow.md @@ -9,6 +9,8 @@ helpviewer_keywords: ["stack-buffer-overflow error", "AddressSanitizer error sta > Address Sanitizer Error: Stack buffer overflow +## Remarks + A stack buffer overflow can happen many ways in C or C++. We provide several examples for this category of error that you can catch by a simple recompile. ## Example - stack buffer overflow @@ -112,11 +114,11 @@ devenv /debugexe example3.exe ## See also -[AddressSanitizer overview](./asan.md)\ -[AddressSanitizer known issues](./asan-known-issues.md)\ -[AddressSanitizer build and language reference](./asan-building.md)\ -[AddressSanitizer runtime reference](./asan-runtime.md)\ -[AddressSanitizer shadow bytes](./asan-shadow-bytes.md)\ -[AddressSanitizer cloud or distributed testing](./asan-offline-crash-dumps.md)\ -[AddressSanitizer debugger integration](./asan-debugger-integration.md)\ -[AddressSanitizer error examples](./asan-error-examples.md) +[AddressSanitizer overview](asan.md)\ +[AddressSanitizer known issues](asan-known-issues.md)\ +[AddressSanitizer build and language reference](asan-building.md)\ +[AddressSanitizer runtime reference](asan-runtime.md)\ +[AddressSanitizer shadow bytes](asan-shadow-bytes.md)\ +[AddressSanitizer cloud or distributed testing](asan-offline-crash-dumps.md)\ +[AddressSanitizer debugger integration](asan-debugger-integration.md)\ +[AddressSanitizer error examples](asan-error-examples.md) diff --git a/docs/sanitizers/error-stack-buffer-underflow.md b/docs/sanitizers/error-stack-buffer-underflow.md index a780be1f66..c8cf463ff2 100644 --- a/docs/sanitizers/error-stack-buffer-underflow.md +++ b/docs/sanitizers/error-stack-buffer-underflow.md @@ -9,6 +9,8 @@ helpviewer_keywords: ["stack-buffer-underflow error", "AddressSanitizer error st > Address Sanitizer Error: Stack buffer underflow +## Remarks + These error messages indicate a memory access to somewhere before the beginning of a stack variable. ## Example - local array underflow @@ -80,11 +82,11 @@ devenv /debugexe example2.exe ## See also -[AddressSanitizer overview](./asan.md)\ -[AddressSanitizer known issues](./asan-known-issues.md)\ -[AddressSanitizer build and language reference](./asan-building.md)\ -[AddressSanitizer runtime reference](./asan-runtime.md)\ -[AddressSanitizer shadow bytes](./asan-shadow-bytes.md)\ -[AddressSanitizer cloud or distributed testing](./asan-offline-crash-dumps.md)\ -[AddressSanitizer debugger integration](./asan-debugger-integration.md)\ -[AddressSanitizer error examples](./asan-error-examples.md) +[AddressSanitizer overview](asan.md)\ +[AddressSanitizer known issues](asan-known-issues.md)\ +[AddressSanitizer build and language reference](asan-building.md)\ +[AddressSanitizer runtime reference](asan-runtime.md)\ +[AddressSanitizer shadow bytes](asan-shadow-bytes.md)\ +[AddressSanitizer cloud or distributed testing](asan-offline-crash-dumps.md)\ +[AddressSanitizer debugger integration](asan-debugger-integration.md)\ +[AddressSanitizer error examples](asan-error-examples.md) diff --git a/docs/sanitizers/error-stack-use-after-return.md b/docs/sanitizers/error-stack-use-after-return.md index 5f6154e217..f3ee909411 100644 --- a/docs/sanitizers/error-stack-use-after-return.md +++ b/docs/sanitizers/error-stack-use-after-return.md @@ -9,6 +9,8 @@ helpviewer_keywords: ["stack-use-after-return error", "AddressSanitizer error st > Address Sanitizer Error: Use of stack memory after return +## Remarks + This check requires code generation that's activated by an extra compiler option, [`/fsanitize-address-use-after-return`](../build/reference/fsanitize.md), and by setting the environment variable `ASAN_OPTIONS=detect_stack_use_after_return=1`. This check can slow your application down substantially. Consider the [Clang summary](https://github.com/google/sanitizers/wiki/AddressSanitizerUseAfterReturn) of the algorithm that supports use after return, and the larger performance costs. @@ -109,11 +111,11 @@ ASAN is a form of dynamic analysis, which means it can only detect bad code that ## See also -[AddressSanitizer overview](./asan.md)\ -[AddressSanitizer known issues](./asan-known-issues.md)\ -[AddressSanitizer build and language reference](./asan-building.md)\ -[AddressSanitizer runtime reference](./asan-runtime.md)\ -[AddressSanitizer shadow bytes](./asan-shadow-bytes.md)\ -[AddressSanitizer cloud or distributed testing](./asan-offline-crash-dumps.md)\ -[AddressSanitizer debugger integration](./asan-debugger-integration.md)\ -[AddressSanitizer error examples](./asan-error-examples.md) +[AddressSanitizer overview](asan.md)\ +[AddressSanitizer known issues](asan-known-issues.md)\ +[AddressSanitizer build and language reference](asan-building.md)\ +[AddressSanitizer runtime reference](asan-runtime.md)\ +[AddressSanitizer shadow bytes](asan-shadow-bytes.md)\ +[AddressSanitizer cloud or distributed testing](asan-offline-crash-dumps.md)\ +[AddressSanitizer debugger integration](asan-debugger-integration.md)\ +[AddressSanitizer error examples](asan-error-examples.md) diff --git a/docs/sanitizers/error-stack-use-after-scope.md b/docs/sanitizers/error-stack-use-after-scope.md index fb2ff6df9c..951ca39bb4 100644 --- a/docs/sanitizers/error-stack-use-after-scope.md +++ b/docs/sanitizers/error-stack-use-after-scope.md @@ -9,6 +9,8 @@ helpviewer_keywords: ["stack-use-after-scope error", "AddressSanitizer error sta > Address Sanitizer Error: Use of out-of-scope stack memory +## Remarks + The use of a stack address outside the lexical scope of a variable's lifetime can happen many ways in C or C++. ## Example 1 - simple nested local @@ -159,11 +161,11 @@ ASAN is a form of dynamic analysis, which means it can only detect bad code that ## See also -[AddressSanitizer overview](./asan.md)\ -[AddressSanitizer known issues](./asan-known-issues.md)\ -[AddressSanitizer build and language reference](./asan-building.md)\ -[AddressSanitizer runtime reference](./asan-runtime.md)\ -[AddressSanitizer shadow bytes](./asan-shadow-bytes.md)\ -[AddressSanitizer cloud or distributed testing](./asan-offline-crash-dumps.md)\ -[AddressSanitizer debugger integration](./asan-debugger-integration.md)\ -[AddressSanitizer error examples](./asan-error-examples.md) +[AddressSanitizer overview](asan.md)\ +[AddressSanitizer known issues](asan-known-issues.md)\ +[AddressSanitizer build and language reference](asan-building.md)\ +[AddressSanitizer runtime reference](asan-runtime.md)\ +[AddressSanitizer shadow bytes](asan-shadow-bytes.md)\ +[AddressSanitizer cloud or distributed testing](asan-offline-crash-dumps.md)\ +[AddressSanitizer debugger integration](asan-debugger-integration.md)\ +[AddressSanitizer error examples](asan-error-examples.md) diff --git a/docs/sanitizers/error-strncat-param-overlap.md b/docs/sanitizers/error-strncat-param-overlap.md index 52c5f31142..e5569f4fab 100644 --- a/docs/sanitizers/error-strncat-param-overlap.md +++ b/docs/sanitizers/error-strncat-param-overlap.md @@ -9,6 +9,8 @@ helpviewer_keywords: ["strncat-param-overlap error", "AddressSanitizer error str > Address Sanitizer Error: strncat-param-overlap +## Remarks + Code that moves memory in overlapping buffer can cause hard-to-diagnose errors. ## Example @@ -47,11 +49,11 @@ devenv /debugexe example1.exe ## See also -[AddressSanitizer overview](./asan.md)\ -[AddressSanitizer known issues](./asan-known-issues.md)\ -[AddressSanitizer build and language reference](./asan-building.md)\ -[AddressSanitizer runtime reference](./asan-runtime.md)\ -[AddressSanitizer shadow bytes](./asan-shadow-bytes.md)\ -[AddressSanitizer cloud or distributed testing](./asan-offline-crash-dumps.md)\ -[AddressSanitizer debugger integration](./asan-debugger-integration.md)\ -[AddressSanitizer error examples](./asan-error-examples.md) +[AddressSanitizer overview](asan.md)\ +[AddressSanitizer known issues](asan-known-issues.md)\ +[AddressSanitizer build and language reference](asan-building.md)\ +[AddressSanitizer runtime reference](asan-runtime.md)\ +[AddressSanitizer shadow bytes](asan-shadow-bytes.md)\ +[AddressSanitizer cloud or distributed testing](asan-offline-crash-dumps.md)\ +[AddressSanitizer debugger integration](asan-debugger-integration.md)\ +[AddressSanitizer error examples](asan-error-examples.md) diff --git a/docs/sanitizers/error-use-after-poison.md b/docs/sanitizers/error-use-after-poison.md index f6c58a8601..d8347318d3 100644 --- a/docs/sanitizers/error-use-after-poison.md +++ b/docs/sanitizers/error-use-after-poison.md @@ -9,6 +9,8 @@ helpviewer_keywords: ["use-after-poison error", "AddressSanitizer error use-afte > Address Sanitizer Error: Use of poisoned memory +## Remarks + A developer can manually poison memory to customize debugging. ## Example @@ -45,11 +47,11 @@ devenv /debugexe example1.exe ## See also -[AddressSanitizer overview](./asan.md)\ -[AddressSanitizer known issues](./asan-known-issues.md)\ -[AddressSanitizer build and language reference](./asan-building.md)\ -[AddressSanitizer runtime reference](./asan-runtime.md)\ -[AddressSanitizer shadow bytes](./asan-shadow-bytes.md)\ -[AddressSanitizer cloud or distributed testing](./asan-offline-crash-dumps.md)\ -[AddressSanitizer debugger integration](./asan-debugger-integration.md)\ -[AddressSanitizer error examples](./asan-error-examples.md) +[AddressSanitizer overview](asan.md)\ +[AddressSanitizer known issues](asan-known-issues.md)\ +[AddressSanitizer build and language reference](asan-building.md)\ +[AddressSanitizer runtime reference](asan-runtime.md)\ +[AddressSanitizer shadow bytes](asan-shadow-bytes.md)\ +[AddressSanitizer cloud or distributed testing](asan-offline-crash-dumps.md)\ +[AddressSanitizer debugger integration](asan-debugger-integration.md)\ +[AddressSanitizer error examples](asan-error-examples.md)