Stopping at breakpoints causing EXC_BAD_ACCESS
My app runs fine and as expected, but for some reason when I place breakpoints, stepping into/over/resuming causes the program to crash with EXC_BAD_ACCESS. This does not happen if I remove/disable breakpoints.
From what I can see, LLDB appears to be broken in the Xcode 4.2 and 4.2.1. Switch to GDB in your "Edit Scheme" settings.
Breakpoints work just as expected after switching to GDB.
To anyone that might experience the same thing with Xcode 5.0.1 and Mavericks: Try deleting all your schemes and auto create them again - that fixed it for me.
Where you using lldb instead of gdb ? I'm getting this systematically with Xcode 4.2.1 and lldb. Switching back to gdb (booooo) solves the problem.
I am using the Xcode 4.3.2 and Xcode update the debug to LLDB automatically(A popup dialog and I confirm it). This is really a nightmare, it crash when I step into any function call 8-9 out of 10.
Change back to GDB seems better now!
This was a bug with XCode 5.0.1 and Mavericks. Apple released 5.0.2 and the bug is fixed!
EXC_BAD_ACCESS means you have a memory problem somewhere - very likely that something is being released when you expect it to still be around (perhaps the result of an autorelease). Run the static analyzer to find it. I imagine you're seeing the crash because the debugger is aggressively occupying memory when you load breakpoints and hence flagging a problem somewhere else.
For what it's worth, I'm having the same problem. I can take code that I know is correct and if I step into it with lldb, it crashes after reaching a breakpoint. I also get output like this when I try to print any locals
(lldb) p self error: use of undeclared identifier 'self' error: 1 errors parsing expression
Looks like lldb is busted in Xcode 4.2.1. The only advice I have is switch back to gdb for now.