This repository was archived by the owner on Mar 28, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 176
In llvm.asan.globals, allow entries to be non-GlobalVariable and skip over them #133
Merged
kubamracek
merged 1 commit into
swift-5.0-branch
from
skip-invalid-entries-in-asan-globals
Dec 19, 2018
Merged
In llvm.asan.globals, allow entries to be non-GlobalVariable and skip over them #133
kubamracek
merged 1 commit into
swift-5.0-branch
from
skip-invalid-entries-in-asan-globals
Dec 19, 2018
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
@swift-ci please test |
Could you add a .ll test for this that highlights the kind of IR this is supposed to accept? |
I'll take your word for it that ignoring them is the right thing to do in this case. This should be upstreamed, though, right? |
So far, this looks a Swift-only problem, so I want to start here to get a fix out soon. |
I'm in no position to lecture anyone about preferring to commit things upstream, but this is easily reproducible from valid inputs:
|
(Exercise for the reader on how to produce those inputs from valid C.) |
I see! Moved to https://reviews.llvm.org/D55794 and added a test. |
llvm-git-migration
pushed a commit
to llvm-git-prototype/llvm
that referenced
this pull request
Dec 18, 2018
…nd skip over them Looks like there are valid reasons why we need to allow bitcasts in llvm.asan.globals, see discussion at apple/swift-llvm#133. Let's look through bitcasts when iterating over entries in the llvm.asan.globals list. Differential Revision: https://reviews.llvm.org/D55794 llvm-svn=349544
…nd skip over them Looks like there are valid reasons why we need to allow bitcasts in llvm.asan.globals, see discussion at #133. Let's look through bitcasts when iterating over entries in the llvm.asan.globals list. Differential Revision: https://reviews.llvm.org/D55794 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349544 91177308-0d34-0410-b5e6-96231b3b80d8
163acd6
to
bddfc85
Compare
Changes this PR to just be a cherry-pick of r349544. @rjmccall looks good for 5.0? |
rjmccall
approved these changes
Dec 18, 2018
Yep! |
@swift-ci please test |
1 similar comment
@swift-ci please test |
earl
pushed a commit
to earl/llvm-mirror
that referenced
this pull request
Dec 18, 2018
…nd skip over them Looks like there are valid reasons why we need to allow bitcasts in llvm.asan.globals, see discussion at apple/swift-llvm#133. Let's look through bitcasts when iterating over entries in the llvm.asan.globals list. Differential Revision: https://reviews.llvm.org/D55794 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349544 91177308-0d34-0410-b5e6-96231b3b80d8
llvm-git-migration
pushed a commit
to llvm-git-prototype/llvm-legacy-branches
that referenced
this pull request
Jan 4, 2019
…nd skip over them Looks like there are valid reasons why we need to allow bitcasts in llvm.asan.globals, see discussion at apple/swift-llvm#133. Let's look through bitcasts when iterating over entries in the llvm.asan.globals list. Differential Revision: https://reviews.llvm.org/D55794 llvm-svn: 349544
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Swift from master currently crashes when building even very simple programs with -O -whole-module-optimization -sanitize=address. The actual crash happens in the AddressSanitizer instrumentation pass because it finds entries inside the llvm.asan.globals list that are not GlobalVariable objects. In short, what happens is that when IRGen emits type descriptors, we add them to the llvm.asan.globals list to avoid instrumenting them, but in WMO, we emit lazy type descriptors and use forward declarations and when those are later replaced with an actual definition, we use replaceAllUsesWith to replace them with a BitCast object. There are valid reasons why we need the BitCast when replacing the type descriptor, so we should instead allow them in the llvm.asan.globals list.