Strange CFNetwork crash in iOS7.1 - possibly AFNetworking Related - ios

I have started receiving details of a crash that I have not seen before, and it only appears to have started happening since the 7.1 update.
The exact line from the stack is :
CFNetwork
___ZN14CoreStreamBase34_streamSetEventAndScheduleDeliveryEmh_block_invoke + 30
and the entire trace is here:
Thread : Crashed: com.apple.main-thread
0 libsystem_kernel.dylib 0x3a1b81f0 __pthread_kill + 8
1 libsystem_pthread.dylib 0x3a222797 pthread_kill + 58
2 libsystem_c.dylib 0x3a168fdd abort + 76
3 libc++abi.dylib 0x39497cd7 abort_message + 74
4 libc++abi.dylib 0x394af6f3 __cxa_pure_virtual + 18
5 CFNetwork 0x2ec994bf ___ZN14CoreStreamBase34_streamSetEventAndScheduleDeliveryEmh_block_invoke + 30
6 CoreFoundation 0x2ef37981 CFArrayApplyFunction + 36
7 CFNetwork 0x2ec007fb RunloopBlockContext::perform() + 182
8 CFNetwork 0x2ec006b9 MultiplexerSource::perform() + 220
9 CFNetwork 0x2ec0054d MultiplexerSource::_perform(void*) + 48
10 CoreFoundation 0x2efcf25b __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 14
11 CoreFoundation 0x2efce72b __CFRunLoopDoSources0 + 206
12 CoreFoundation 0x2efccf1f __CFRunLoopRun + 622
13 CoreFoundation 0x2ef37f4f CFRunLoopRunSpecific + 522
14 CoreFoundation 0x2ef37d33 CFRunLoopRunInMode + 106
15 GraphicsServices 0x33e3e663 GSEventRunModal + 138
16 UIKit 0x3188316d UIApplicationMain + 1136
The only other thread i can see that is running is from AFNetworking, as this would be the only thing I would imagine is using CFNetworking:
Thread : AFNetworking (com.apple.main-thread)
0 libsystem_kernel.dylib 0x3a1a5a58 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3a1a5859 mach_msg + 48
2 CoreFoundation 0x2efce89b __CFRunLoopServiceMachPort + 154
3 CoreFoundation 0x2efccfc1 __CFRunLoopRun + 784
4 CoreFoundation 0x2ef37f4f CFRunLoopRunSpecific + 522
5 CoreFoundation 0x2ef37d33 CFRunLoopRunInMode + 106
6 Foundation 0x2f92a1eb -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 254
7 Foundation 0x2f97b0a1 -[NSRunLoop(NSRunLoop) run] + 80
8 **** 0x0011d35f +[AFURLConnectionOperation networkRequestThreadEntryPoint:] (AFURLConnectionOperation.m:148)
9 Foundation 0x2f9eca5f __NSThread__main__ + 1062
10 libsystem_pthread.dylib 0x3a221919 _pthread_body + 140
11 libsystem_pthread.dylib 0x3a22188b _pthread_start + 102
Has anyone else experienced issues with this? I have been over to the AFN github but cant see anyone else reporting this issue.
Thanks

Related

IOS app crash with CFNetwork, but can not find the problem

can anyone help me with my app crash, here is the crash log, I can not find the problem, thanks very much.
Thread 8 name:
Thread 8 Crashed:
0 libobjc.A.dylib 0x00000001c852f6f0 objc_retain + 16 (objc-object.h:441)
1 CFNetwork 0x00000001c99594d0 formEventCallback(__CFReadStream*, unsigned long, void*) + 128 (FormDataStream.c:246)
2 CoreFoundation 0x00000001c92bd950 _signalEventSync + 220 (CFStream.c:653)
3 CoreFoundation 0x00000001c92bcf0c _cfstream_shared_signalEventSync + 348 (CFStream.c:784)
4 CoreFoundation 0x00000001c92aa6c4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28 (CFRunLoop.c:1980)
5 CoreFoundation 0x00000001c92aa640 __CFRunLoopDoSource0 + 92 (CFRunLoop.c:2015)
6 CoreFoundation 0x00000001c92a9ef8 __CFRunLoopDoSources0 + 180 (CFRunLoop.c:2051)
7 CoreFoundation 0x00000001c92a4bd8 __CFRunLoopRun + 1032 (CFRunLoop.c:2922)
8 CoreFoundation 0x00000001c92a44b8 CFRunLoopRunSpecific + 452 (CFRunLoop.c:3247)
9 CFNetwork 0x00000001c98cd63c -[__CoreSchedulingSetRunnable runForever] + 216 (CoreSchedulingSet.mm:1365)
10 Foundation 0x00000001c9ca5fc0 -[NSThread main] + 72 (NSThread.m:1212)
11 Foundation 0x00000001c9de2c44 __NSThread__start__ + 1044 (NSThread.m:1175)
12 libsystem_pthread.dylib 0x00000001c8f1f974 _pthread_body + 132 (pthread.c:857)
13 libsystem_pthread.dylib 0x00000001c8f1f8d0 _pthread_start + 52 (pthread.c:884)
14 libsystem_pthread.dylib 0x00000001c8f27ddc thread_start + 4
As per your question, you need to install fabric or firebase crashlytics in your app. It will help you to debug the crash issue.
Here is the link for fabric: https://fabric.io/kits/ios/crashlytics/install

I get a crash when i use my app. And i can't make it to reproduce. It is a SEGV_ACCERR error

There is my crash descripiton:
#0 Thread
SIGSEGV
SEGV_ACCERR
0 libobjc.A.dylib objc_msgSend + 28
1 CoreLocation CLClientGetCapabilities + 35548
2 CoreLocation CLClientGetCapabilities + 33812
3 CoreLocation CLClientInvalidate + 1000
4 CoreFoundation _CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK + 20
5 CoreFoundation ___CFRunLoopDoBlocks + 288
6 CoreFoundation ___CFRunLoopRun + 728
7 CoreFoundation CFRunLoopRunSpecific + 424
8 GraphicsServices GSEventRunModal + 100
9 UIKit UIApplicationMain + 208
10 iSmartLBS main (main.m:15)
11 libdyld.dylib _start + 4
I open the organizer on Xcode just now, and i find more information:
{
"SourceLine" : 1865,
"SourceFile" : "CLLocationManager.m",
"UserData" : {
"Resolved" : false,
"Name" : "CoreLocation: -[CLLocationManager onClientEventLocation:forceMapMatching:type:] + 1060",
"Description" : ""
},
"DefaultName" : "CoreLocation: -[CLLocationManager onClientEventLocation:forceMapMatching:type:] + 1060"
}
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000010
Triggered by Thread: 0
Thread 0 name:
Thread 0 Crashed:
0 libobjc.A.dylib 0x0000000183a98150 objc_msgSend + 16
1 CoreLocation 0x000000018d2a6734 -[CLLocationManager onClientEventLocation:forceMapMatching:type:] + 1060 (CLLocationManager.m:1865)
2 CoreLocation 0x000000018d2a606c -[CLLocationManager onClientEvent:supportInfo:] + 1000 (CLLocationManager.m:1660)
3 CoreLocation 0x000000018d299278 ___Z22CLClientInvokeCallbackP10__CLClient13CLClientEventP11objc_object_block_invoke + 140 (CLClient.mm:763)
4 CoreFoundation 0x0000000184fd130c CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK + 20 (CFRunLoop.c:1818)
5 CoreFoundation 0x0000000184fd0b28 __CFRunLoopDoBlocks + 288 (CFRunLoop.c:1855)
6 CoreFoundation 0x0000000184fce9bc __CFRunLoopRun + 764 (CFRunLoop.c:2823)
7 CoreFoundation 0x0000000184efeda4 CFRunLoopRunSpecific + 424 (CFRunLoop.c:3113)
8 GraphicsServices 0x0000000186968074 GSEventRunModal + 100 (GSEvent.c:2245)
9 UIKit 0x000000018b1b9058 UIApplicationMain + 208 (UIApplication.m:4089)
10 iSmartLBS 0x0000000100c3432c 0x10008c000 + 12223276
11 libdyld.dylib 0x0000000183f0d59c start + 4
Thread 1 name:
Thread 1:
0 libsystem_kernel.dylib 0x0000000183fff224 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x0000000183fff09c mach_msg + 72 (mach_msg.c:103)
2 CoreFoundation 0x0000000184fd0e90 __CFRunLoopServiceMachPort + 192 (CFRunLoop.c:2527)
3 CoreFoundation 0x0000000184fceae4 __CFRunLoopRun + 1060 (CFRunLoop.c:2870)
4 CoreFoundation 0x0000000184efeda4 CFRunLoopRunSpecific + 424 (CFRunLoop.c:3113)
5 Foundation 0x0000000185a18d74 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 304 (NSRunLoop.m:367)
6 Foundation 0x0000000185a39b44 -[NSRunLoop(NSRunLoop) runUntilDate:] + 96 (NSRunLoop.m:411)
7 UIKit 0x000000018bb436a8 -[UIEventFetcher threadMain] + 136 (UIEventFetcher.m:313)
8 Foundation 0x0000000185b162d8 NSThread__start + 996 (NSThread.m:1163)
9 libsystem_pthread.dylib 0x00000001840e568c _pthread_body + 240 (pthread.c:697)
10 libsystem_pthread.dylib 0x00000001840e559c _pthread_start + 284 (pthread.c:744)
11 libsystem_pthread.dylib 0x00000001840e2cb4 thread_start + 4
Thread 2 name:
Thread 2:
0 libsystem_kernel.dylib 0x0000000183fff224 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x0000000183fff09c mach_msg + 72 (mach_msg.c:103)
2 CoreFoundation 0x0000000184fd0e90 __CFRunLoopServiceMachPort + 192 (CFRunLoop.c:2527)
3 CoreFoundation 0x0000000184fceae4 __CFRunLoopRun + 1060 (CFRunLoop.c:2870)
4 CoreFoundation 0x0000000184efeda4 CFRunLoopRunSpecific + 424 (CFRunLoop.c:3113)
5 AVFAudio 0x000000019f242540 GenericRunLoopThread::Entry(void*) + 164 (GenericRunLoopThread.h:106)
6 AVFAudio 0x000000019f268814 CAPThread::Entry(CAPThread*) + 84
7 libsystem_pthread.dylib 0x00000001840e568c _pthread_body + 240 (pthread.c:697)
8 libsystem_pthread.dylib 0x00000001840e559c _pthread_start + 284 (pthread.c:744)
9 libsystem_pthread.dylib 0x00000001840e2cb4 thread_start + 4
The crash is caused SIGSEGV in objc_msgSend. This means you have tried to access invalid object address. This means there a some issue related to memory in app.
This problem mostly faced while you do delete or any operation on UITableView
Solution
You can find using your Analyze of xcode and fix all warning that they displayed to you.
Also You can track this using enable zoombie and Instrument tool in xcode .

SIGABRT ABORT in QuartzCore

I'm seeing crashlogs being generated containing the following call stack
Thread : Crashed: com.apple.main-thread
0 libsystem_kernel.dylib 0x38a0a1f0 __pthread_kill + 8
1 libsystem_pthread.dylib 0x38a74797 pthread_kill + 58
2 libsystem_c.dylib 0x389bafdd abort + 76
3 libsystem_malloc.dylib 0x38a32d67 free + 382
4 libobjc.A.dylib 0x3844e3ad object_dispose + 20
5 UIKit 0x305511ef -[UIViewAnimationState dealloc] + 174
6 libobjc.A.dylib 0x38456b6b objc_object::sidetable_release(bool) + 174
7 CoreFoundation 0x2dc2d93d CFRelease + 556
8 QuartzCore 0x30195635 CA::release_objects(X::List<void const*>*) + 16
9 QuartzCore 0x3019aad7 -[CAAnimation dealloc] + 54
10 libobjc.A.dylib 0x38456b6b objc_object::sidetable_release(bool) + 174
11 CoreFoundation 0x2dc2d93d CFRelease + 556
12 QuartzCore 0x3019d117 CA::Layer::run_animation_callbacks(void*) + 238
13 libdispatch.dylib 0x3892f81f _dispatch_client_callout + 22
14 libdispatch.dylib 0x3893649f _dispatch_main_queue_callback_4CF$VARIANT$mp + 278
15 CoreFoundation 0x2dcc78f1 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 8
16 CoreFoundation 0x2dcc61c5 __CFRunLoopRun + 1300
17 CoreFoundation 0x2dc30f0f CFRunLoopRunSpecific + 522
18 CoreFoundation 0x2dc30cf3 CFRunLoopRunInMode + 106
19 GraphicsServices 0x32b52663 GSEventRunModal + 138
20 UIKit 0x3057c16d UIApplicationMain + 1136
21 Domino M 0x000c125f main (main.m:14)
Other threads only show the AFNetworking library doing something.
How can I find and fix issues like this (the ones that don't seem to have anything to do with self written code)?

SDWebImage crash randomly

Im using SDImage in my project, when checking the crash log, this SDImage crashed at
[SDWebImageDownloaderOperation start] func, here are logs, pls help, it wastes my 2 days.
Thread 12:
0 libsystem_kernel.dylib 0x3c383eb4 mach_msg_trap + 20
1 CoreFoundation 0x34143045 __CFRunLoopServiceMachPort + 129
2 CoreFoundation 0x34141da3 __CFRunLoopRun + 883
3 CoreFoundation 0x340b4ebd CFRunLoopRunSpecific + 357
4 CoreFoundation 0x340b4d49 CFRunLoopRunInMode + 105
5 demo 0x0022a683 -[SDWebImageDownloaderOperation start] + 471
6 Foundation 0x34a73be3 __block_global_6 + 103
7 libdispatch.dylib 0x3c2ae11f _dispatch_call_block_and_release + 11
8 libdispatch.dylib 0x3c2b2961 _dispatch_root_queue_drain + 253
9 libdispatch.dylib 0x3c2b2ac1 _dispatch_worker_thread2 + 85
10 libsystem_c.dylib 0x3c2e2a11 _pthread_wqthread + 361
another log
Thread 9 Crashed:
0 CoreFoundation 0x35418b9c CFEqual + 24
1 CFNetwork 0x34d60469 URLConnectionClient::getRequestForTransmission(unsigned char, CFURLResponse*, _CFURLRequest const*, __CFError**) + 205
2 CFNetwork 0x34cc666d URLConnectionClient::_clientWillSendRequest(_CFURLRequest const*, _CFURLResponse*, URLConnectionClient::ClientConnectionEventQueue*) + 157
3 CFNetwork 0x34cc64c5 URLConnectionClient::ClientConnectionEventQueue::processAllEventsAndConsumePayload(XConnectionEventInfo*, long) + 457
4 CFNetwork 0x34cc61a3 URLConnectionClient::processEvents() + 107
5 CFNetwork 0x34cc60d9 MultiplexerSource::perform() + 157
6 CoreFoundation 0x354a3ad3 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION_ + 15
7 CoreFoundation 0x354a329f __CFRunLoopDoSources0 + 215
8 CoreFoundation 0x354a2045 __CFRunLoopRun + 653
9 CoreFoundation 0x354254a5 CFRunLoopRunSpecific + 301
10 CoreFoundation 0x3542536d CFRunLoopRunInMode + 105
11 demo 0x001d1683 -[SDWebImageDownloaderOperation start] + 471
12 Foundation 0x34fe2793 __block_global_6 + 103
13 libdispatch.dylib 0x3435cc59 _dispatch_call_block_and_release + 13
14 libdispatch.dylib 0x3435f817 _dispatch_worker_thread2 + 259
15 libsystem_c.dylib 0x3288cdfb _pthread_wqthread + 295
another crash on cancel
Thread 0 Crashed:
0 demo 0x001a58f2 -[SDWebImageDownloaderOperation cancel] + 130
1 demo 0x001a88df -[SDWebImageCombinedOperation cancel] + 179
2 demo 0x001aaf71 -[UIImageView(WebCache) cancelCurrentImageLoad] + 49
my log help~

Is this crash caused by me or UIKit itself?

This crash report is really tough for me to get a handle on. I've seen it every now and then, and its been pretty impossible to fix given that it doesn't really give me any references to my code to work from.
Is this a crash that was caused by Apple and I don't have to worry about it?
Date/Time: 2013-02-26 03:49:36 +0000
OS Version: iPhone OS 6.1.2 (10B146)
Report Version: 104
Exception Type: SIGTRAP
Exception Codes: #0 at 0x33973d24
Crashed Thread: 0
Thread 0 Crashed:
0 CoreFoundation 0x33973d24 CFRetain + 8
1 UIKit 0x359484f9 -[UIKeyboardCache displayView:imageWidth:withKey:fromLayout:] + 297
2 UIKit 0x359483c7 -[UIKeyboardCache displayView:withKey:fromLayout:] + 91
3 UIKit 0x35947b5b -[UIKBKeyplaneView displayLayer:] + 191
4 QuartzCore 0x355f34f7 CA::Layer::display() + 95
5 QuartzCore 0x355ea93b CA::Layer::display_if_needed(CA::Transaction*) + 203
6 QuartzCore 0x355ea865 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 25
7 QuartzCore 0x355ea243 CA::Context::commit_transaction(CA::Transaction*) + 239
8 QuartzCore 0x355ea051 CA::Transaction::commit() + 317
9 QuartzCore 0x355e9eb1 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 61
10 CoreFoundation 0x33a096cd __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 21
11 CoreFoundation 0x33a079c1 __CFRunLoopDoObservers + 277
12 CoreFoundation 0x33a07d17 __CFRunLoopRun + 743
13 CoreFoundation 0x3397aebd CFRunLoopRunSpecific + 357
14 CoreFoundation 0x3397ad49 CFRunLoopRunInMode + 105
15 GraphicsServices 0x3753c2eb GSEventRunModal + 75
16 UIKit 0x35890301 UIApplicationMain + 1121
17 MyApp 0x0004e60f main (main.m:16)
Thread 1:
0 libsystem_kernel.dylib 0x3bbbc648 kevent64 + 24
1 libdispatch.dylib 0x3bae7df8 _dispatch_mgr_thread$VARIANT$up + 36
Thread 2:
0 libsystem_kernel.dylib 0x3bbbbeb4 mach_msg_trap + 20
1 CoreFoundation 0x33a09045 __CFRunLoopServiceMachPort + 129
2 CoreFoundation 0x33a07da3 __CFRunLoopRun + 883
3 CoreFoundation 0x3397aebd CFRunLoopRunSpecific + 357
4 CoreFoundation 0x3397ad49 CFRunLoopRunInMode + 105
5 WebCore 0x3996f505 RunWebThread(void*) + 445
6 libsystem_c.dylib 0x3bb25311 _pthread_start + 309
Thread 3:
0 libsystem_kernel.dylib 0x3bbbbeb4 mach_msg_trap + 20
1 CoreFoundation 0x33a09045 __CFRunLoopServiceMachPort + 129
2 CoreFoundation 0x33a07da3 __CFRunLoopRun + 883
3 CoreFoundation 0x3397aebd CFRunLoopRunSpecific + 357
4 CoreFoundation 0x3397ad49 CFRunLoopRunInMode + 105
5 Foundation 0x3429df97 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 255
6 Foundation 0x34341865 -[NSRunLoop(NSRunLoop) run] + 81
7 MyApp 0x0003f7b5 +[AFURLConnectionOperation networkRequestThreadEntryPoint:] (AFURLConnectionOperation.m:161)
8 Foundation 0x3434ae85 __NSThread__main__ + 973
9 libsystem_c.dylib 0x3bb25311 _pthread_start + 309
Thread 4:
0 libsystem_kernel.dylib 0x3bbbbeb4 mach_msg_trap + 20
1 CoreFoundation 0x33a09045 __CFRunLoopServiceMachPort + 129
2 CoreFoundation 0x33a07da3 __CFRunLoopRun + 883
3 CoreFoundation 0x3397aebd CFRunLoopRunSpecific + 357
4 CoreFoundation 0x3397ad49 CFRunLoopRunInMode + 105
5 Foundation 0x342c73d5 +[NSURLConnection(Loader) _resourceLoadLoop:] + 309
6 Foundation 0x3434ae85 __NSThread__main__ + 973
7 libsystem_c.dylib 0x3bb25311 _pthread_start + 309
Thread 5:
0 libsystem_kernel.dylib 0x3bbcc594 __select + 20
1 libsystem_c.dylib 0x3bb25311 _pthread_start + 309
Thread 6:
0 libsystem_kernel.dylib 0x3bbcc08c __psynch_cvwait + 24
1 libsystem_c.dylib 0x3bb1daa5 pthread_cond_timedwait + 45
2 JavaScriptCore 0x37932c75 WTF::ThreadCondition::timedWait(WTF::Mutex&, double) + 109
3 JavaScriptCore 0x37a44557 JSC::BlockAllocator::blockFreeingThreadMain() + 83
4 JavaScriptCore 0x37a56fab WTF::wtfThreadEntryPoint(void*) + 15
5 libsystem_c.dylib 0x3bb25311 _pthread_start + 309
Thread 7:
0 libsystem_kernel.dylib 0x3bbbbeb4 mach_msg_trap + 20
1 CoreFoundation 0x33a09045 __CFRunLoopServiceMachPort + 129
2 CoreFoundation 0x33a07da3 __CFRunLoopRun + 883
3 CoreFoundation 0x3397aebd CFRunLoopRunSpecific + 357
4 CoreFoundation 0x3397ad49 CFRunLoopRunInMode + 105
5 AudioToolbox 0x3345c703 GenericRunLoopThread::Entry(void*) + 139
6 AudioToolbox 0x3343d885 CAPThread::Entry(CAPThread*) + 297
7 libsystem_c.dylib 0x3bb25311 _pthread_start + 309
Thread 8:
0 libsystem_kernel.dylib 0x3bbccd98 __workq_kernreturn + 8
1 libsystem_c.dylib 0x3bb1aa16 _pthread_wqthread + 366
Thread 9:
0 libsystem_kernel.dylib 0x3bbccd98 __workq_kernreturn + 8
1 libsystem_c.dylib 0x3bb1aa16 _pthread_wqthread + 366
This is not caused by apple. Below line is the entry point of the crash. Make sure some related object/view doesn't get deallocated.
MyApp 0x0003f7b5 +[AFURLConnectionOperation networkRequestThreadEntryPoint:] (AFURLConnectionOperation.m:161
Update:
I take back my object deallocation statement. I doubt this crash might happen due to UI element being created\updated in background thread. I mean an UI element created/updated in the network callback method.
The solution to the problem would be adding a dispatch_async in main_queue to perform the UI updates.

Resources