-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Fix for a crash due to performLocalReleaseMotion and performLocalRetainMotion #38150
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
Conversation
@swift-ci test |
89dd896
to
cbb2ad1
Compare
@swift-ci test |
Build failed |
Build failed |
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.
Can you explain why we don't need RAUW for the RT_UnknownObjectRetain
case?
…inMotion In low level LLVMARCOptimizer, during canonicalization we don't rauw the result of RT_Retain with its arg similarly to RT_ObjCRetain and RT_BridgeRetain. And during performLocalReleaseMotion, we assert that we have canonicalized RT_Retain. In a release compiler, if we optimize such an RT_Retain with a RT_Release, then this can result in a compiler crash Similarly not rauw'ing, can cause a crash due to performLocalRetainMotion Fixes rdar://79238115
cbb2ad1
to
386cc23
Compare
@atrick The same issue can also happen with RT_UnknownObjectRetain. Fixed it. Thanks |
@swift-ci test |
Build failed |
@swift-ci test Linux Platform |
Build failed |
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.
Excellent. Thanks!
Trying again... @swift-ci test Linux Platform |
Build failed |
@swift-ci test Linux Platform |
Build failed |
Another flaky error. Trying again... @swift-ci smoke test Linux Platform |
@swift-ci clean smoke test Linux Platform |
…inMotion (swiftlang#38150) In low level LLVMARCOptimizer, during canonicalization we don't rauw the result of RT_Retain with its arg similarly to RT_ObjCRetain and RT_BridgeRetain. And during performLocalReleaseMotion, we assert that we have canonicalized RT_Retain. In a release compiler, if we optimize such an RT_Retain with a RT_Release, then this can result in a compiler crash Similarly not rauw'ing, can cause a crash due to performLocalRetainMotion Fixes rdar://79238115
In low level LLVMARCOptimizer, during canonicalization we don't rauw the result of RT_Retain and RT_UnknownObjectRetain with its arg similarly to RT_ObjCRetain and RT_BridgeRetain.
And during performLocalReleaseMotion, we assert that we have canonicalized RT_Retain/RT_UnknownObjectRetain.
In a release compiler, if we optimize such an RT_Retain/RT_UnknownObjectRetain with a RT_Release/RT_UnknownObjectRelease, then this can result in a compiler crash
Similarly not rauw'ing, can cause a crash due to performLocalRetainMotion.
Note: This crash may only happen when LLVM fails to optimize these retain calls which are marked with
returned
attribute.Fixes rdar://79238115