Skip to content

Update asan-known-issues.md #5340

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

zacklj89
Copy link
Contributor

  • Remove Win10 reference, as we're always targeting the latest Windows release with ASan
  • Add known issues bit about unloading DLLs causing issues

- Remove Win10 reference
- Add known issues bit about unloading DLLs
Copy link
Contributor

@zacklj89 : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change.

Copy link
Contributor

Learn Build status updates of commit e924f9a:

⚠️ Validation status: warnings

File Status Preview URL Details
docs/sanitizers/asan-known-issues.md ⚠️Warning Details

docs/sanitizers/asan-known-issues.md

  • Line 86, Column 140: [Warning: hard-coded-locale - See documentation] Link 'https://learn.microsoft.com/en-us/windows-hardware/drivers/taef/' contains locale code 'en-us'. For localizability, remove 'en-us' from links to most Microsoft sites.
  • Line 86, Column 140: [Suggestion: docs-link-absolute - See documentation] Absolute link 'https://learn.microsoft.com/en-us/windows-hardware/drivers/taef/' will be broken in isolated environments. Replace with a relative link.

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.

For any questions, please:

Copy link
Contributor

@davidmrdavid davidmrdavid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update. Left some comments, feel free to push back

@@ -82,6 +79,14 @@ As a workaround, create a *`Directory.Build.props`* file in the root of your pro

Thread local variables (global variables declared with `__declspec(thread)` or `thread_local`) aren't protected by AddressSanitizer. This limitation isn't specific to Windows or Microsoft Visual C++, but is a general limitation.

## Loading and unloading DLLs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm partial to this alternative title.

Suggested change
## Loading and unloading DLLs
## Issues with partially sanitized executables.

After all, the issue is not with loading and unloading dlls per-se, but instead with the partial /fsanitize across components. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TylerMSFT Can you respond to the comment above?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't my article. @zacklj89 is writing it.
My 2c is I like the suggested change.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TylerMSFT Whoops, sorry about that!

@zacklj89 Could you respond to the comment above?

@@ -82,6 +79,14 @@ As a workaround, create a *`Directory.Build.props`* file in the root of your pro

Thread local variables (global variables declared with `__declspec(thread)` or `thread_local`) aren't protected by AddressSanitizer. This limitation isn't specific to Windows or Microsoft Visual C++, but is a general limitation.

## Loading and unloading DLLs

If the entire process is not compiled with `/fsanitize=address`, there may be limitations in ASan's ability to diagnose memory safety errors. The most common example is when a DLL is compiled with ASan and loaded into a process that **was not** compiled with ASan. In this case, ASan will attempt to categorize allocations that took place prior to ASan initialization. If those allocations are transformed in any way (reallocated, moved, etc.), ASan will then attempt to own and monitor the lifetime and memory loads/stores.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I think we can be a bit more assertive in the opening sentence:

Suggested change
If the entire process is not compiled with `/fsanitize=address`, there may be limitations in ASan's ability to diagnose memory safety errors. The most common example is when a DLL is compiled with ASan and loaded into a process that **was not** compiled with ASan. In this case, ASan will attempt to categorize allocations that took place prior to ASan initialization. If those allocations are transformed in any way (reallocated, moved, etc.), ASan will then attempt to own and monitor the lifetime and memory loads/stores.
ASan's analysis is limited when executing alongside binaries that were not complied with `/fsanitize=address`. For example, this would occur if an executable compiled _without_ `/fsanitize=address` loads an ASan-instrumented `.dll`.
In this case, ASan coverage over allocations that took place prior to ASan initialization is best-effort. If those allocations are transformed in any way (reallocated, moved, etc.), ASan will then attempt to own and monitor their lifetime and accesses moving forward.


If the entire process is not compiled with `/fsanitize=address`, there may be limitations in ASan's ability to diagnose memory safety errors. The most common example is when a DLL is compiled with ASan and loaded into a process that **was not** compiled with ASan. In this case, ASan will attempt to categorize allocations that took place prior to ASan initialization. If those allocations are transformed in any way (reallocated, moved, etc.), ASan will then attempt to own and monitor the lifetime and memory loads/stores.

In the event that all DLLs compiled with ASan leave the process before the end of its execution (like in the event of test drivers such as [TAEF](https://learn.microsoft.com/en-us/windows-hardware/drivers/taef/)), there may dangling references to intercepted functions (`memcmp`, `memcpy`, `memmove`, etc.), and may result in crashes. This is a current limitation with these configurations and unloading DLLs.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in this case, I think the TAEF reference may be removed, unless we think we'll get more TAEF reports in the future. I don't feel strongly, but given that it's mostly an internal tool, I'm unsure if there's much value in referencing it externally.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a current limitation with these configurations and unloading DLLs.

Is this a limitation of TAEF, or our own. I feel like there's little we could do to improve this, or is there?

Copy link
Contributor

Learn Build status updates of commit ab00c49:

⚠️ Validation status: warnings

File Status Preview URL Details
docs/sanitizers/asan-known-issues.md ⚠️Warning Details

docs/sanitizers/asan-known-issues.md

  • Line 86, Column 145: [Warning: hard-coded-locale - See documentation] Link 'https://learn.microsoft.com/en-us/windows-hardware/drivers/taef/' contains locale code 'en-us'. For localizability, remove 'en-us' from links to most Microsoft sites.
  • Line 86, Column 145: [Suggestion: docs-link-absolute - See documentation] Absolute link 'https://learn.microsoft.com/en-us/windows-hardware/drivers/taef/' will be broken in isolated environments. Replace with a relative link.

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.

For any questions, please:

Copy link
Contributor

Learn Build status updates of commit fab571c:

✅ Validation status: passed

File Status Preview URL Details
docs/sanitizers/asan-known-issues.md ✅Succeeded

For more details, please refer to the build report.

For any questions, please:

Copy link
Contributor

PRMerger Results

Issue Description
File Change Percent This PR contains file(s) with more than 30% file change.

@v-dirichards
Copy link
Contributor

@TylerMSFT

Can you review the proposed changes?

Important: When the changes are ready for publication, adding a #sign-off comment is the best way to signal that the PR is ready for the review team to merge.

#label:"aq-pr-triaged"
@MicrosoftDocs/public-repo-pr-review-team

@prmerger-automator prmerger-automator bot added the aq-pr-triaged Tracking label for the PR review team label May 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants