-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Potential bug with iOS 14 beta 3 - crash when cancelling an effect #232
Comments
Dang, this is a bummer. If you find a way to get a repro we'd love to see it. Maybe we can file a bug with Apple. |
@mbrandonw I am getting this in the Case studies as well in the Elm-like subscriptions: Start timer, stop timer, observe crash 🤔 |
Ah thanks @jakobmygind! I can definitely reproduce now, and can even reproduce in our effect cancellation tests. It seems that the newest version of Swift is more strict with simultaneous access to a value, in this case a cancellable. We are looking into it now. Also the bug of immediately crashing in the long living effects case study is due a SwiftUI bug where |
Weirdly the TCA test suite passes on macOS and crashes on iOS 🤔 Not sure how that is possible. Also, the stack trace of where it crashes on iOS and slightly different from that same point on macOS. Very strange. |
Any known workarounds so far? Me, and my users, are experiencing this too. |
With the same beta target, I see a similar crash when using |
Just to be sure @damirstuhec and @elkraneo, this is only happening in the newest Xcode beta right? Not in Xcode 11? |
@mbrandonw for me, it's happening on devices running iOS 14 beta 3, and yes, Xcode beta. |
@mbrandonw yes, full beta environment (macOS Big Sur and Xcode with the latest beta releases). |
Just to confirm I have only seen this on Xcode 12/iOS 14 beta 3. No issues in previous betas or iOS 13/Xcode 11. |
For me, It's happening on iOS 14 beta 3 on both Xcode 12 Beta & Xcode 11.6 . |
I wasn't able to reproduce this bug on 11.6. Are you sure it's happening on that version of Xcode? |
With more and more users using iOS 14 betas, this is becoming a quite pressing issue. 😞 I personally haven't found a workaround yet. |
The |
@mbrandonw, Yes I was able to reproduce it, check it out here . |
https://github.com/apple/swift/blob/master/docs/OwnershipManifesto.md |
https://swift.org/blog/swift-5-exclusivity/
A quick and dirty workaround is to set Exclusive Access to Memory to Compile-time Enforcement Only. The corresponding swiftc compiler flags are
|
@mycroftcanner why would this have only become a problem in the latest beta rather than in previous betas or earlier Swift 5 releases? Also, I'm seeing this in debug builds, I haven't even tried a release build. |
We also have only seen this memory exclusivity issue crop up in iOS and not macOS. The Combine stack is also different across platforms. We're hoping that this will be fixed in the next beta, but the more Feedback filed the better... |
Just pushed this here: #244 Will probably merge soon to unblock folks that want to bring in the |
@stephencelis thanks for finding a workaround to this, I'm going to see if the previously failing release starts working again on the new Xcode b4. |
Good news! The bug appears to have been resolved in Xcode 12 beta 4. I can pause and unpause my in-game timer successfully, so you may be able to revert #244 after a bit more testing. 🤞🏻 |
Describe the bug
I have an app that has a timer which can be paused and unpaused. Starting the timer uses a cancellable effect, pausing the timer cancels the effect.
This was working fine in previous betas, but it now crashes with the following:
To Reproduce
I don't have a small reproducer yet, but here's the relevant timer code from my app:
The background is unlikely to be relevant as this is happening in the foreground but its part of the same overall effect.
The action handler in the reducer is straightforward and is triggered by tapping the play/pause button:
Expected behavior
I expect the timer to be cancelled and the app not to crash, as before.
Environment
The text was updated successfully, but these errors were encountered: