应用崩溃,Xcode11.4,iOS 10.3.3 10.3.4,iPhone 5c / 5 iPad4(armv7s) [英] App crash , Xcode11.4, iOS 10.3.3 10.3.4, iPhone 5c /5 iPad4 (armv7s)

查看:158
本文介绍了应用崩溃,Xcode11.4,iOS 10.3.3 10.3.4,iPhone 5c / 5 iPad4(armv7s)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的应用在OS 10.3.3 10.3.4,由Xcode 11.4编译的iPhone 5c / 5 iPad4(armv7s 32)上崩溃时,迅速进行了优化。我们发现PC寄存器指向没有虚拟地址和堆栈信息的空地址。如果我们关闭快速优化,它就会起作用。



那么有人能找到问题和解决方案吗?



可以肯定,它与Xcode 11.4快速优化有关。



我在这里找到相同的问题。



< +0> ,< +4>是错误的。应该是

  0x6cd85c< + 0>:push.w {r4,r5,r6,r7,lr} 
0x6cd860< + 4> ;:添加r7,sp,#0xc

r7是fp。因此错误指令< +0>不保存r7,而< +4> sub ins使r7比sp低很多,这会导致整个堆栈混乱。因此,显然是错误的。



这是在执行ins时发生的情况。



之前:



之后:



整个堆栈由于fp错误而丢失。



我们也可以在xcode 11.3中进行验证。

< +0>< +2>与我们上面的期望相同。



因此,我们也必须降级到xcode 11.3,并使用运行时还原功能来适应应在xcode 11.4中调用的新iOS SDK功能。


Our app crash on os 10.3.3 10.3.4, iPhone 5c /5 iPad4 (armv7s 32) compiled by Xcode 11.4, swift optimization on. We find the PC register point to a hole address without virtual address and no stack information. If we close swift optimization, it works.

So do anyone find the problem and any solution?

It's certain that it's related to Xcode 11.4 swift optimization.

I find the same question here. https://www.reddit.com/r/iOSProgramming/comments/frcpsc/xcode_114_builds_crashes_on_ios_10/

Incident Identifier: 2224949E-E5E3-479C-9B08-4FD1473144B3
CrashReporter Key:   052c9a28855da965790a6dcc0885097a66ee4eff
Hardware Model:      iPad3,4
Process:             AAAAA [34872]
Path:                /private/var/containers/Bundle/Application/xxxxxx....
Identifier:          com.xxx.xxxxx
Version:             xxxx
Code Type:           ARM (Native)
Role:                Non UI
Parent Process:      launchd [1]
Coalition:           com.xxx.xxxxx [1932]


Date/Time:           2020-03-30 22:42:49.2564 +xxx
Launch Time:         2020-03-30 22:42:47.0000 +xxx
OS Version:          iPhone OS 10.3.3 (14G60)
Report Version:      104

Exception Type:  EXC_BAD_ACCESS (SIGBUS)
Exception Subtype: KERN_PROTECTION_FAILURE at 0x015fa500
Triggered by Thread:  0

Thread 0 name:
Thread 0 Crashed:
0   ???                             0x015fa500 0 + 23045376

解决方案

After lots of analysis such as log and instruction debug, I am surely it's a bug xcode 11.4 swift compiler optimization. Detailedly, the optimization cause a stack pointer (fp) messy at the point opening a new function stack frame. I show it in the following.

Here is a helper function type metadata accessor for myapp.MainViewController at <compiler-generated> generated by compiler in our mainviewcontroller.

<+0>, <+4> is wrong. It should be

0x6cd85c <+0>:   push.w {r4, r5, r6, r7, lr}
0x6cd860 <+4>:   add  r7, sp, #0xc

r7 is fp. so the error instruction <+0> don`t save r7, and <+4> sub ins makes r7 lower than sp a lot that causes all whole stack messy. So It's wrong clearly.

This is what happens when the ins execute.

Before:

After:

The whole stack loses becuase of fp error.

And we can also verify that in xcode 11.3. <+0> <+2> is the same as our expectation above.

So we have to downgrade to xcode 11.3 as well and use runtime refection to adapt new iOS SDK feature that should be call in xcode 11.4.

这篇关于应用崩溃,Xcode11.4,iOS 10.3.3 10.3.4,iPhone 5c / 5 iPad4(armv7s)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆