[SR-12743] Crash in _bridgeCocoaString on Xcode 11.4.1 #55188
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
standard library
Area: Standard library umbrella
Attachment: Download
Environment
Xcode 11.4.1, SWIFT_OPTIMIZATION_LEVEL -Osize
Additional Detail from JIRA
md5: 98162c71f67d2f58cf596947c9282e8c
Issue Description:
Hi,
I get a runtime error, EXC_BAD_ACCESS, when setting the title of a Swift UIViewController, after viewDidLoad is called. I can only reproduce in the specific environment described here.
I attached two screenshots that illustrate the stacktrace and show the retain / release sequence that's causing the crash.
Code snippet:
It seems to be related to NSMutableString, so my workaround in the real code, which uses a mutable string, was to copy the string before setting it to _displayName.
I am totally unfamiliar with StringBridge and I wonder why my view controller calls release on an object allocated by _bridgeCocoaString; I thought that would be transparent for the caller?
The text was updated successfully, but these errors were encountered: