从通知中心启动应用程序时出现奇怪的崩溃 [英] weird crash when launching app from Notification Center

查看:251
本文介绍了从通知中心启动应用程序时出现奇怪的崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的智慧结束了,我得到一个奇怪的崩溃,只有当应用程序从通知中心启动时才会发生。点击本地通知(在通知方面)或调用extensionContext:openURL:completionHandler(来自my Today小部件)将使用customURL方案启动应用程序。

I'm at my wits end, I'm getting a weird crash that only happens when the app is launched from Notification Center. Either tapping on a local notification (in the notification side) or a call to extensionContext:openURL:completionHandler (from my Today widget) will launch the app with a customURL scheme.

当应用程序运行时(热启动),没有问题,就像宣传的一样。当我杀死应用程序(在任务切换器中)然后尝试通过通知中心(冷启动)启动它时,我收到以下崩溃报告。

When the app is running (warm boot), no issues, works just as advertised. When I kill the app (in task switcher) and then try to launch it through Notification Center (cold boot), I get the below crash report.

我搜索任何事物的低和高,都找不到它。这只发生在iOS8设备上,iOS7设备没有问题(通知启动,显然没有今天的小部件)

I've search low and high for anything, can't find it. This only happens on iOS8 devices, iOS7 devices has no issue (with the notification launch, obviously no Today widget)

有没有人见过这个?

谢谢!

Date/Time:           2014-10-14 18:16:39.924 -0400
Launch Time:         2014-10-14 18:16:38.667 -0400
OS Version:          iOS 8.0.2 (12A405)
Report Version:      105

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x000000016a4cbeb8
Triggered by Thread:  0

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libobjc.A.dylib                 0x0000000195ebbbd0 objc_msgSend + 16
1   UIKit                           0x000000018a27d840 -[UIApplication workspaceDidEndTransaction:] + 216
2   FrontBoardServices              0x000000018da7563c __31-[FBSSerialQueue performAsync:]_block_invoke + 24
3   CoreFoundation                  0x000000018582a35c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 16
4   CoreFoundation                  0x0000000185829464 __CFRunLoopDoBlocks + 308
5   CoreFoundation                  0x0000000185827a88 __CFRunLoopRun + 1752
6   CoreFoundation                  0x0000000185755660 CFRunLoopRunSpecific + 392
7   UIKit                           0x000000018a05f4fc -[UIApplication _run] + 548
8   UIKit                           0x000000018a05a4f4 UIApplicationMain + 1484
9   therichest                      0x00000001001caa8c main (main.m:16)
10  libdyld.dylib                   0x0000000196516a04 start + 0


推荐答案

您使用的代码或第三方库是手动旋转runloop。这导致-workspaceDidEndTransaction:被重新调用并在释放后触发使用。如果在 - [NSRunLoop runMode:beforeDate:]和 - [NSRunLoop runUntilDate:]上设置断点,它应该使用前一个堆栈帧上的有罪代码命中。

Either your code or a third-party library you are using is manually spinning the runloop. This is causing -workspaceDidEndTransaction: to be called re-entrantly and triggers a use after free. If you set a breakpoint on -[NSRunLoop runMode:beforeDate:] and -[NSRunLoop runUntilDate:], it should hit with the guilty code being on the previous stack frame.

虽然从不建议手动旋转运行循环,但如果您可以延迟执行直到应用程序完成启动(收到所有启动应用程序委托调用),您应该避免遇到此崩溃。

While manually spinning the run loop is never recommended, if you can delay doing it until your application finishes starting up (all the launch app delegate calls received) you should avoid hitting this crash.

这篇关于从通知中心启动应用程序时出现奇怪的崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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