Recently when running a TestFlight build of an app I found that it was crashing in one place. When I went to debug I was unable to replicate. I flipped the configuration to a release configuration and then was able to replicate. Oddly, the code broke on one function but the call stack suggested a much deeper stack which eventually ended in a swift release call. After DAYS of trial and error I finally nailed the code down to one specific area. Then I tried a few different ways of phrasing the code and found a way where it would crash and a way where it would not.
Steps to Reproduce:
Unzip the attachment and open the project in Xcode 10.2.1
Ensure in edit scheme that the run configuration is set to release.
Comment out the two lines in ViewController.swift labeled “B” and run
It should crash
Comment out the two lines labeled “A” and uncomment “B”
Run and witness no crash
Flip the configuration to debug and repeat steps 3-6 noting that neither code crashes, not even A which crashes when it is set to release
Expected Results:
That the optimization levels changing does not cause a crash.
Actual Results:
The optimization levels (not sure which) causes a crash
Version/Build:
Xcode 10.2.1
FILED as radar 50339329
The text was updated successfully, but these errors were encountered:
I can confirm that, as per the info from @theblixguy below, this issue no longer occurs in 51. Thank you!
"Your project no longer crashes for me when I use a Swift 5.1 development toolchain. Apparently this was a bug with escape analysis - for now, you can just pass '-Xllvm -sil-disable-pass=stack-promotion' to fix the crash until Swift 5.1 is out."
Attachment: Download
Environment
Xcode 10.2.1
swift 5
Additional Detail from JIRA
md5: a13145c72556b1a498a55d23d6badc74
Issue Description:
Recently when running a TestFlight build of an app I found that it was crashing in one place. When I went to debug I was unable to replicate. I flipped the configuration to a release configuration and then was able to replicate. Oddly, the code broke on one function but the call stack suggested a much deeper stack which eventually ended in a swift release call. After DAYS of trial and error I finally nailed the code down to one specific area. Then I tried a few different ways of phrasing the code and found a way where it would crash and a way where it would not.
Steps to Reproduce:
Expected Results:
That the optimization levels changing does not cause a crash.
Actual Results:
The optimization levels (not sure which) causes a crash
Version/Build:
Xcode 10.2.1
FILED as radar 50339329
The text was updated successfully, but these errors were encountered: