Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

Any advice?

like image 613
Dann Avatar asked Nov 28 '11 13:11

Dann


People also ask

What causes Exc_bad_access?

EXC_BAD_ACCESS is an exception raised as a result of accessing bad memory. We're constantly working with pointers to memory in Swift that link to a specific memory address. An application will crash whenever we try to access a pointer that is invalid or no longer exists.

What does thread 1 Exc_bad_access mean?

EXC_BAD_ACCESS means that message was sent to a point in the memory where there's no instance of a class to execute it. Thus “bad access”. You will get EXC_BAD_ACCESS in 3 cases: An object is not initialized.


2 Answers

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.

Edit Scheme Dialog

like image 56
gak Avatar answered Sep 22 '22 00:09

gak


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.

like image 23
Andrew Avatar answered Sep 22 '22 00:09

Andrew