The Debugger has exited with status 1.

Yesterday I encountered a very strange bug/feature in Xcode. I just couldn’t run any application in Release configuration anymore. I always got “The Debugger has exited with status 1.” in the run-log. In debug configuration they worked, without Xcode they worked, in gdb they worked, but as soon as I tried to start them in Xcode in Release configuration it didn’t work. Not even a fresh new Project would work.

I tried removing the prefs but that didn’t help. But it seemed to be user-dependent. I could run my Projects in Release configuration when I logged in as another user.

This morning I saw the “GDB Log” setting in the Debugging Prefs. I activated them and compared the logs of Debug configuration and Release configuration. And this really showed the bug. I had a binary of a System-Framework in my Release folder and instead of the system-version it linked the application to this binary. To my bad it was a binary from a different mac, which is still running 10.4. This made the app exit right when it was started.
The solution was as simple as removing this binary from the Release-folder.

This GDB log is really a lifesaver sometimes!

Karsten

2 Responses to “The Debugger has exited with status 1.”

  1. Darren Says:

    Hi I’m having the exact same problem but I am unable to locate the binary in the Release folder. Are you referring to the release folder under Project Name>build>Release or is there another folder in the Xcode directory that I should know of?

    I have recently installed 10.5 and I am getting really frustrated with this issue. Simple programs work but when I start linking files it will exit with status 1.

    Thanks very much for your time!

  2. Karsten Says:

    i think per default the build folder is in your project folder. You can change this setting in the build-preferences in Xcode though.

    Like i mentioned in the blog-post. you should enable the debugger, cause it’s where you see which files get linked into the application. If you’re familiar with gdb and its command line interface you can also try “info sharedlibraries”. this will print all linked binaries with their pathes. You can also set a breakpoint in exit() and use backtrace to see where it is called. (in my case some CoreGraphicServices functions called it, that’s why i noticed the CoreGraphics framework being linked in the log)

    good luck
    Karsten