Debaprio B
Debaprio B

Reputation: 531

Crash in autoreleasePool drain

I have a rare (anonymous namespace)::AutoreleasePoolPage::pop(void*) crash in [pool drain]. As I understand its caused by over-release of some object owned by the autorelease pool.

I tried using NSZombieEnabled = YES, and using Instruments with zombie tracer. The bug is not reproducible with these. There is no over-release message logged in the console and zombie tracer do not show any zombie alerts. But the crash is reproducible very frequently when I take off these flags. Anybody seen similar behaviour?

Is there any other way to debug this easily? I am using Xcode 5.0.1 in OS 10.8.5. I am pasting the crashed thread trace below:

Exception Type: EXC_BAD_ACCESS (SIGSEGV)

Exception Codes: EXC_I386_GPFLT

Application Specific Information: objc_msgSend() selector name: release

0 libobjc.A.dylib 0x00007fff8b3040a3 objc_msgSend +35

1 com.apple.CoreFoundation 0x00007fff855d086f CFRelease + 591

2 com.apple.CoreFoundation 0x00007fff856028a9 -[__NSDictionaryM dealloc] + 249

3 libobjc.A.dylib 0x00007fff8b30665a (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 502

4 com.apple.ist.istcore 0x000000010fb91d82 -[SomeFileOperation main] + 117

5 com.apple.Foundation 0x00007fff81f2070b NSThread__main + 1318

6 libsystem_pthread.dylib 0x00007fff86389899 _pthread_body + 138

7 libsystem_pthread.dylib 0x00007fff8638972a _pthread_start + 137

8 libsystem_pthread.dylib 0x00007fff8638dfc9 thread_start + 13

Thanks in advance.

Upvotes: 1

Views: 4152

Answers (1)

Sulthan
Sulthan

Reputation: 130102

[__NSDictionaryM dealloc]

A dictionary is being deallocated.

CFRelease

When a dictionary is being deallocated, every key and value gets a release message.

However, one of the objects inside the dictionary has already been deallocated, that means that sending another release message makes an illegal access.

Check the keys/values in your dictionary, you are overreleasing one of them. I recommend you to also perform a full project clean and then a deep analysis (see Project menu). In most cases, that will help you to find the bug.

You can also add a symbolic breakpoint to NSDictionary dealloc, wait for it to trigger and then inspect the state of the data inside using debugger.

Upvotes: 1

Related Questions