-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[ASan] Disable annotations on unsupported platforms #4058
Merged
StephanTLavavej
merged 6 commits into
microsoft:main
from
strega-nil:stl_asan.lib-doesnt-exist
Oct 4, 2023
Merged
[ASan] Disable annotations on unsupported platforms #4058
StephanTLavavej
merged 6 commits into
microsoft:main
from
strega-nil:stl_asan.lib-doesnt-exist
Oct 4, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add a new define, `_DISABLE_ASAN_ANNOTATIONS`, which disables all ASan annotations in the standard library as opposed to requiring a person to define both `_DISABLE_STRING_ANNOTATION` and `_DISABLE_VECTOR_ANNOTATION`. Disable ASan annotations on unsupported platforms like ARM64. If someone is working on adding address sanitizer support on those platforms (* wink wink nudge nudge *) they can define the `_ENABLE_ASAN_ANNOTATIONS_ON_UNSUPPORTED_PLATFORMS` escape hatch to get STL annotations anyways, though they will need to provide their own stl_asan.lib. Also, fix a bug where `annotate_string` (and `annotate_vector`) were not getting set to `0` if you passed both `_DISABLE_STRING_ANNOTATION` and `_DISABLE_VECTOR_ANNOTATION`.
CaseyCarter
requested changes
Sep 28, 2023
4bb2b41
to
08b8c2f
Compare
CaseyCarter
requested changes
Sep 29, 2023
I've also cleaned up everything in a way that's hopefully more obvious.
08b8c2f
to
debd882
Compare
CaseyCarter
approved these changes
Oct 2, 2023
StephanTLavavej
requested changes
Oct 2, 2023
StephanTLavavej
requested changes
Oct 2, 2023
StephanTLavavej
requested changes
Oct 2, 2023
StephanTLavavej
approved these changes
Oct 2, 2023
CaseyCarter
approved these changes
Oct 2, 2023
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
Thanks for improving the ASan experience! 🎉 📈 ⚙️ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add a new define,
_DISABLE_ASAN_ANNOTATIONS
, which disables all ASan annotations in the standard library as opposed to requiring a person to define both_DISABLE_STRING_ANNOTATION
and_DISABLE_VECTOR_ANNOTATION
.Disable ASan annotations on unsupported platforms like ARM64. If someone is working on adding address sanitizer support on those platforms (* wink wink nudge nudge *) they can define the
_ENABLE_ASAN_ANNOTATIONS_ON_UNSUPPORTED_PLATFORMS
escape hatch to get STL annotations anyways, though they will need to provide their own stl_asan.lib.Additionally, add two new defines:
_DISABLE_STL_ANNOTATION
_ANNOTATE_STL
which do the job of
_DISABLE_STRING_ANNOTATION
and_DISABLE_VECTOR_ANNOTATION
, and_ANNOTATE_STRING
and_ANNOTATE_VECTOR
respectively. This allows users to pass these defines without worrying we'll add new ones for other containers.Also, fix a bug where
annotate_string
(andannotate_vector
) were not getting set to0
if you passed both_DISABLE_STRING_ANNOTATION
and_DISABLE_VECTOR_ANNOTATION
.Fixes #4035