【问题标题】:Unable to understand where MyApp is crashing无法理解 MyApp 崩溃的位置
【发布时间】:2014-12-28 13:51:12
【问题描述】:

我的应用在某些情况下崩溃。无法找到崩溃的原因和地点。

以下是崩溃日志 (iPad/iOS 8.0.2)。

Hardware Model:      iPad2,5
OS Version:          iOS 8.0.2 (12A405)
Report Version:      105

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread:  0
Thread 0 Crashed:
0   libsystem_kernel.dylib          0x306b3dfc __pthread_kill + 8
1   libsystem_pthread.dylib         0x30733d0e pthread_kill + 58
2   libsystem_c.dylib               0x30653934 abort + 72
3   libc++abi.dylib                 0x2f864bb8 abort_message + 84
4   libc++abi.dylib                 0x2f87e66a default_terminate_handler() + 262
5   libobjc.A.dylib                     0x30052f0e _objc_terminate() + 190
6   libc++abi.dylib                 0x2f87bdec std::__terminate(void (*)()) + 76
7   libc++abi.dylib                 0x2f87b5ac __cxa_throw + 108
8   libobjc.A.dylib                     0x30052d46 objc_exception_throw + 246
9   CoreFoundation                  0x225dfe58 +[NSException raise:format:arguments:] + 100
10  Foundation                      0x232af2c4 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 88
11  BaseBoard                       0x270a08d8 __25-[BSAction sendResponse:]_block_invoke + 140
12  libdispatch.dylib               0x305bc99c _dispatch_barrier_sync_f_invoke + 44
13  BaseBoard                       0x270a0842 -[BSAction sendResponse:] + 98
14  UIKit                               0x25fd54d0 -[UIFetchContentInBackgroundAction sendResponse:] + 212
15  libdispatch.dylib               0x305b3610 _dispatch_call_block_and_release + 8
16  libdispatch.dylib               0x305b35fc _dispatch_client_callout + 20
17  libdispatch.dylib               0x305be2b2 _dispatch_main_queue_callback_4CF$VARIANT$mp + 714
18  CoreFoundation                  0x225a5e5c __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 4
19  CoreFoundation                  0x225a457c __CFRunLoopRun + 1508
20  CoreFoundation                  0x224f1dac CFRunLoopRunSpecific + 472
21  CoreFoundation                  0x224f1bbe CFRunLoopRunInMode + 102
22  GraphicsServices                0x2985404c GSEventRunModal + 132
23  UIKit                               0x25abda2c UIApplicationMain + 1436
24  MyApp                               0x000fb9f2 main (main.m:15)
25  libdyld.dylib                       0x305eeaac start + 0

提前谢谢..

【问题讨论】:

  • 感谢@flexicoer 的回复。这个崩溃是在我发布的版本中。并且没有重现此崩溃的步骤。我只有这个崩溃日志。
  • 你能解决这个问题吗?我在我的应用中看到了类似的崩溃,但我不知道它在哪里崩溃。
  • 我知道它已经晚了 - 差不多 4 年前,我现在遇到了同样的问题! @Vardhan 您是否已经弄清楚,哪个是正确答案?

标签: ios iphone ipad ios8


【解决方案1】:

堆栈跟踪对应的异常信息是:

"这个请求已经被绝育 - 你不能调用 -sendResponse: 两次 编码后也不行”

虽然无法单独从堆栈中确定,但您很可能调用了两次传递给应用委托的 -application:performFetchWithCompletionHandler: 方法的 completionHandler。

【讨论】:

    【解决方案2】:

    后台提取由操作系统触发,基于您在 setMinimumBackgroundFetchInterval: 方法中设置的值。 如果后台获取时间太长,您所看到的看起来就像操作系统对您的应用程序所做的那样。

    您被分配了一个时间窗口(30 秒)来完成您的工作。如果您没有完成,操作系统会杀死您的应用程序,但上述例外情况除外。 阅读更多关于如何延长所需时间here

    基本上,您需要请求更多时间来完成您的后台工作,如下所示:

    - (void)applicationDidEnterBackground:(UIApplication *)application
    {
        bgTask = [application beginBackgroundTaskWithName:@"MyTask" expirationHandler:^{
            // Clean up any unfinished task business by marking where you
            // stopped or ending the task outright.
            [application endBackgroundTask:bgTask];
            bgTask = UIBackgroundTaskInvalid;
        }];
    
        // Start the long-running task and return immediately.
        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
    
            // Do the work associated with the task, preferably in chunks.
    
            [application endBackgroundTask:bgTask];
            bgTask = UIBackgroundTaskInvalid;
        });
    }
    

    【讨论】:

      猜你喜欢
      • 2016-08-27
      • 1970-01-01
      • 2012-03-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多