On Jan 14, 2009, at 11:18 AM, Jeff Johnson wrote:
On Jan 14, 2009, at 1:04 PM, John Nairn wrote:
I occasionally get difficult-to-debug crashes where that last thing in the crash log is a message being sent, which ends up being a message sent to an object that has been released (I think it is objc_msg, but I am not looking at a crash log now). These happen much more often in Leopard than in Tiger.

Since I have many messages going to many objects, it can take me a long time to track these problems down (in one case several weeks). I am fairly certain it is not a notification message because I also remove objects as observers before they are deallocated. Is there a debugging tool that can provide more information about what message was sent to what object at the time of the crash?

See the following for a good tutorial:

http://www.sealiesoftware.com/blog/archive/2008/09/22/objc_explain_So_you_crashed_in_objc_msgSend.html

That will help you extract info from the crash log itself. There are also other debugging modes to run your program that can either catch the bug before it crashes, or provide more details about the problem when it does crash.

Mac OS X Debugging Magic
http://developer.apple.com/technotes/tn2004/tn2124.html
Look in particular for libgmalloc, MallocStackLogging, and NSZombie.

Clang Static Analyzer
http://clang.llvm.org/StaticAnalysis.html
A compile-time checker that can identify some retain/release errors.


--
Greg Parker     [email protected]     Runtime Wrangler


_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to