iOS NSURLConnection _resourceLoadLoop崩溃

时间:2012-02-15 02:30:54

标签: ios nsurlconnection ipad-2

我遇到了一个奇怪的问题

我正在使用NSURLConnection来做一些URL请求

它在模拟器上工作正常

但它在ipad2 5.0上崩溃

我试过iPad1 5.01,ipad2 4.33,ipad2 5.01,工作正常

在ipad2 5.0上崩溃

我不确定是什么问题

似乎有问题

[NSURLConnection(Loader)_resourceLoadLoop:]

我想也许NSURLConnection的委托可能会在NSURLConnection做之前被破坏

所以我与代表保留,但仍然崩溃

有人知道可能导致这个问题的原因吗?

崩溃日志:

Date/Time:       2012-02-14 23:31:47.416 +0800
OS Version:      iPhone OS 5.0 (9A334)
Report Version:  104

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x000049de
Highlighted Thread:  3

Thread 0 name:  Dispatch queue: com.apple.libdispatch-manager
Thread 0:
0   libsystem_kernel.dylib          0x31e973b4 kevent + 24
1   libdispatch.dylib               0x316a6f74 _dispatch_mgr_invoke + 708
2   libdispatch.dylib               0x316a6c92 _dispatch_mgr_thread + 30

Thread 1:
0   libsystem_kernel.dylib          0x31ea7cd4 __workq_kernreturn + 8
1   libsystem_c.dylib               0x30d2730a _pthread_wqthread + 610
2   libsystem_c.dylib               0x30d2709c start_wqthread + 0

Thread 2 name:  WebThread
Thread 2:
0   libsystem_kernel.dylib          0x31e97010 mach_msg_trap + 20
1   libsystem_kernel.dylib          0x31e97206 mach_msg + 50
2   CoreFoundation                  0x371c441c __CFRunLoopServiceMachPort + 120
3   CoreFoundation                  0x371c3154 __CFRunLoopRun + 876
4   CoreFoundation                  0x371464d6 CFRunLoopRunSpecific + 294
5   CoreFoundation                  0x3714639e CFRunLoopRunInMode + 98
6   WebCore                         0x347ac128 _ZL12RunWebThreadPv + 396
7   libsystem_c.dylib               0x30d2cc16 _pthread_start + 314
8   libsystem_c.dylib               0x30d2cad0 thread_start + 0

Thread 3 name:  com.apple.NSURLConnectionLoader
Thread 3:
0   libsystem_kernel.dylib          0x31e97010 mach_msg_trap + 20
1   libsystem_kernel.dylib          0x31e97206 mach_msg + 50
2   CoreFoundation                  0x371c441c __CFRunLoopServiceMachPort + 120
3   CoreFoundation                  0x371c3154 __CFRunLoopRun + 876
4   CoreFoundation                  0x371464d6 CFRunLoopRunSpecific + 294
5   CoreFoundation                  0x3714639e CFRunLoopRunInMode + 98
6   Foundation                      0x31ab0bc2 +[NSURLConnection(Loader) _resourceLoadLoop:] + 302
7   Foundation                      0x31ab0a8a -[NSThread main] + 66
8   Foundation                      0x31b4459a __NSThread__main__ + 1042
9   libsystem_c.dylib               0x30d2cc16 _pthread_start + 314
10  libsystem_c.dylib               0x30d2cad0 thread_start + 0

Thread 4 name:  WebCore: CFNetwork Loader
Thread 4:
0   libsystem_kernel.dylib          0x31e97010 mach_msg_trap + 20
1   libsystem_kernel.dylib          0x31e97206 mach_msg + 50
2   CoreFoundation                  0x371c441c __CFRunLoopServiceMachPort + 120
3   CoreFoundation                  0x371c3154 __CFRunLoopRun + 876
4   CoreFoundation                  0x371464d6 CFRunLoopRunSpecific + 294
5   CoreFoundation                  0x3714639e CFRunLoopRunInMode + 98
6   WebCore                         0x347d569e _ZN7WebCoreL15runLoaderThreadEPv + 122
7   libsystem_c.dylib               0x30d2cc16 _pthread_start + 314
8   libsystem_c.dylib               0x30d2cad0 thread_start + 0

Thread 5 name:  com.apple.CFSocket.private
Thread 5:
0   libsystem_kernel.dylib          0x31ea7570 __select + 20
1   CoreFoundation                  0x371c866a __CFSocketManager + 726
2   libsystem_c.dylib               0x30d2cc16 _pthread_start + 314
3   libsystem_c.dylib               0x30d2cad0 thread_start + 0

Thread 6 name:  WebCore: LocalStorage
Thread 6:
0   libsystem_kernel.dylib          0x31ea7068 __psynch_cvwait + 24
1   libsystem_c.dylib               0x30d2cf2e _pthread_cond_wait + 634
2   libsystem_c.dylib               0x30d2ccaa pthread_cond_wait + 34
3   JavaScriptCore                  0x3382040e WTF::ThreadCondition::timedWait(WTF::Mutex&, double) + 54
4   WebCore                         0x3490b494 WTF::PassOwnPtr<WebCore::LocalStorageTask> WTF::MessageQueue<WebCore::LocalStorageTask>::waitForMessageFilteredWithTimeout<bool ()(WebCore::LocalStorageTask*)>(WTF::MessageQueueWaitResult&, bool (&)(WebCore::LocalStorageTask*), double) + 52
5   WebCore                         0x3490b44a WebCore::LocalStorageThread::threadEntryPointCallback(void*) + 106
6   libsystem_c.dylib               0x30d2cc16 _pthread_start + 314
7   libsystem_c.dylib               0x30d2cad0 thread_start + 0

Unknown thread crashed with ARM Thread State:
    r0: 0x0000499a    r1: 0x00000000      r2: 0x35fca80d      r3: 0x00000000
    r4: 0x0014bf50    r5: 0x3e4ce540      r6: 0x00115030      r7: 0x00000000
    r8: 0x001d5a60    r9: 0x000000fb     r10: 0x2fe5a688     r11: 0x305b1913
    ip: 0x00067a2d    sp: 0x2fe5a688      lr: 0x00067a49      pc: 0x30878f4e
  cpsr: 0x60000030

1 个答案:

答案 0 :(得分:0)

当崩溃日志显示“突出显示的线程:”时,它可能仍然是一个不同的线程。这不确定。

除了线程0(主线程)之外的所有线程似乎都在等待或陷阱时停止。由于线程零是唯一显示为活动的线程,因此它是崩溃的真正来源。

由于线程0的底部确实有main()或UIApplication,因此堆栈可能已损坏,或者在某些使用非标准方式构建堆栈帧的系统函数中。