forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 348
🍒Sanitizer diagnostics #11620
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
ndrewh
wants to merge
5
commits into
stable/21.x
Choose a base branch
from
sanitizer-diagnostics-21.x-cherry
base: stable/21.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
🍒Sanitizer diagnostics #11620
+177
−27
Conversation
This file contains hidden or 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
…dow (llvm#158378) Sometimes we are unable to find a sufficiently large gap to allocate the dynamic ASAN shadow. If a gap is not found, we will now output a (consolidated) memory map to show the user what regions were unavailable and how much memory we need. rdar://159142896 (cherry picked from commit 1fea3c5)
…onfig on Apple platforms (llvm#158665) An existing log message is triggered in InitializePlatformEarly if the address space max is not as sufficient for TSAN. Some Apple platforms expand the address space limit, but reserve much of the space TSAN needs. Therefore, we now check that the kernel has not mapped over the address space that we intend to use. IsAddressInMappedRegion is added to sanitizer_common. This introduces a new dependency on mach_vm_region_recurse during TSAN startup, so this intentionally fails softly (to avoid breaking current users who may be in a sandbox that doesn't allow this). rdar://135265279 (cherry picked from commit 51a840e)
…ing (llvm#158670) Some sanitizers use mach_vm_region_recurse on macOS to find a sufficiently large gap to allocate shadow memory. Some sandboxes do not allow this. When we get KERN_DENIED, we suggest to the user that it may have been blocked by the sandbox. For error codes other than KERN_INVALID_ADDRESS and KERN_DENIED, we make sure to log a message and not use the address. rdar://160625998 (cherry picked from commit 8fb02fa)
…sg (llvm#160171) This fixes a typo introduced in llvm#158665. (cherry picked from commit e99c43c)
…lvm#161282) Add some missing void* casts where we were passing an int for %p on some platforms. rdar://161174839 (cherry picked from commit 5960f5c)
wrotki
approved these changes
Oct 13, 2025
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.
LGTM
@swift-ci Please test |
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.
Cherry pick to 21.x: improvements to the sanitizer error handling and diagnostic messages on macOS
llvm#158378 - [sanitizer-common] Improve diagnostic when ASAN fails to allocate shadow
llvm#158665 - [sanitizer_common][tsan][Darwin] Improve message for unsupported vm config on Apple platforms
llvm#158670 - [sanitizer-common][Darwin] Improve mach_vm_region_recurse error handling
llvm#160171 - [compiler-rt] [TSan] [Darwin] Fix missing Report() arg in vm layout msg
llvm#161282 - [sanitizers][Darwin][NFC] Insert missing void* casts for printf %p