-
Notifications
You must be signed in to change notification settings - Fork 87
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
replaceError(with:) results in EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) #12
Comments
Thanks for the report! My current instinct is that this is a bug in e.g.: assertNoFailurecancellable = Observable
.just("Hello Combine")
.publisher
.assertNoFailure()
.sink(receiveCompletion: { print($0) }, receiveValue: { print($0) }) catchcancellable = Observable
.just("Hello Combine")
.publisher
.catch { _ -> AnyPublisher<String, Never> in
Just("Error").eraseToAnyPublisher()
}
.sink(receiveCompletion: { print($0) }, receiveValue: { print($0) }) I think we should open a bug on the Swift forums, but not sure they'll enjoy reproducing this with a third-party dependency :) Wondering if we could reduce this to a smaller reproducible state. Any thoughts? @BrianDoig |
I'm honestly not sure how to reduce it smaller than
I know very little about Combine other than it's similar to RxSwift. This is already after I reduced the problem to just Combine, RxSwift and RxCombine. We have a bunch of RxSwift based libraries and they want us to start using SwiftUI and Combine so I was looking into getting our code existing code to work with SwiftUI. I didn't even know that assertNoFailure and catch would work. At the very least I can make my own method that does the catch for me as part of publish. Along the lines of publishReplaceError(with:) |
I was able to work around my problems at least using the following extension. Not sure if you want to include it in the library or follow up with Apple.
|
I have a fix for this, will upload soon @BrianDoig |
This was solved in RxCombine 1.5.0, would really appreciate knowing if this helped you @BrianDoig |
So... It was fixed but a second issue showed up with replaceError.
This code works fine with the asPublisherReplaceError(with:) but crashes in a new spot when run.
Stack frame 4 is this code
|
The following code results in a crash when run, but operates fine if you remove the call to replaceError. This is an issue if you want to use the results of an Observable with a Subscriber who's failure is Never.
Here is the code that the crash is occurring on (stack frame 2 is the last frame with symbols). Merely calling 'frame variable' from the debugger prompt crashes the debug session inside of Xcode. The automatic variables are as follows:
event RxSwift.Event<τ_0_0.Input>
self τ_0_0
element τ_0_0.Input
Here is the full call stack upon crash.
The text was updated successfully, but these errors were encountered: