PDA

View Full Version : Tracking down EXC_BAD_ACCESS




seepel
Jul 6, 2010, 05:46 AM
I have an app that when run normally crashes silently, nothing printed to the console whatsoever. When run in build and debug I finally get that familiar EXC_BAD_ACCESS at the bottom (nothing shows up with bt though), along with some nonsense that I can't decipher in the debugger window. I've tried to find the problem with NSLog, but as far as I can tell all my functions get hit and finish. I've also tried turning on NSZombies, nut I don't think I fully understand this process. There is a lot of code, and I'm not sure where the problem is so I'm not posting it, but I am wondering if anyone has any good strategies for this kind of thing?



robbieduncan
Jul 6, 2010, 07:23 AM
Can you post the nonsense you can't understand from the debugger?

seepel
Jul 6, 2010, 07:31 AM
Can you post the nonsense you can't understand from the debugger?

Well here's the back trace (which for some reason I didn't see before...) and the debugger just seems to have a bunch of memory locations I can click through, not sure what to do with them though. Now it suddenly appears to be a problem with core data.. but still quite cryptic to me.


(gdb) bt
#0 0x02b50c97 in objc_msgSend ()
#1 0x04b74f30 in ?? ()
#2 0x0296c012 in __CFArrayReleaseValues ()
#3 0x0294aed0 in _CFRelease ()
#4 0x0278b999 in -[_PFManagedObjectReferenceQueue _processReferenceQueue:] ()
#5 0x027bd54a in _performRunLoopAction ()
#6 0x029a3a52 in __CFRunLoopDoObservers ()
#7 0x02970345 in CFRunLoopRunSpecific ()
#8 0x0296f8a8 in CFRunLoopRunInMode ()
#9 0x032b289d in GSEventRunModal ()
#10 0x032b2962 in GSEventRun ()
#11 0x002e2372 in UIApplicationMain ()
#12 0x00002a08 in main (argc=2, argv=0xbfffef54) at /Users/slynch/Documents/src/Pigeon/main.m:14

PhoneyDeveloper
Jul 6, 2010, 10:04 AM
http://www.sealiesoftware.com/blog/archive/2008/09/22/objc_explain_So_you_crashed_in_objc_msgSend.html

seepel
Jul 6, 2010, 12:31 PM
So I tracked down the problem, and of course, I over released an object. I set an object contained in an autoreleased object, to autorelease again and it got all messed up. Although I didn't learn anything about debugging, I simply used the old NSLog method...

themoonisdown09
Jul 6, 2010, 01:45 PM
So I tracked down the problem, and of course, I over released an object. I set an object contained in an autoreleased object, to autorelease again and it got all messed up. Although I didn't learn anything about debugging, I simply used the old NSLog method...

The easiest way to track down EXC_BAD_ACCESS errors is by turning on Zombies. Read this post (http://iphonedevelopertips.com/debugging/tracking-down-exc_bad_access-errors-with-nszombieenabled.html) to find out how to do that. It sure has helped me.