Skip to content

Commit 48e0c59

Browse files
Merge pull request #5757 from Rageking8/add-remarks-heading-and-clean-up-addresssanitizer-error-references
Add "Remarks" heading and clean up AddressSanitizer error references
2 parents 032e1ee + 764ef4e commit 48e0c59

18 files changed

+172
-136
lines changed

docs/sanitizers/error-alloc-dealloc-mismatch.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ helpviewer_keywords: ["alloc-dealloc-mismatch error", "AddressSanitizer error al
99

1010
> Address Sanitizer Error: Mismatch between allocation and deallocation APIs
1111
12+
## Remarks
13+
1214
Enables runtime detection of mismatched memory operations that may lead to undefined behavior, such as:
1315
- `malloc` must be paired with `free`, not `delete` or `delete[]`.
1416
- `new` must be paired with `delete`, not `free` or `delete[]`.

docs/sanitizers/error-allocation-size-too-big.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ helpviewer_keywords: ["allocation-size-too-big error", "AddressSanitizer error a
1010

1111
> Address Sanitizer Error: allocation-size-too-big
1212
13+
## Remarks
14+
1315
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).
1416

1517
## Example
@@ -50,11 +52,11 @@ devenv /debugexe example1.exe
5052

5153
## See also
5254

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-shadow-bytes.md)\
58-
[AddressSanitizer cloud or distributed testing](./asan-offline-crash-dumps.md)\
59-
[AddressSanitizer debugger integration](./asan-debugger-integration.md)\
60-
[AddressSanitizer error examples](./asan-error-examples.md)
55+
[AddressSanitizer overview](asan.md)\
56+
[AddressSanitizer known issues](asan-known-issues.md)\
57+
[AddressSanitizer build and language reference](asan-building.md)\
58+
[AddressSanitizer runtime reference](asan-runtime.md)\
59+
[AddressSanitizer shadow bytes](asan-shadow-bytes.md)\
60+
[AddressSanitizer cloud or distributed testing](asan-offline-crash-dumps.md)\
61+
[AddressSanitizer debugger integration](asan-debugger-integration.md)\
62+
[AddressSanitizer error examples](asan-error-examples.md)

docs/sanitizers/error-calloc-overflow.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ helpviewer_keywords: ["calloc-overflow error", "AddressSanitizer error calloc-ov
99

1010
> Address Sanitizer Error: calloc-overflow
1111
12+
## Remarks
13+
1214
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.
1315

1416
## Example
@@ -45,11 +47,11 @@ devenv /debugexe example1.exe
4547

4648
## See also
4749

48-
[AddressSanitizer overview](./asan.md)\
49-
[AddressSanitizer known issues](./asan-known-issues.md)\
50-
[AddressSanitizer build and language reference](./asan-building.md)\
51-
[AddressSanitizer runtime reference](./asan-runtime.md)\
52-
[AddressSanitizer shadow bytes](./asan-shadow-bytes.md)\
53-
[AddressSanitizer cloud or distributed testing](./asan-offline-crash-dumps.md)\
54-
[AddressSanitizer debugger integration](./asan-debugger-integration.md)\
55-
[AddressSanitizer error examples](./asan-error-examples.md)
50+
[AddressSanitizer overview](asan.md)\
51+
[AddressSanitizer known issues](asan-known-issues.md)\
52+
[AddressSanitizer build and language reference](asan-building.md)\
53+
[AddressSanitizer runtime reference](asan-runtime.md)\
54+
[AddressSanitizer shadow bytes](asan-shadow-bytes.md)\
55+
[AddressSanitizer cloud or distributed testing](asan-offline-crash-dumps.md)\
56+
[AddressSanitizer debugger integration](asan-debugger-integration.md)\
57+
[AddressSanitizer error examples](asan-error-examples.md)

docs/sanitizers/error-container-overflow.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ helpviewer_keywords: ["container-overflow error", "AddressSanitizer error contai
1010

1111
> Address Sanitizer Error: Container overflow
1212
13+
## Remarks
14+
1315
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:
1416

1517
| 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
9092
9193
## See also
9294
93-
[AddressSanitizer overview](./asan.md)\
94-
[AddressSanitizer known issues](./asan-known-issues.md)\
95-
[AddressSanitizer build and language reference](./asan-building.md)\
96-
[AddressSanitizer runtime reference](./asan-runtime.md)\
97-
[AddressSanitizer shadow bytes](./asan-shadow-bytes.md)\
98-
[AddressSanitizer cloud or distributed testing](./asan-offline-crash-dumps.md)\
99-
[AddressSanitizer debugger integration](./asan-debugger-integration.md)\
100-
[AddressSanitizer error examples](./asan-error-examples.md)
95+
[AddressSanitizer overview](asan.md)\
96+
[AddressSanitizer known issues](asan-known-issues.md)\
97+
[AddressSanitizer build and language reference](asan-building.md)\
98+
[AddressSanitizer runtime reference](asan-runtime.md)\
99+
[AddressSanitizer shadow bytes](asan-shadow-bytes.md)\
100+
[AddressSanitizer cloud or distributed testing](asan-offline-crash-dumps.md)\
101+
[AddressSanitizer debugger integration](asan-debugger-integration.md)\
102+
[AddressSanitizer error examples](asan-error-examples.md)

docs/sanitizers/error-double-free.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ ms.custom: sfi-image-nochange
1111

1212
> Address Sanitizer Error: Deallocation of freed memory
1313
14+
## Remarks
15+
1416
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`.
1517

1618
## Example C++ - double `operator delete`
@@ -106,11 +108,11 @@ devenv /debugexe example3.exe
106108

107109
## See also
108110

109-
[AddressSanitizer overview](./asan.md)\
110-
[AddressSanitizer known issues](./asan-known-issues.md)\
111-
[AddressSanitizer build and language reference](./asan-building.md)\
112-
[AddressSanitizer runtime reference](./asan-runtime.md)\
113-
[AddressSanitizer shadow bytes](./asan-shadow-bytes.md)\
114-
[AddressSanitizer cloud or distributed testing](./asan-offline-crash-dumps.md)\
115-
[AddressSanitizer debugger integration](./asan-debugger-integration.md)\
116-
[AddressSanitizer error examples](./asan-error-examples.md)
111+
[AddressSanitizer overview](asan.md)\
112+
[AddressSanitizer known issues](asan-known-issues.md)\
113+
[AddressSanitizer build and language reference](asan-building.md)\
114+
[AddressSanitizer runtime reference](asan-runtime.md)\
115+
[AddressSanitizer shadow bytes](asan-shadow-bytes.md)\
116+
[AddressSanitizer cloud or distributed testing](asan-offline-crash-dumps.md)\
117+
[AddressSanitizer debugger integration](asan-debugger-integration.md)\
118+
[AddressSanitizer error examples](asan-error-examples.md)

docs/sanitizers/error-dynamic-stack-buffer-overflow.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ helpviewer_keywords: ["dynamic-stack-buffer-overflow error", "AddressSanitizer e
99

1010
> Address Sanitizer Error: dynamic-stack-buffer-overflow
1111
12+
## Remarks
13+
1214
This example shows the error that results from a buffer access outside the bounds of a stack-allocated object.
1315

1416
## Example - `alloca` overflow (right)
@@ -170,11 +172,11 @@ devenv /debugexe example3.exe
170172

171173
## See also
172174

173-
[AddressSanitizer overview](./asan.md)\
174-
[AddressSanitizer known issues](./asan-known-issues.md)\
175-
[AddressSanitizer build and language reference](./asan-building.md)\
176-
[AddressSanitizer runtime reference](./asan-runtime.md)\
177-
[AddressSanitizer shadow bytes](./asan-shadow-bytes.md)\
178-
[AddressSanitizer cloud or distributed testing](./asan-offline-crash-dumps.md)\
179-
[AddressSanitizer debugger integration](./asan-debugger-integration.md)\
180-
[AddressSanitizer error examples](./asan-error-examples.md)
175+
[AddressSanitizer overview](asan.md)\
176+
[AddressSanitizer known issues](asan-known-issues.md)\
177+
[AddressSanitizer build and language reference](asan-building.md)\
178+
[AddressSanitizer runtime reference](asan-runtime.md)\
179+
[AddressSanitizer shadow bytes](asan-shadow-bytes.md)\
180+
[AddressSanitizer cloud or distributed testing](asan-offline-crash-dumps.md)\
181+
[AddressSanitizer debugger integration](asan-debugger-integration.md)\
182+
[AddressSanitizer error examples](asan-error-examples.md)

docs/sanitizers/error-global-buffer-overflow.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ helpviewer_keywords: ["global-buffer-overflow error", "AddressSanitizer error gl
99

1010
> Address Sanitizer Error: Global buffer overflow
1111
12+
## Remarks
13+
1214
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.
1315

1416
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
152154

153155
## See also
154156

155-
[AddressSanitizer overview](./asan.md)\
156-
[AddressSanitizer known issues](./asan-known-issues.md)\
157-
[AddressSanitizer build and language reference](./asan-building.md)\
158-
[AddressSanitizer runtime reference](./asan-runtime.md)\
159-
[AddressSanitizer shadow bytes](./asan-shadow-bytes.md)\
160-
[AddressSanitizer cloud or distributed testing](./asan-offline-crash-dumps.md)\
161-
[AddressSanitizer debugger integration](./asan-debugger-integration.md)\
162-
[AddressSanitizer error examples](./asan-error-examples.md)
157+
[AddressSanitizer overview](asan.md)\
158+
[AddressSanitizer known issues](asan-known-issues.md)\
159+
[AddressSanitizer build and language reference](asan-building.md)\
160+
[AddressSanitizer runtime reference](asan-runtime.md)\
161+
[AddressSanitizer shadow bytes](asan-shadow-bytes.md)\
162+
[AddressSanitizer cloud or distributed testing](asan-offline-crash-dumps.md)\
163+
[AddressSanitizer debugger integration](asan-debugger-integration.md)\
164+
[AddressSanitizer error examples](asan-error-examples.md)

docs/sanitizers/error-heap-buffer-overflow.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ helpviewer_keywords: ["heap-buffer-overflow error", "AddressSanitizer error heap
99

1010
> Address Sanitizer Error: Heap buffer overflow
1111
12+
## Remarks
13+
1214
This example demonstrates the error that results when a memory access occurs outside the bounds of a heap-allocated object.
1315

1416
## Example - classic heap buffer overflow
@@ -109,11 +111,11 @@ devenv /debugexe example3.exe
109111

110112
## See also
111113

112-
[AddressSanitizer overview](./asan.md)\
113-
[AddressSanitizer known issues](./asan-known-issues.md)\
114-
[AddressSanitizer build and language reference](./asan-building.md)\
115-
[AddressSanitizer runtime reference](./asan-runtime.md)\
116-
[AddressSanitizer shadow bytes](./asan-shadow-bytes.md)\
117-
[AddressSanitizer cloud or distributed testing](./asan-offline-crash-dumps.md)\
118-
[AddressSanitizer debugger integration](./asan-debugger-integration.md)\
119-
[AddressSanitizer error examples](./asan-error-examples.md)
114+
[AddressSanitizer overview](asan.md)\
115+
[AddressSanitizer known issues](asan-known-issues.md)\
116+
[AddressSanitizer build and language reference](asan-building.md)\
117+
[AddressSanitizer runtime reference](asan-runtime.md)\
118+
[AddressSanitizer shadow bytes](asan-shadow-bytes.md)\
119+
[AddressSanitizer cloud or distributed testing](asan-offline-crash-dumps.md)\
120+
[AddressSanitizer debugger integration](asan-debugger-integration.md)\
121+
[AddressSanitizer error examples](asan-error-examples.md)

docs/sanitizers/error-heap-use-after-free.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ helpviewer_keywords: ["heap-use-after-free error", "AddressSanitizer error heap-
99

1010
> Address Sanitizer Error: Use of deallocated memory
1111
12+
## Remarks
13+
1214
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`.
1315

1416
## Example - `malloc`
@@ -144,11 +146,11 @@ The exception thrown dialog points to line 12, *x = 42, and says: Address Saniti
144146

145147
## See also
146148

147-
[AddressSanitizer overview](./asan.md)\
148-
[AddressSanitizer known issues](./asan-known-issues.md)\
149-
[AddressSanitizer build and language reference](./asan-building.md)\
150-
[AddressSanitizer runtime reference](./asan-runtime.md)\
151-
[AddressSanitizer shadow bytes](./asan-shadow-bytes.md)\
152-
[AddressSanitizer cloud or distributed testing](./asan-offline-crash-dumps.md)\
153-
[AddressSanitizer debugger integration](./asan-debugger-integration.md)\
154-
[AddressSanitizer error examples](./asan-error-examples.md)
149+
[AddressSanitizer overview](asan.md)\
150+
[AddressSanitizer known issues](asan-known-issues.md)\
151+
[AddressSanitizer build and language reference](asan-building.md)\
152+
[AddressSanitizer runtime reference](asan-runtime.md)\
153+
[AddressSanitizer shadow bytes](asan-shadow-bytes.md)\
154+
[AddressSanitizer cloud or distributed testing](asan-offline-crash-dumps.md)\
155+
[AddressSanitizer debugger integration](asan-debugger-integration.md)\
156+
[AddressSanitizer error examples](asan-error-examples.md)

docs/sanitizers/error-invalid-allocation-alignment.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ helpviewer_keywords: ["invalid-allocation-alignment error", "AddressSanitizer er
99

1010
> Address Sanitizer Error: invalid-allocation-alignment
1111
12+
## Remarks
13+
1214
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.
1315

1416
## Example
@@ -42,11 +44,11 @@ devenv /debugexe example1.exe
4244

4345
## See also
4446

45-
[AddressSanitizer overview](./asan.md)\
46-
[AddressSanitizer known issues](./asan-known-issues.md)\
47-
[AddressSanitizer build and language reference](./asan-building.md)\
48-
[AddressSanitizer runtime reference](./asan-runtime.md)\
49-
[AddressSanitizer shadow bytes](./asan-shadow-bytes.md)\
50-
[AddressSanitizer cloud or distributed testing](./asan-offline-crash-dumps.md)\
51-
[AddressSanitizer debugger integration](./asan-debugger-integration.md)\
52-
[AddressSanitizer error examples](./asan-error-examples.md)
47+
[AddressSanitizer overview](asan.md)\
48+
[AddressSanitizer known issues](asan-known-issues.md)\
49+
[AddressSanitizer build and language reference](asan-building.md)\
50+
[AddressSanitizer runtime reference](asan-runtime.md)\
51+
[AddressSanitizer shadow bytes](asan-shadow-bytes.md)\
52+
[AddressSanitizer cloud or distributed testing](asan-offline-crash-dumps.md)\
53+
[AddressSanitizer debugger integration](asan-debugger-integration.md)\
54+
[AddressSanitizer error examples](asan-error-examples.md)

0 commit comments

Comments
 (0)