Skip to content

Commit efde89e

Browse files
authored
Clean up redundant ./ and normalize win32 links to lowercase in "AddressSanitizer runtime" topic
1 parent 3e1df7d commit efde89e

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

docs/sanitizers/asan-runtime.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ helpviewer_keywords: ["AddressSanitizer runtime", "Address Sanitizer runtime", "
77

88
# AddressSanitizer runtime
99

10-
The AddressSanitizer runtime library intercepts common memory allocation functions and operations to enable inspection of memory accesses. There are several different runtime libraries that support the various types of executables the compiler may generate. The compiler and linker automatically link the appropriate runtime libraries, as long as you pass the [`/fsanitize=address`](../build/reference/fsanitize.md) option at compile time. You can override the default behavior by using the **`/NODEFAULTLIB`** option at link time. For more information, see the section on [linking](./asan-building.md#linker) in the [AddressSanitizer language, build, and debugging reference](./asan-building.md).
10+
The AddressSanitizer runtime library intercepts common memory allocation functions and operations to enable inspection of memory accesses. There are several different runtime libraries that support the various types of executables the compiler may generate. The compiler and linker automatically link the appropriate runtime libraries, as long as you pass the [`/fsanitize=address`](../build/reference/fsanitize.md) option at compile time. You can override the default behavior by using the **`/NODEFAULTLIB`** option at link time. For more information, see the section on [linking](asan-building.md#linker) in the [AddressSanitizer language, build, and debugging reference](asan-building.md).
1111

12-
When compiling with `cl /fsanitize=address`, the compiler generates instructions to manage and check [shadow bytes](./asan-shadow-bytes.md). Your program uses this instrumentation to check memory accesses on the stack, in the heap, or in the global scope. The compiler also produces metadata describing stack and global variables. This metadata enables the runtime to generate precise error diagnostics: function names, lines, and columns in your source code. Combined, the compiler checks and runtime libraries can precisely diagnose many types of [memory safety bugs](./asan-error-examples.md) if they're encountered at run-time.
12+
When compiling with `cl /fsanitize=address`, the compiler generates instructions to manage and check [shadow bytes](asan-shadow-bytes.md). Your program uses this instrumentation to check memory accesses on the stack, in the heap, or in the global scope. The compiler also produces metadata describing stack and global variables. This metadata enables the runtime to generate precise error diagnostics: function names, lines, and columns in your source code. Combined, the compiler checks and runtime libraries can precisely diagnose many types of [memory safety bugs](asan-error-examples.md) if they're encountered at run-time.
1313

1414
The list of runtime libraries for linking to the AddressSanitizer runtime, as of Visual Studio 17.7 Preview 3, follows. For more information about the `/MT` (statically link the runtime) and `/MD` (dynamically link the redist at runtime) options, see [`/MD`, `/MT`, `/LD` (Use Run-Time Library)](../build/reference/md-mt-ld-use-run-time-library.md).
1515

@@ -63,7 +63,7 @@ The image shows four scenarios for linking the ASan runtime library. The scenari
6363

6464
The AddressSanitizer achieves function interception through many hotpatching techniques. These techniques are [best documented within the source code itself](https://github.com/llvm/llvm-project/blob/1a2eaebc09c6a200f93b8beb37130c8b8aab3934/compiler-rt/lib/interception/interception_win.cpp#L11).
6565

66-
The runtime libraries intercept many common memory management and memory manipulation functions. For a list, see [AddressSanitizer list of intercepted functions](#intercepted_functions). The allocation interceptors manage metadata and shadow bytes related to each allocation call. Every time a CRT function such as `malloc` or `delete` is called, the interceptors set specific values in the AddressSanitizer shadow-memory region to indicate whether those heap locations are currently accessible and what the bounds of the allocation are. These shadow bytes allow the compiler-generated checks of the [shadow bytes](./asan-shadow-bytes.md) to determine whether a load or store is valid.
66+
The runtime libraries intercept many common memory management and memory manipulation functions. For a list, see [AddressSanitizer list of intercepted functions](#intercepted_functions). The allocation interceptors manage metadata and shadow bytes related to each allocation call. Every time a CRT function such as `malloc` or `delete` is called, the interceptors set specific values in the AddressSanitizer shadow-memory region to indicate whether those heap locations are currently accessible and what the bounds of the allocation are. These shadow bytes allow the compiler-generated checks of the [shadow bytes](asan-shadow-bytes.md) to determine whether a load or store is valid.
6767

6868
Interception isn't guaranteed to succeed. If a function prologue is too short for a `jmp` to be written, interception can fail. If an interception failure occurs, the program throws a `debugbreak` and halts. If you attach a debugger, it makes the cause of the interception issue clear. If you have this problem, [report a bug](https://aka.ms/feedback/report?space=62).
6969

@@ -72,7 +72,7 @@ Interception isn't guaranteed to succeed. If a function prologue is too short fo
7272
7373
## Custom allocators and the AddressSanitizer runtime
7474

75-
The AddressSanitizer runtime provides interceptors for common allocator interfaces, `malloc`/`free`, `new`/`delete`, `HeapAlloc`/`HeapFree` (via `RtlAllocateHeap`/`RtlFreeHeap`). Many programs make use of custom allocators for one reason or another, an example would be any program using `dlmalloc` or a solution using the `std::allocator` interface and `VirtualAlloc()`. The compiler is unable to automatically add shadow-memory management calls to a custom allocator. It's the user's responsibility to use the [provided manual poisoning interface](#poisoning). This API enables these allocators to function properly with the existing AddressSanitizer runtime and [shadow byte](./asan-shadow-bytes.md) conventions.
75+
The AddressSanitizer runtime provides interceptors for common allocator interfaces, `malloc`/`free`, `new`/`delete`, `HeapAlloc`/`HeapFree` (via `RtlAllocateHeap`/`RtlFreeHeap`). Many programs make use of custom allocators for one reason or another, an example would be any program using `dlmalloc` or a solution using the `std::allocator` interface and `VirtualAlloc()`. The compiler is unable to automatically add shadow-memory management calls to a custom allocator. It's the user's responsibility to use the [provided manual poisoning interface](#poisoning). This API enables these allocators to function properly with the existing AddressSanitizer runtime and [shadow byte](asan-shadow-bytes.md) conventions.
7676

7777
## <a name="poisoning"></a> Manual AddressSanitizer poisoning interface
7878

@@ -113,7 +113,7 @@ If the environment variable and the user function specify conflicting options, t
113113

114114
Multiple options are specified by separating them with a colon (`:`).
115115

116-
The following example sets [`alloc_dealloc_mismatch`](./error-alloc-dealloc-mismatch.md) to one and `symbolize` to zero:
116+
The following example sets [`alloc_dealloc_mismatch`](error-alloc-dealloc-mismatch.md) to one and `symbolize` to zero:
117117

118118
```cmd
119119
set ASAN_OPTIONS=alloc_dealloc_mismatch=1:symbolize=0
@@ -249,26 +249,26 @@ The interceptors listed here are only installed when an AddressSanitizer runtime
249249
`set ASAN_OPTIONS=windows_hook_legacy_allocators=false`
250250

251251
- [`GlobalAlloc`](/windows/win32/api/winbase/nf-winbase-globalalloc)
252-
- [`GlobalFree`](/windows/win32/api/winbase/nf-winbase-GlobalFree)
253-
- [`GlobalHandle`](/windows/win32/api/winbase/nf-winbase-GlobalHandle)
254-
- [`GlobalLock`](/windows/win32/api/winbase/nf-winbase-GlobalLock)
255-
- [`GlobalReAlloc`](/windows/win32/api/winbase/nf-winbase-GlobalReAlloc)
256-
- [`GlobalSize`](/windows/win32/api/winbase/nf-winbase-GlobalSize)
257-
- [`GlobalUnlock`](/windows/win32/api/winbase/nf-winbase-GlobalUnlock)
258-
- [`LocalAlloc`](/windows/win32/api/winbase/nf-winbase-LocalAlloc)
259-
- [`LocalFree`](/windows/win32/api/winbase/nf-winbase-LocalFree)
260-
- [`LocalHandle`](/windows/win32/api/winbase/nf-winbase-LocalHandle)
261-
- [`LocalLock`](/windows/win32/api/winbase/nf-winbase-LocalLock)
262-
- [`LocalReAlloc`](/windows/win32/api/winbase/nf-winbase-LocalReAlloc)
263-
- [`LocalSize`](/windows/win32/api/winbase/nf-winbase-LocalSize)
264-
- [`LocalUnlock`](/windows/win32/api/winbase/nf-winbase-LocalUnlock)
252+
- [`GlobalFree`](/windows/win32/api/winbase/nf-winbase-globalfree)
253+
- [`GlobalHandle`](/windows/win32/api/winbase/nf-winbase-globalhandle)
254+
- [`GlobalLock`](/windows/win32/api/winbase/nf-winbase-globallock)
255+
- [`GlobalReAlloc`](/windows/win32/api/winbase/nf-winbase-globalrealloc)
256+
- [`GlobalSize`](/windows/win32/api/winbase/nf-winbase-globalsize)
257+
- [`GlobalUnlock`](/windows/win32/api/winbase/nf-winbase-globalunlock)
258+
- [`LocalAlloc`](/windows/win32/api/winbase/nf-winbase-localalloc)
259+
- [`LocalFree`](/windows/win32/api/winbase/nf-winbase-localfree)
260+
- [`LocalHandle`](/windows/win32/api/winbase/nf-winbase-localhandle)
261+
- [`LocalLock`](/windows/win32/api/winbase/nf-winbase-locallock)
262+
- [`LocalReAlloc`](/windows/win32/api/winbase/nf-winbase-localrealloc)
263+
- [`LocalSize`](/windows/win32/api/winbase/nf-winbase-localsize)
264+
- [`LocalUnlock`](/windows/win32/api/winbase/nf-winbase-localunlock)
265265

266266
## See also
267267

268-
[AddressSanitizer overview](./asan.md)\
269-
[AddressSanitizer known issues](./asan-known-issues.md)\
270-
[AddressSanitizer build and language reference](./asan-building.md)\
271-
[AddressSanitizer shadow bytes](./asan-shadow-bytes.md)\
272-
[AddressSanitizer cloud or distributed testing](./asan-offline-crash-dumps.md)\
273-
[AddressSanitizer debugger integration](./asan-debugger-integration.md)\
274-
[AddressSanitizer error examples](./asan-error-examples.md)
268+
[AddressSanitizer overview](asan.md)\
269+
[AddressSanitizer known issues](asan-known-issues.md)\
270+
[AddressSanitizer build and language reference](asan-building.md)\
271+
[AddressSanitizer shadow bytes](asan-shadow-bytes.md)\
272+
[AddressSanitizer cloud or distributed testing](asan-offline-crash-dumps.md)\
273+
[AddressSanitizer debugger integration](asan-debugger-integration.md)\
274+
[AddressSanitizer error examples](asan-error-examples.md)

0 commit comments

Comments
 (0)