4

I met a strange problem

I am using a NSURLConnection to do some URL request

it work fine on simulator

but it crash on ipad2 5.0

I've tried on iPad1 5.01 ,ipad2 4.33,ipad2 5.01, it worked fine

just crash on ipad2 5.0

I'm not sure what problem is

it seems something wrong with

[NSURLConnection(Loader) _resourceLoadLoop:]

I thought maybe NSURLConnection's delegate may be destroy before NSURLConnection do it's job

so I make retain with the delegate,but still crash

does anybody know what may cause this problem?

crash log:

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
Popeye
  • 11,839
  • 9
  • 58
  • 91
IPaPa
  • 368
  • 2
  • 12

1 Answers1

0

When the crash logs say "Highlighted Thread:" it may still be a different thread. It is not sure.

All threads except thread 0 (main thread) seem to be stopped at waits or traps. Since thread zero is the only one that appears active, it is the real source of the crash.

Since thread 0 does have main() or UIApplication at the bottom, the stack is probably corrupted or it is in some system functions which use a non-standard way of building stack frames.

Walt Sellers
  • 3,806
  • 30
  • 35