iOS App(使用核心数据)更新后崩溃,但只有 App Store 版本
Posted
技术标签:
【中文标题】iOS App(使用核心数据)更新后崩溃,但只有 App Store 版本【英文标题】:iOS App (Using Core Data) Crashes After Update, But Only App Store Version 【发布时间】:2015-12-02 20:42:42 【问题描述】:我的 ios 9.1 应用程序存在严重问题:我已更新该应用程序,在多部 iPhone 设备上成功测试,将其提交到 App Store,Apple 审核并推出了该应用程序。该应用程序使用核心数据。
但是,问题在于,对于将其作为更新安装的用户,该应用在启动后会立即崩溃。下面列出了崩溃报告,但是,我找不到它的真正问题(也因为并非所有内容都被符号化)。如果我直接通过 Xcode 在同一设备上运行它,应用程序可以正常运行并且不会崩溃。
关于如何找到错误的任何想法?
非常感谢您的任何提示!
Incident Identifier: 82CFBBFB-D78F-45B8-B7B1-5CA927889673
CrashReporter Key: b74b72673e3b94fca688b2e61a466eb9826dc424
Hardware Model: iPhone7,1
Process: MyAppName [826]
Path: /private/var/mobile/Containers/Bundle/Application/13C779F5-8CEB-4815-AF64-18B08827CDEE/MyAppName.app/MyAppName
Identifier: com.myappdomain.MyAppName
Version: 20151128 (1.4)
Code Type: ARM-64 (Native)
Parent Process: launchd [1]
Date/Time: 2015-12-02 07:07:58.58 +0100
Launch Time: 2015-12-02 07:07:57.57 +0100
OS Version: iOS 9.1 (13B143)
Report Version: 105
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x200000001576a714
Triggered by Thread: 0
Filtered syslog:
None found
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 MyAppName 0x0000000100071a64 0x100040000 + 203364
1 MyAppName 0x00000001000721a0 0x100040000 + 205216
2 MyAppName 0x0000000100071d2c 0x100040000 + 204076
3 MyAppName 0x0000000100073624 0x100040000 + 210468
4 MyAppName 0x00000001000718d8 0x100040000 + 202968
5 MyAppName 0x0000000100071978 0x100040000 + 203128
6 MyAppName 0x0000000100071a20 0x100040000 + 203296
7 MyAppName 0x0000000100072848 0x100040000 + 206920
8 MyAppName 0x0000000100072e08 0x100040000 + 208392
9 MyAppName 0x000000010006c6f8 0x100040000 + 182008
10 MyAppName 0x000000010006fe68 0x100040000 + 196200
11 MyAppName 0x000000010006afdc 0x100040000 + 176092
12 UIKit 0x00000001883f4654 -[UIViewController _setViewAppearState:isAnimating:] + 724
13 UIKit 0x00000001884b45c8 -[UINavigationController viewDidAppear:] + 220
14 UIKit 0x00000001883f4654 -[UIViewController _setViewAppearState:isAnimating:] + 724
15 UIKit 0x00000001885239b8 -[UITabBarController viewDidAppear:] + 128
16 UIKit 0x00000001883f4654 -[UIViewController _setViewAppearState:isAnimating:] + 724
17 UIKit 0x00000001884654f0 __64-[UIViewController viewDidMoveToWindow:shouldAppearOrDisappear:]_block_invoke + 44
18 UIKit 0x000000018846548c -[UIViewController _executeAfterAppearanceBlock] + 92
19 UIKit 0x000000018868c674 _runAfterCACommitDeferredBlocks + 556
20 UIKit 0x00000001886994bc _cleanUpAfterCAFlushAndRunDeferredBlocks + 92
21 CoreFoundation 0x0000000182e0042c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 20
22 CoreFoundation 0x0000000182dffd64 __CFRunLoopDoBlocks + 308
23 CoreFoundation 0x0000000182dfdcc8 __CFRunLoopRun + 708
24 CoreFoundation 0x0000000182d2cca0 CFRunLoopRunSpecific + 384
25 GraphicsServices 0x000000018df68088 GSEventRunModal + 180
26 UIKit 0x0000000188444ffc UIApplicationMain + 204
27 MyAppName 0x00000001000581e4 0x100040000 + 98788
28 libdyld.dylib 0x000000019824a8b8 start + 4
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0 libsystem_kernel.dylib 0x00000001983684fc kevent_qos + 8
1 libdispatch.dylib 0x000000019822ca04 _dispatch_mgr_invoke + 232
2 libdispatch.dylib 0x000000019821b874 _dispatch_source_invoke + 0
Thread 2:
0 libsystem_kernel.dylib 0x0000000198367b6c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x000000019842d530 _pthread_wqthread + 1284
2 libsystem_pthread.dylib 0x000000019842d020 start_wqthread + 4
Thread 3:
0 libsystem_kernel.dylib 0x0000000198367b6c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x000000019842d530 _pthread_wqthread + 1284
2 libsystem_pthread.dylib 0x000000019842d020 start_wqthread + 4
Thread 4:
0 libsystem_kernel.dylib 0x0000000198367b6c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x000000019842d530 _pthread_wqthread + 1284
2 libsystem_pthread.dylib 0x000000019842d020 start_wqthread + 4
Thread 5:
0 libsystem_kernel.dylib 0x0000000198367b6c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x000000019842d530 _pthread_wqthread + 1284
2 libsystem_pthread.dylib 0x000000019842d020 start_wqthread + 4
Thread 6:
0 libsystem_kernel.dylib 0x0000000198367b6c __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x000000019842d530 _pthread_wqthread + 1284
2 libsystem_pthread.dylib 0x000000019842d020 start_wqthread + 4
Thread 0 crashed with ARM Thread State (64-bit):
x0: 0x00000001576a7350 x1: 0x000000015769c200 x2: 0x0000000000000000 x3: 0x0000000100071a40
x4: 0x000000016fdbdf60 x5: 0x000000016fdbdf68 x6: 0x0000000000000000 x7: 0x0000000000000004
x8: 0x200000001576a69c x9: 0x0000000000000018 x10: 0x0000000000000000 x11: 0x0000000300000003
x12: 0x000000015755f2f0 x13: 0x0000000000003fff x14: 0xffffffffffffc000 x15: 0x0000000000003fff
x16: 0x000000010027da54 x17: 0x0000000182e438dc x18: 0x0000000000000000 x19: 0x000000015769c200
x20: 0x00000001576a7350 x21: 0x000000016fdbe260 x22: 0x000000015769c200 x23: 0x000000015769c200
x24: 0x000000015769ccd0 x25: 0x000000015808fc20 x26: 0x000000010006ff58 x27: 0x000000016fdbe198
x28: 0x0000000000000002 fp: 0x000000016fdbe060 lr: 0x00000001000721a0
sp: 0x000000016fdbe020 pc: 0x0000000100071a64 cpsr: 0x20000000
【问题讨论】:
SIGSEGV
是分段错误或内存访问冲突。您的代码中的什么可能导致设备出现这种情况?我的建议……多线程。您是否在 CoreData 中的不同线程上使用不同的上下文?
不,我不在 Core Data 中使用不同的线程。但是,您认为 SIGSEGV 是否也可能是由 Core Data 模型的问题引起的?我没有刻意更改模型,但我记得以前我遇到过 Xcode 突然无法再打开模型编辑器的问题。不幸的是,我不记得当时我是如何解决这个问题的。
另外,为什么崩溃日志中没有清晰的堆栈跟踪?如果我知道[UIViewController _setViewAppearState:isAnimating:] + 724
的确切含义,那么当然会更容易找到错误:)。
原谅我的无知(也许其他人可以在这里插话),但我不太擅长解释崩溃日志......我看到的只是Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Subtype: KERN_INVALID_ADDRESS at 0x200000001576a714
,这对我来说表示一般异常错误和内存分配问题。
看看这是否有帮助...***.com/a/19555200/1883707
【参考方案1】:
以防其他人遇到此问题: 这个问题实际上是 Swift 的数组实现中的一个错误。以下代码在发布模式下崩溃:
myarr.sortInPlace($0.date < $1.date)
但是,这段代码可以正常工作:
myarr = myarr.sort($0.date < $1.date)
可以在此处找到有关此问题(希望 Apple 很快解决)的更多信息: https://forums.developer.apple.com/thread/23455
【讨论】:
以上是关于iOS App(使用核心数据)更新后崩溃,但只有 App Store 版本的主要内容,如果未能解决你的问题,请参考以下文章
IOs App 在模拟器上运行但在设备上崩溃(主要使用 AVFoundation)