IPhone crashed with tcpConnWorkQueue EXC_BAD_ACCESS

I have the following stack trace:

Crashed: tcpConnWorkQueue (Not main thread) EXC_BAD_ACCESS KERN_INVALID_ADDRESS at 0xf000000c 0 libobjc.A.dylib objc_msgSend + 5 1 CoreFoundation CFRelease + 560 2 libdispatch.dylib _dispatch_call_block_and_release + 10 3 libdispatch.dylib _dispatch_queue_drain + 374 4 libdispatch.dylib _dispatch_queue_invoke + 42 5 libdispatch.dylib _dispatch_root_queue_drain + 76 6 libdispatch.dylib _dispatch_worker_thread2 + 56 7 libsystem_pthread.dylib _pthread_wqthread + 298 

All other stacks are not associated with my code. What does this stack trace mean? And where can I look for errors in my code that can lead to something like this?

The main thread stack is as follows:

 Thread : com.apple.main-thread 0 QuartzCore 0x2fedef34 CA::Render::Object::unref() const + 35 1 QuartzCore 0x2fedda73 CA::Context::commit_layer(CA::Layer*, unsigned int, unsigned int, void*) + 142 2 QuartzCore 0x2fedda73 CA::Context::commit_layer(CA::Layer*, unsigned int, unsigned int, void*) + 142 3 QuartzCore 0x2fedaa23 CA::Layer::commit_if_needed(CA::Transaction*, void (*)(CA::Layer*, unsigned int, unsigned int, void*), void*) + 314 4 QuartzCore 0x2feda9c1 CA::Layer::commit_if_needed(CA::Transaction*, void (*)(CA::Layer*, unsigned int, unsigned int, void*), void*) + 216 5 QuartzCore 0x2feda9c1 CA::Layer::commit_if_needed(CA::Transaction*, void (*)(CA::Layer*, unsigned int, unsigned int, void*), void*) + 216 6 QuartzCore 0x2feda9c1 CA::Layer::commit_if_needed(CA::Transaction*, void (*)(CA::Layer*, unsigned int, unsigned int, void*), void*) + 216 7 QuartzCore 0x2feda9c1 CA::Layer::commit_if_needed(CA::Transaction*, void (*)(CA::Layer*, unsigned int, unsigned int, void*), void*) + 216 8 QuartzCore 0x2feda9c1 CA::Layer::commit_if_needed(CA::Transaction*, void (*)(CA::Layer*, unsigned int, unsigned int, void*), void*) + 216 9 QuartzCore 0x2feda9c1 CA::Layer::commit_if_needed(CA::Transaction*, void (*)(CA::Layer*, unsigned int, unsigned int, void*), void*) + 216 10 QuartzCore 0x2feda9c1 CA::Layer::commit_if_needed(CA::Transaction*, void (*)(CA::Layer*, unsigned int, unsigned int, void*), void*) + 216 11 QuartzCore 0x2feda9c1 CA::Layer::commit_if_needed(CA::Transaction*, void (*)(CA::Layer*, unsigned int, unsigned int, void*), void*) + 216 12 QuartzCore 0x2feda9c1 CA::Layer::commit_if_needed(CA::Transaction*, void (*)(CA::Layer*, unsigned int, unsigned int, void*), void*) + 216 13 QuartzCore 0x2feda9c1 CA::Layer::commit_if_needed(CA::Transaction*, void (*)(CA::Layer*, unsigned int, unsigned int, void*), void*) + 216 14 QuartzCore 0x2feda9c1 CA::Layer::commit_if_needed(CA::Transaction*, void (*)(CA::Layer*, unsigned int, unsigned int, void*), void*) + 216 15 QuartzCore 0x2feda9c1 CA::Layer::commit_if_needed(CA::Transaction*, void (*)(CA::Layer*, unsigned int, unsigned int, void*), void*) + 216 16 QuartzCore 0x2feda9c1 CA::Layer::commit_if_needed(CA::Transaction*, void (*)(CA::Layer*, unsigned int, unsigned int, void*), void*) + 216 17 QuartzCore 0x2feda9c1 CA::Layer::commit_if_needed(CA::Transaction*, void (*)(CA::Layer*, unsigned int, unsigned int, void*), void*) + 216 18 QuartzCore 0x2fed8d41 CA::Context::commit_transaction(CA::Transaction*) + 1048 19 QuartzCore 0x2fed881f CA::Transaction::commit() + 314 20 QuartzCore 0x2ff2d929 CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 516 21 IOMobileFramebuffer 0x32b5d76d IOMobileFramebufferVsyncNotifyFunc + 104 22 IOKit 0x2e7b4be5 IODispatchCalloutFromCFMessage + 248 23 CoreFoundation 0x2da92b81 __CFMachPortPerform + 136 24 CoreFoundation 0x2da9d777 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 34 25 CoreFoundation 0x2da9d713 __CFRunLoopDoSource1 + 346 26 CoreFoundation 0x2da9bedf __CFRunLoopRun + 1406 27 CoreFoundation 0x2da06471 CFRunLoopRunSpecific + 524 28 CoreFoundation 0x2da06253 CFRunLoopRunInMode + 106 29 GraphicsServices 0x327402eb GSEventRunModal + 138 30 UIKit 0x302bb845 UIApplicationMain + 1136 
+7
ios crash
source share
1 answer

A stack trace of level 1 indicates that a CFRelease call CFRelease been called, but your address 0xf000000c invalid according to the kernel, resulting in a bad access error. This occurs when a message is sent to an already released object in the most common case.

This type of failure usually has a time delay between when the object was first released and when it was released a second time. However, you have code that runs when the screen refreshes because you have 0x2ff2d929 CA::Display::DisplayLink::dispatch_items . The screen is often updated, so you need to call it often.

Have you used + (CADisplayLink *)displayLinkWithTarget:(id)target selector:(SEL)sel anywhere in your program? Do you have any calls - (void)invalidate ?

Perhaps the user interface switches from one use case (for example, playing a game with screen updates based on the display timer) to another (for example, presenting a menu selection when the game ends). When this type of switch occurs, the code assumptions are invalid, so you need to cancel your callbacks, otherwise you will get the final callback when everything is set up incorrectly (you will draw a frame of the game when it is really time to present the menu).

When you run your program with the Zombies turned on - a checkmark in the Schema section, then any released object turns into a "zombie" - it is delayed waiting for calls to be made on the object. When a call arrives, he knows his programming error and aborts. You can then look back at the distribution history of this object to see where it was first allocated and released to identify a double issue error.

+1
source share

All Articles