开发者

iphone EXC_BAD_ACCESS caused by emergency_mutex

My iphone app occasionally crashes on the simulator and device with this message in the debugger:

Program received signal:  “EXC_BAD_ACCESS”.
Data Formatters unavailable (Error calling dlopen for: "/Developer/Applications/Xcode.app/Contents/PlugIns/GDBMIDebugging.xcplugin/Contents/开发者_开发知识库Resources/PBGDBIntrospectionSupport.A.dylib": "dlopen(/Developer/Applications/Xcode.app/Contents/PlugIns/GDBMIDebugging.xcplugin/Contents/Resources/PBGDBIntrospectionSupport.A.dylib, 10): no suitable image found.  Did find:
    /Developer/Applications/Xcode.app/Contents/PlugIns/GDBMIDebugging.xcplugin/Contents/Resources/PBGDBIntrospectionSupport.A.dylib: open() failed with errno=24")

The stack track just says:

0 (anonymous namespace)::emergency_mutex
1 ??
2 __NSFireTimer
3 CFRunLoopRunSPecific
4 CFRunLoopRunInMode
5 GSEventRunModal
6 GSEventRun
7 UIApplicationMain
8 main

I have no idea what that means or how to go about debugging it.


A major cause of EXEC_BAD_ACCESS is from trying to access over-released objects.

To find out how to troubleshoot this, read this document: DebuggingAutoReleasePool

Even if you don't think you are "releasing auto-released objects", this will apply to you.

This method works extremely well. I use it all the time with great success!!

In summary, this explains how to use Cocoa's NSZombie debugging class and the command line "malloc_history" tool to find exactly what released object has been accessed in your code.

Sidenote:

Running Instruments and checking for leaks will not help troubleshoot EXEC_BAD_ACCESS. Memory leaks have nothing to do with EXEC_BAD_ACCESS. The definition of a leak is an object that you no longer have access to, and you therefore cannot call it (and cannot over-release it).


EXC_BAD_ACCESS comes up a lot with memory management, have you run your program through instruments to check or leaks, or ensured your not trying to access objects that have all ready been released?

Edit:Good post about debugging this kind of error http://www.codza.com/how-to-debug-exc_bad_access-on-iphone

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜