Skip to content

Commit cb04aec

Browse files
Merge pull request #5743 from MicrosoftDocs/main638926905572065467sync_temp
For protected branch, push strategy should use PR and merge to target branch method to work around git push error
2 parents 4e014eb + 7dd4ac9 commit cb04aec

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

docs/sanitizers/asan-known-issues.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The following options and functionality are incompatible with [`/fsanitize=addre
2727

2828
## Standard library support
2929

30-
The MSVC standard library (STL) makes partial use of the AddressSanitizer and provides other code safety checks. For more information, see [container-overflow error](./error-container-overflow.md).
30+
The Microsoft Visual C++ (MSVC) standard library (STL) makes partial use of the AddressSanitizer and provides other code safety checks. For more information, see [`container-overflow` error](./error-container-overflow.md).
3131

3232
When annotations are disabled, or in versions of the Standard Library that don't support them, AddressSanitizer exceptions raised in STL code still identify real bugs. However, they're more precise if annotations are enabled and you use a version of the Standard Library that supports them.
3333

@@ -37,7 +37,8 @@ This example demonstrates the lack of precision and the benefits of enabling ann
3737
// Compile with: cl /fsanitize=address /Zi
3838
#include <vector>
3939

40-
int main() {
40+
int main()
41+
{
4142
// Create a vector of size 10, but with a capacity of 20.
4243
std::vector<int> v(10);
4344
v.reserve(20);
@@ -55,12 +56,16 @@ int main() {
5556
}
5657
```
5758

58-
## Overriding operator new and delete
59+
## Overriding `operator new` and `delete`
5960

60-
AddressSanitizer (ASan) uses a custom version of `operator new` and `operator delete` to find allocation errors like [`alloc_dealloc_mismatch`](error-alloc-dealloc-mismatch.md). Running the linker with [`/INFERASANLIBS`](../build/reference/inferasanlibs.md) ensures that ASan's `new`/`delete` override has low precedence, so that the linker chooses any `operator new` or `operator delete` overrides in other libraries over ASan's custom versions. When this happens, ASan may not be able to catch some errors that rely on its custom `operator new` and `operator delete`.
61-
62-
[MFC](../mfc/mfc-concepts.md) includes custom overrides for `operator new` and `operator delete` and might miss errors like [`alloc_dealloc_mismatch`](error-alloc-dealloc-mismatch.md).
61+
AddressSanitizer (ASan) uses a custom version of `operator new` and `operator delete` to find allocation errors like [`alloc_dealloc_mismatch`](error-alloc-dealloc-mismatch.md). Run the linker with [`/INFERASANLIBS`](../build/reference/inferasanlibs.md) to ensure that ASan's `new`/`delete` override has lower precedence, so that the linker chooses `operator new` or `operator delete` overrides in other libraries over ASan's custom versions. When this happens, ASan might not catch some errors that rely on its custom `operator new` and `operator delete`.
6362

63+
[MFC](../mfc/mfc-concepts.md) includes custom overrides for `operator new` and `operator delete`. When Microsoft Foundation Classes (MFC) overrides are used instead of the ASan provided `operator new` and `operator delete`, ASan might miss errors entirely or classify them incorrectly as a result. The following errors may be missed or incorrectly classified:
64+
- [`alloc_dealloc_mismatch`](error-alloc-dealloc-mismatch.md)
65+
- [`double-free`](error-double-free.md)
66+
- [`heap-use-after-free`](error-heap-use-after-free.md)
67+
- [`heap-buffer-overflow`](error-heap-buffer-overflow.md)
68+
- [`new-delete-type-mismatch`](error-new-delete-type-mismatch.md)
6469

6570
## Memory usage
6671

0 commit comments

Comments
 (0)