Xcode 10(10A255) built iOS app randomly(high rate) crash on iOS 9 devices via TestFlight, while Xcode 9 does not

Number:rdar://44885450 Date Originated:September 23 2018
Status:Open Resolved:No
Product:Developer Product Version:Xcode 10 (10A255)
Classification: Reproducible:Always
Xcode 10 (10A255) built App will randomlly crash on only iOS 9 device, while with the same code && build configuration, Xcode 9 built App will not crash.

Steps to Reproduce:
1. Create an application contains UILabel && UIImageView
2. Build with Xcode 10, submit to TestFlight, and install on iOS 9.0~iOS 9.3.3 real device via TestFlight App.
3. Open the App and when displaying label or images, the App crashed.
4. More information, these crash only happened on iOS 9 device, but not iOS 10+ device. And with the same build via Xcode 9, the crash disappear.

Expected Results:
The App won't crash when trigger some specify steps, such as laying out the UILabel, showing images, etc.

Actual Results:
The App crash when trigger some specify step, such as laying out the UILabel, showing images, etc.

Xcode 10 (10A255)

Test with Xcode 10 (10A255) Release Mode build, submit to TestFlight App and install on iOS 9.3 device. Follow the step as above and crash. Also tried both New Build System and Legacy Build System, behave the same.

Test with Xcode 9.4.1(9F2000) Release Mode build, submit to TestFlight App and install on iOS 9.3 device. Follow the step as above but not crash.

Crash Log:

Please see the following crash log. We found that some specify methods can trigger a crash in high ratio. Such as `-[UILabel sizeThatFits:]`, `-[NSString boundingRectWithSize:options:attributes:context:]`, `-[UIImage imageNamed:]`, etc.



This issue was fixed in Xcdoe 10.1-beta 2, check the release log: https://developer.apple.com/documentation/xcode_release_notes/xcode_10_1_beta_2_release_notes#3038341

Related Issue: http://www.openradar.me/44736684 http://www.openradar.me/6164844138987520


More interesting, at first we think it's because of Debug Mode && Release Mode of build configuration. However, when running Profile (Release Mode) with Instuments on iOS 9.2 real device, we reproduce with the same step but didn't face this crash. So maybe it's not related to the DEBUG macro as well.


And after search some relevant issue, we found something similar in https://forums.developer.apple.com/thread/60919. And we checked all Assets.car files, but however, we don't have any images with P3 colorspace, or ARGB-16bit. So I guess maybe the crash may not related to this issue.

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!