[SR-9627] Reassigning a list of dictionaries causes EXC_BAD_ACCESS on iOS when running the app in release build configuration #52073
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
crash
Bug: A crash, i.e., an abnormal termination of software
optimized only
Flag: An issue whose reproduction requires optimized compilation
run-time crash
Bug → crash: Swift code crashed during execution
Attachment: Download
Environment
Xcode 10.1 (10B61)
Swift 4.2
Additional Detail from JIRA
md5: 6afa60a6d76e2ad376139979372e931d
Issue Description:
When running the following code on a device or a simulator (in release build configuration) the app crashes with "EXC_BAD_ACCESS".
The problem was found by accident, and even though the code should not be written like this, someone else might run into the same (or similar) issue.
Below is a trimmed down version of the original code, which exhibit the problem:
I have tried doing the following modifications to the code, which all make the problem go away:
Changing the type of save()'s `value` parameter
Removing the key "b"
Removing the key "c"
Removing `.map(String.init)` from the key "c"
Moving `value` to a local variable
Setting the initial value of `params` to an empty list `[]`
Changing to `let params` and assign the second value directly
Modifications that does not make a difference:
The type of the value in key "a"
Names of the keys
Removing the cast to `Any` (Will prompt a warning)
I was not able to reproduce the problem in the Xcode playground, but I guess that is because the playground runs in debug mode.
The text was updated successfully, but these errors were encountered: