Skip to content

Commit 08c41c9

Browse files
authored
Fix mistakes and update "AddressSanitizer Runtime Options" topic (#5738)
* Fix mistakes in "AddressSanitizer Runtime Options" topic * Clean up superfluous `./` link prefix and remove empty line in "AddressSanitizer Runtime Options" topic
1 parent e185317 commit 08c41c9

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

docs/sanitizers/asan-flags.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,23 @@ helpviewer_keywords: ["AddressSanitizer options", "AddressSanitizer flags", "Add
77

88
# AddressSanitizer Runtime Options
99

10-
The following table lists the options for the AddressSanitizer. Enable them via the `ASAN_OPTIONS` environment variable or by overriding the `__asan_default_options()` user function described [here](./asan-runtime.md#runtime-options).
10+
The following table lists the options for the AddressSanitizer. Enable them via the `ASAN_OPTIONS` environment variable or by overriding the `__asan_default_options()` user function described [here](asan-runtime.md#runtime-options).
1111

1212
> [!NOTE]
1313
> These descriptions account for Microsoft Visual C++ (MSVC) specific behaviors, which may vary from Clang's runtime options.
1414
15-
1615
| Flag | Default value | Description |
1716
|------|---------------|-------------|
1817
|`abort_on_error` | `false` | If `true`, ASan calls `abort()` instead of `_exit()` after printing the error report.|
1918
|`alloc_dealloc_mismatch` | `false` | Detects mismatched memory operations such as `malloc`/`delete`, `new[]`/`free`, and so on.|
2019
|`allocator_frees_and_returns_null_on_realloc_zero` | `true` | If set to `true`, `realloc(p, 0)` is the same as `free(p)` by default (which is the same as the POSIX standard). If set to `false`, `realloc(p, 0)` returns a pointer to an allocated space that can't be used. |
2120
|`allocator_may_return_null` | `false` | If `true`, the allocator returns `nullptr` when out of memory. Instead of crashing, ASan emits a warning about the allocator's failure and execution continues.|
22-
|`allow_user_poisoning` | `true` | If `true`, you may manually mark memory regions as poisoned or unpoisoned using the [Manual AddressSanitizer poising interface](./asan-runtime.md#poisoning).|
21+
|`allow_user_poisoning` | `true` | If `true`, you may manually mark memory regions as poisoned or unpoisoned using the [Manual AddressSanitizer poisoning interface](asan-runtime.md#poisoning).|
2322
|`check_initialization_order` | `false` | If `true`, attempts to catch initialization order issues.|
2423
|`continue_on_error` | 0 | Allows an application to continue running while reporting memory safety errors.<br>0-disabled.<br>1-enabled; errors are sent to `stdout`.<br>2-enabled; errors are sent to `stderr`.<br>For more information, see [continue_on_error](asan-continue-on-error.md).|
25-
|`detect_container_overflow` | `true` | If `true`, honor the container overflow annotations. For more information, see [ContainerOverflow](./error-container-overflow.md).|
24+
|`detect_container_overflow` | `true` | If `true`, honor the container overflow annotations. For more information, see [ContainerOverflow](error-container-overflow.md).|
2625
|`detect_invalid_pointer_pairs` | `false` | If `true`, ASan detects operations like `<`, `<=`, `>`, `>=`, and `-` on invalid pointer pairs such as pointers that belong to different objects.|
27-
|`detect_stack_use_after_return` | `false` | Experimental. If `true`, ASan enables `stack-use-after-return` checking at runtime. Requires `/fsanitize-address-use-after-return`. For more information, see [stack-use-after-return](./error-stack-use-after-return.md).|
26+
|`detect_stack_use_after_return` | `false` | Experimental. If `true`, ASan enables `stack-use-after-return` checking at runtime. Requires `/fsanitize-address-use-after-return`. For more information, see [stack-use-after-return](error-stack-use-after-return.md).|
2827
|`exitcode` | 1 | Overrides the program exit status with this value if ASan finds an error.|
2928
|`external_symbolizer_path` | "" | Path to the external symbolizer. If empty, ASan searches `$PATH` for the symbolizer.|
3029
|`fast_unwind_on_malloc` | `true` | If available, ASan uses the fast frame-pointer-based unwinder on `malloc`/`free`.|
@@ -33,7 +32,7 @@ The following table lists the options for the AddressSanitizer. Enable them via
3332
|`handle_sigfpe` | `true` | If `true`, ASan handles `SIGFPE` errors.|
3433
|`handle_sigill` | `true` | If `true`, ASan handles `SIGILL` errors.|
3534
|`help` | `false` | If `true`, ASan prints the flag options to the console.|
36-
|`iat_overwrite`|`error`|`error` - reports an error whenever an overwrite is detected.<br>`protect` - trys to avoid using the overwritten definition.<br>`ignore` - doesn't try to correct any overwritten functions. For more information, see [`iat_overwrite`](./asan-runtime.md#msvc-specific-addresssanitizer-runtime-options).|
35+
|`iat_overwrite`|`error`|`error` - reports an error whenever an overwrite is detected.<br>`protect` - tries to avoid using the overwritten definition.<br>`ignore` - doesn't try to correct any overwritten functions. For more information, see [`iat_overwrite`](asan-runtime.md#msvc-specific-addresssanitizer-runtime-options).|
3736
|`include_if_exists` | "" | Reads options from the specified file. ASan doesn't fail if the file doesn't exist.|
3837
|`intercept_strpbrk` | `true` | If `true`, uses custom wrappers for `strpbrk` to find more errors.|
3938
|`intercept_strspn` | `true` | If `true`, uses custom wrappers for `strspn` and `strcspn` to find more errors.|
@@ -42,7 +41,7 @@ The following table lists the options for the AddressSanitizer. Enable them via
4241
|`malloc_fill_byte` | `0xbe` | Value used to fill newly allocated memory.|
4342
|`max_malloc_fill_size` | 4096 | The ASan allocator fills an allocation with `malloc_fill_byte` up to `max_malloc_fill_size` on a call to `malloc`.|
4443
|`max_redzone` | 2048 | Maximum size (in bytes) of redzones around heap objects.|
45-
|`new_delete_type_mismatch` | `true` | Report errors on mismatch between the size of `new` and `delete`. For more information, see [`new-delete-type-mismatch`](./error-new-delete-type-mismatch.md).|
44+
|`new_delete_type_mismatch` | `true` | Report errors on mismatch between the size of `new` and `delete`. For more information, see [`new-delete-type-mismatch`](error-new-delete-type-mismatch.md).|
4645
|`poison_heap` | `true` | If `true`, poison the heap memory on allocation and deallocation. `false` is useful for benchmarking the allocator or instrumentator.|
4746
|`poison_partial` | `true` | If `true`, poison partially addressable 8-byte aligned words. This flag affects heap and global buffers, but not stack buffers.|
4847
|`print_cmdline` | `false` | Print the command line on crash. With `continue_on_error` set >= 1, prints the current working directory and is `UTF-16` aware.|
@@ -54,20 +53,20 @@ The following table lists the options for the AddressSanitizer. Enable them via
5453
|`sleep_before_dying` | 0 | Number of seconds to sleep between printing an error report and terminating the program.|
5554
|`stack_trace_format` | `DEFAULT` | Format string used to render stack frames. `DEFAULT` - ` #%n %p %F %L`. List of available placeholders:<br> `%%` - represents a `'%'` character<br> `%n` - frame number (copy of `frame_no`)<br> `%p` - `PC`<br> `%m` - path to module<br> `%o` - offset in the module<br> `%f` - function name<br> `%q` - if available, offset in the function<br> `%s` - path to source file<br> `%l` - line in the source file<br> `%c` - column in the source file<br> `%F` - if the function is known, ASan prints `in <func name>` followed by the offset in this function if source is unknown<br> `%S` - ASan prints file/line/column information<br> `%L` - If file information is available, ASan prints the file name, line, and column. If module information is available, ASan prints the module name, offset, and architecture. If neither are available, ASan prints `(<unknown module>)`<br> `%M` - If known, ASan prints module basename and offset, or `PC`|
5655
|`strict_memcmp` | `true` | If `true`, assumes that `memcmp(p1, p2, n)` always reads `n` bytes before comparing `p1` and `p2`.|
57-
|`strict_string_checks` | `false` | If `true` checks that string arguments are properly null-terminated.|
56+
|`strict_string_checks` | `false` | If `true`, checks that string arguments are properly null-terminated.|
5857
|`strip_path_prefix` | "" | Strips this prefix from file paths in error reports.|
5958
|`symbolize` | `true` | If `true`, use the `llvm-symbolizer` to turn virtual addresses into file or line locations.|
6059
|`symbolize_inline_frames` | `true` | Print inlined frames in stacktraces.|
6160
|`verbosity` | 0 | Verbosity level:<br>0 - default verbosity.<br>1 - more output.<br>2 - even more output.<br>3 - maximum verbosity. |
62-
|`windows_fast_fail_on_error`| `false` | If `true`, the process can terminate with a `__fastfail(71)` after printing the error report. For more information, see [`windows_fast_fail_on_error`](./asan-runtime.md#msvc-specific-addresssanitizer-runtime-options).|
61+
|`windows_fast_fail_on_error`| `false` | If `true`, the process can terminate with a `__fastfail(71)` after printing the error report. For more information, see [`windows_fast_fail_on_error`](asan-runtime.md#msvc-specific-addresssanitizer-runtime-options).|
6362
|`windows_hook_legacy_allocators`| `true` |If `true`, enables hooking of (`Global`/`Local`)(`Alloc`/`Free`/`Size`/`ReAlloc`/`Lock`/`Unlock`) functions.|
6463

6564
## See also
6665

67-
[AddressSanitizer overview](./asan.md)\
68-
[AddressSanitizer known issues](./asan-known-issues.md)\
69-
[AddressSanitizer build and language reference](./asan-building.md)\
70-
[AddressSanitizer shadow bytes](./asan-shadow-bytes.md)\
71-
[AddressSanitizer cloud or distributed testing](./asan-offline-crash-dumps.md)\
72-
[AddressSanitizer debugger integration](./asan-debugger-integration.md)\
73-
[AddressSanitizer error examples](./asan-error-examples.md)
66+
[AddressSanitizer overview](asan.md)\
67+
[AddressSanitizer known issues](asan-known-issues.md)\
68+
[AddressSanitizer build and language reference](asan-building.md)\
69+
[AddressSanitizer shadow bytes](asan-shadow-bytes.md)\
70+
[AddressSanitizer cloud or distributed testing](asan-offline-crash-dumps.md)\
71+
[AddressSanitizer debugger integration](asan-debugger-integration.md)\
72+
[AddressSanitizer error examples](asan-error-examples.md)

0 commit comments

Comments
 (0)