-
Notifications
You must be signed in to change notification settings - Fork 970
Add AddressSanitizer Runtime Options page #5632
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Learn Build status updates of commit 1f0f9f7: 💡 Validation status: suggestions
docs/sanitizers/asan-flags.md
For more details, please refer to the build report. Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a quick pass since there was a build warning
The following is a list of supported runtime options that can be set by the `ASAN_OPTIONS` environment variable or by overriding the `__asan_default_options()` user function. Reference: [AddressSanitizer Runtime Options](./asan-runtime.md#runtime-options). Note that while these mirror the options available in Clang's ASan, the description will differ by varying amounts in consideration of the MSVC ASan runtime. | ||
|
||
This is a living document that may update at any time due to the constant development of AddressSanitizer on the Windows platform. If you discover options that aren't accurately documented, we invite you to [report a bug](https://aka.ms/feedback/report?space=62). | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for the error here: #5632 (comment)
I think you're missing this:
| ------- | -----------------| -----------| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It prints out the pipes and hyphens in plain text above the table. Not sure what its asking for :/
Learn Build status updates of commit 8898c80: 💡 Validation status: suggestions
docs/sanitizers/asan-flags.md
For more details, please refer to the build report. Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them. |
Learn Build status updates of commit eaf7ba9: 💡 Validation status: suggestions
docs/sanitizers/asan-flags.md
For more details, please refer to the build report. Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them. |
@microsoft-github-policy-service agree company="Microsoft" |
@39otsu : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change. |
Can you review the proposed changes? Important: When the changes are ready for publication, adding a #label:"aq-pr-triaged" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi David, I left some notes but stopped after a bit. Rather than have you wade through a bunch of my notes, I could do an edit pass on this before it gets checked in and that might save you some time. Let me know if you'd like me to do that.
@@ -101,7 +101,7 @@ For an illustration of the alignment requirement and potential issues, see the p | |||
|
|||
## Runtime options | |||
|
|||
The MSVC AddressSanitizer is based on the [Clang AddressSanitizer runtime from the llvm-project repository](https://github.com/llvm/llvm-project). Because of this, most of clang's ASan runtime options available in MSVC as well. [A complete list of the public Clang runtime options is available here](https://github.com/google/sanitizers/wiki/SanitizerCommonFlags). We document some differences in the sections that follow. If you discover options that don't function as expected, [report a bug](https://aka.ms/feedback/report?space=62). | |||
The MSVC AddressSanitizer is based on the [Clang AddressSanitizer runtime from the llvm-project repository](https://github.com/llvm/llvm-project). Because of this, most of Clang's ASan runtime options available in MSVC as well. [A complete list of runtime options we support is available here](./asan-flags.md). We document some differences in the sections that follow. If you discover options that don't function as expected, [report a bug](https://aka.ms/feedback/report?space=62). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a grammatically incorrect sentence (it was before). How about: "Because of this, most of Clang's ASan runtime options are available in MSVC."
helpviewer_keywords: ["AddressSanitizer options", "AddressSanitizer flags", "Address Sanitizer options", "Address Sanitizer flags", "asan options", "asan flags", "sanitizer flags", "asan_options", "AddressSanitizerFlags", "CommonSanitizerFlags"] | ||
--- | ||
|
||
# AddressSanitizer Runtime Options |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our style is to use sentence casing, e.g. "AddressSantizer runtime options"
|
||
# AddressSanitizer Runtime Options | ||
|
||
The following is a list of supported runtime options that can be set by the `ASAN_OPTIONS` environment variable or by overriding the `__asan_default_options()` user function. Reference: [AddressSanitizer Runtime Options](./asan-runtime.md#runtime-options). Note that while these mirror the options available in Clang's ASan, the description will differ by varying amounts in consideration of the MSVC ASan runtime. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the reference about? Are you wanting to say: "For more information about setting runtime options, see AddressSanitizer Runtime Options"
|
||
# AddressSanitizer Runtime Options | ||
|
||
The following is a list of supported runtime options that can be set by the `ASAN_OPTIONS` environment variable or by overriding the `__asan_default_options()` user function. Reference: [AddressSanitizer Runtime Options](./asan-runtime.md#runtime-options). Note that while these mirror the options available in Clang's ASan, the description will differ by varying amounts in consideration of the MSVC ASan runtime. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't say "note ...". If it truly is a note that we want to call out, we use > [!NOTE]
with the note text on the next line.
In this case, I'd just say "These options mirror those in Clang's ASan, but the descriptions may vary when there are differences with the MSVC ASan runtime".
|
||
The following is a list of supported runtime options that can be set by the `ASAN_OPTIONS` environment variable or by overriding the `__asan_default_options()` user function. Reference: [AddressSanitizer Runtime Options](./asan-runtime.md#runtime-options). Note that while these mirror the options available in Clang's ASan, the description will differ by varying amounts in consideration of the MSVC ASan runtime. | ||
|
||
This is a living document that may update at any time due to the constant development of AddressSanitizer on the Windows platform. If you discover options that aren't accurately documented, we invite you to [report a bug](https://aka.ms/feedback/report?space=62). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd drop the living document part and just say "Please report incorrectly documented options at ..." and the report a bug link.
|atexit | false | If true, prints ASan exit stats even after program terminates successfully.| | ||
|can_use_proc_maps_statm | true | If false, do not attempt to read `/proc/maps/statm`. Mostly useful for testing sanitizers. (Not implemented - `/proc/maps/statm` doesn't exist on Windows)| | ||
|check_initialization_order | false | If true, attempts to catch initialization order issues.| | ||
|check_malloc_usable_size | true | Allows the users to work around the bug in Nvidia drivers prior to 295.*.| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please reconsider all places where you use 'user' in the doc. Probably could be replaced with 'you', yes?
|can_use_proc_maps_statm | true | If false, do not attempt to read `/proc/maps/statm`. Mostly useful for testing sanitizers. (Not implemented - `/proc/maps/statm` doesn't exist on Windows)| | ||
|check_initialization_order | false | If true, attempts to catch initialization order issues.| | ||
|check_malloc_usable_size | true | Allows the users to work around the bug in Nvidia drivers prior to 295.*.| | ||
|check_printf | true | If true, enables ASan to validate printf family function arguments for memory safety violations.| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid passive voice. Instead, be direct, e.g. "If true, Asan validates printf
family function arguments for memory safety violations." Applies throughout.
|check_initialization_order | false | If true, attempts to catch initialization order issues.| | ||
|check_malloc_usable_size | true | Allows the users to work around the bug in Nvidia drivers prior to 295.*.| | ||
|check_printf | true | If true, enables ASan to validate printf family function arguments for memory safety violations.| | ||
|clear_shadow_mmap_threshold | 64 * 1024 | Large shadow regions are zero-filled using `mmap(NORESERVE)` instead of `memset()`. This is the threshold size in bytes. (Not Implemented - `memset()` is always called on Windows)| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand whether 'not implemented' means the flag isn't implemented. If it isn't implemented, why are we documenting it? Maybe I misunderstand what not implemented means here.
|check_printf | true | If true, enables ASan to validate printf family function arguments for memory safety violations.| | ||
|clear_shadow_mmap_threshold | 64 * 1024 | Large shadow regions are zero-filled using `mmap(NORESERVE)` instead of `memset()`. This is the threshold size in bytes. (Not Implemented - `memset()` is always called on Windows)| | ||
|color | auto | Colorize reports: (always|never|auto). (Not Implemented on Windows)| | ||
|continue_on_error | 0 | Allows an application to continue running while reporting unique memory safety errors. 0 - disabled, 1 - stderr(1), 2 - stderr(2). See [continue_on_error](asan-continue-on-error.md).| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our style, verbose though it is, is to say "For more information about xxx, see link. Otherwise, we get linting errors on the docs.
|clear_shadow_mmap_threshold | 64 * 1024 | Large shadow regions are zero-filled using `mmap(NORESERVE)` instead of `memset()`. This is the threshold size in bytes. (Not Implemented - `memset()` is always called on Windows)| | ||
|color | auto | Colorize reports: (always|never|auto). (Not Implemented on Windows)| | ||
|continue_on_error | 0 | Allows an application to continue running while reporting unique memory safety errors. 0 - disabled, 1 - stderr(1), 2 - stderr(2). See [continue_on_error](asan-continue-on-error.md).| | ||
|coverage | false | If true, coverage information will be dumped at program shutdown (if the coverage instrumentation was enabled at compile time).| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passive voice is easy to fall into but less clear. An active voice fix here is: "if true and coverage instrumentation is enabled at compile time, coverage information is dumped when the program shuts down." Applies throughout.
It's Mac. I appreciate the feedback. Please do an edit pass, it has been quite a while since I've taken an English course haha. |
We previously linked outdated documentation for asan runtime options. It was all over the place and split into two pieces with no indication of what our implementation does in the event it diverges from the one on the llvm repo.
The new page will give our customers a complete and organized list of runtime options that Address Sanitizer supports.