Xcode 4.2 SIGABRT Error
Asked Answered
G

5

10

Everytime I run my app on the iPad simulator, it works flawlessly. But, when I run it on the iPhone simulator, when I click the home button, I get an error in Xcode in my main.m file, saying "Thread 1: Program received signal: SIGABRT". It is highlighting this line in my main.m's code: return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));

This issue doesn't occur when I press the home button on the iPad simulator at all though. I've done a lot of research on here about this error, but nothing useful seemed to turn up. Does anyone know how to go about fixing this?

Edit: here is some more info from the debugger console

"Couldn't register None.TestApplication with the bootstrap server. Error: unknown error code. This generally means that another instance of this process was already running or is hung in the debugger.sharedlibrary apply-load-rules all Current language: auto; currently objective-c (gdb)

Groningen answered 5/1, 2012 at 19:20 Comment(2)
SIGABRT generally means that the program threw an exception. There should be more information in the debugger console. You need to edit your question to include that information. Also, you can set a breakpoint in objc_exception_throw to get the stack trace where the exception is thrown.Avirulent
Thanks, I added some more info.Groningen
P
15

The line UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); just means that an exception was thrown during the running of your program. This could range from a memory problem, to a simple runtime error. Look in the target debugger console; it will tell you where the error occurred.

Edited due to edited question: I have solved this question before by restoring the iOS simulator to factory defaults (Open "iOS Simulator" Menu in the upper left -> Reset Content and Settings). Then quit the iOS simulator and Xcode, and then restart your computer. This will get rid of the other instance of the process.

Peltz answered 5/1, 2012 at 21:40 Comment(2)
Thank you so much. I just did that, but got the exact same error. To restore the simulator to factory defaults, I just go to "iOS Simulator" drop down menu, and select "Reset Content and Settings" right? Sorry if this is a dumb question, I'm still a beginner.Groningen
Redid it, this time rebooting my computer as well, that did the trick. Thank you so much!Groningen
R
5

I just ran into the same issue (wasted about 2 hours on it, in fact!). There was no exception thrown. Ultimately I stumbled across an answer like this one. Resetting and restarting the simulator and XCode didn't clear it up for me, but a reboot did.

So, if you see this, and there is NOT something about exceptions in the backtrace, then I think a restart of your machine is likely to fix it.

Rex answered 24/2, 2012 at 17:21 Comment(0)
E
3

I did all above, including restarting my computer, resetting the simulator but nothing worked so I ended up having to copy all files into a separate folder, create a new project and rebuild my nib file and then copy and paste from the files in my separate folder into my new project. Really quite nasty. If nothing works for you guys and you app isn't too complex, this may be an alternative. Maybe not the best but a water proof working one.

Elbrus answered 5/1, 2013 at 3:7 Comment(0)
D
3

I've had very similar problems and found that if I switch from the LLDB debugger to GDB (from the Product / Scheme / Edit Scheme menu) the problem goes away. Worth a try.

Danie answered 12/6, 2013 at 20:59 Comment(0)
N
1

In my case I had some code in viewDidLayoutSubviews, that updated layout and caused viewDidLayoutSubviews to be called again going into an infinite loop. Moving this code solved this error.

I suppose any infinite loops on the main thread end up being an uncaught exception.

Nara answered 6/5, 2017 at 11:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.