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
IdentifiedArray Subscript Read crash #26
Labels
apple bug
Something isn't working due to a bug on Apple's platforms.
Comments
Not sure if it’s the same bug but we’re also seeing a similar crash on updateOrAppend. Here’s the stacktrace:
It crashes reliably on an iOS 15 simulator or an iPhone 6s running iOS 15.0.2 (both debug) |
2 tasks
stephencelis
added
the
apple bug
Something isn't working due to a bug on Apple's platforms.
label
Oct 19, 2021
FYI: There's a PR with a fix now: apple/swift-collections#123 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
I'm migrating an app to TCA and experiencing crashes in
IdentifiedArray.subscript.read
during an equality check.Unfortunately I haven't been able to reproduce this case in an isolated example yet.
I haven't been able to reproduce the crash in a predictable way with my app either (it seems to appear 'randomly') – but it seems to be triggered by the use
Reducer.debug
.Here is my stack trace:
From what I've been able to debug, at some point
IdentifiedArray.subscript(position:Int)
is called with an invalid position.The
_keys
and_values
elements of_dictionary
go out of sync (in my case,_keys
contains 14 elements whereas_dictionary
only contains 13 – which causes an out of range access).For performances reason, one of my TCA state is a
class
, not astruct
, and the crash occurs when its equality is checked.I'm using
IdentifiedArray
in a lot of other places instruct
states and haven't experienced any crash – so this might be related, I guess?Here is a simplified version of my class:
I'm not doing anything fancy with the array, the only methods I'm calling are
updateOrInsert
,update
,append
,sort
– and everything is performed on a single queue.Version
:0.3.1
Xcode 13.0 (release)
Swift 5.5 (swiftlang-1300.0.31.1 clang-1300.0.29.1)
The crash occurs on iOS
15.0
&15.1
, I haven't been able to test on MacOS.I'm happy to provide more details if needed – also if this turns out to be a TCA issue, I'll gladly move this issue to its repo.
The text was updated successfully, but these errors were encountered: