[SR-14163] Unexpected twice deallocation when constructing enum cases #56542
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
standard library
Area: Standard library umbrella
Environment
Xcode Version 12.4 (12D4e)
> swift --version Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28) Target: x86_64-apple-darwin20.3.0
Additional Detail from JIRA
md5: d2112017708c38057866d77d3e22e56d
duplicates:
indirect
keyword resulting in a runtime crashIssue Description:
I ran into strange crashes when accessing model objects when I'm developing an iOS app. I spent some time diving deeper into these problems, I found that constructing enum cases in such a way like the following code will result twice deallocation of same object, which in turn crashes the whole app.
I believe its a bug of Swift language itself but I had little knowledge about its internals. Here is the self-contained code to reproduce this problem:
and here is the stacktrace
I hope the community can help in further investigation of this problem, thanks.
The text was updated successfully, but these errors were encountered: