Tracking down EXC_BAD_ACCESS

Discussion in 'iOS Programming' started by seepel, Jul 6, 2010.

  1. seepel macrumors 6502


    Dec 22, 2009
    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?
  2. robbieduncan Moderator emeritus


    Jul 24, 2002
    Can you post the nonsense you can't understand from the debugger?
  3. seepel thread starter macrumors 6502


    Dec 22, 2009
    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
  4. seepel thread starter macrumors 6502


    Dec 22, 2009
    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...
  5. themoonisdown09 macrumors 601


    Nov 19, 2007
    Georgia, USA
    The easiest way to track down EXC_BAD_ACCESS errors is by turning on Zombies. Read this post to find out how to do that. It sure has helped me.

Share This Page