Tracking down EXC_BAD_ACCESS

Discussion in 'iPhone/iPad Programming' started by seepel, Jul 6, 2010.

  1. macrumors 6502

    seepel

    Joined:
    Dec 22, 2009
    #1
    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. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    Can you post the nonsense you can't understand from the debugger?
     
  3. thread starter macrumors 6502

    seepel

    Joined:
    Dec 22, 2009
    #3
    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.

    Code:
    (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. macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
  5. thread starter macrumors 6502

    seepel

    Joined:
    Dec 22, 2009
    #5
    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...
     
  6. macrumors 601

    themoonisdown09

    Joined:
    Nov 19, 2007
    Location:
    Georgia, USA
    #6
    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