Is anyone else seeing crashes on 32 bit devices (iOS 10 or earlier) after updating to Xcode 11.4? After releasing to the App Store we say tons of crash-on-launch bugs with stack traces in the Branch SDK and Firebase SDK. I suspect it is a compiler change because I hadn't updated either SDK for a few releases.
There is more investigation happening on this github issue, I was just curious if anyone else has run into it.
I got an iPad 2 today to repro the crashes. I see a different crash trace than Crashlytics was reporting (perhaps this is a hard one for Crashlytics to capture - I noticed that there were 100+ different crash sites being reported and none of them has "crash reason" set.) It only repros when using a Release build profile.
This is the crash trace. It looks like somehow the pc gets pointed at 0x0 while looking up some Swift metadata.
The same for me, after updating to Xcode 11.4, my app crashes on 32 bits devices.
It appears to be related to the Swift compiler optimization level. If the level is anything other than -Onone, it crashes on startup with EXC_BAD_ACCESS...
We are getting this exact same problem in our medical app. The crash is happening to old devices (as same as iPhone 5). The project has been compiled using Xcode 11.4.
After lots of work such as log and instruction debugging, I am surely it's a bug xcode 11.4 swift compiler optimization. Detailly, the optimization cause a stack pointer (fp) at the point opening a new function stack frame. I show it in the following.
Good to see this thread. I've spent lots of time debugging on a 32-bit device and found this pattern: reducing number of properties in an offending class/struct helps. It's a kind of anecdotal but deleting some properties seemed to have helped in my case.
class OffendingClass {
let one: ClassA
let two: ClassB
let three: ClassC
let four: StructA
let five: StructB? // deleting this property makes it work
init(one: ClassA, two: ClassB, three: ClassC, four: StructA, five: StructB?) {
self.one = one
self.two = two
self.three = three
self.four = four
self.five = five
}
}
This seems to be consistent with the stack corruption as described by @victor-c
It takes time to find offending class/struct but once you have located it, it's getting pretty obvious that some of its property access results in an exception. In some cases code refactoring may help avoid this broken compiler optimization.