views:

813

answers:

2

I'm new to MonoTouch and more times than not, when I try to run my MonoTouch app on the iPhone simulator (debug mode and regular), I receive a long error output that begins with the following message:

Error connecting stdout and stderr (127.0.0.1:10001) Couldn't register com.yourcompany.[appnamehere] 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.Stacktrace:

at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) <0x00004> at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) <0x00004> at MonoTouch.UIKit.UIApplication.Main (string[],string,string) <0x00089> at MonoTouch.UIKit.UIApplication.Main (string[]) <0x00014> at PodcastManager.Application.Main (string[]) <0x00010> at (wrapper runtime-invoke) .runtime_invoke_void_object (object,intptr,intptr,intptr) <0x00043>

And ends with:

=================================================================

Got a SIGABRT while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries used by your application.

=================================================================

The weird thing is it will work some of the time. Once, a reboot of my machine did it. Others, just restarting MonoDevelop and/or the simulator.

I can provide the entire error output if you think that may help.

Any ideas?

+1  A: 

This is a problem with the monotouch debugger. Sometimes, when the application crashes, the debugger hangs in memory, and that then prevents you from running the app again. As you said, sometimes closing MonoDevelop and the simulator is enough to clean up the debugger, sometimes you need a full reboot. This is also the experience I have, which is probably the only bad thing I found with monotouch so far.

Many times, I'm able to directly kill the process from the console. To do that, open the console and type "top". You'll see the list of processes using the most memory, your app will likely be on top, using almost 100% of cpu. Save the id of the that line, and type q to quit. Now type "kill -9 ???" where ??? is the id you got from top.

Monotouch 2.0 fixed a lot of these problems, if you haven't updated yet I would seriously recommend you to do so. I'm running the beta channel of 2.0, and its a LOT more stable. Crashes went down from 1 or 2 every hour to 1 or 2 a day. It still happens, though, unfortunately.

Eduardo Scoz
I did upgrade to the beta channel today but I may have already been in a bad state. I'll reboot and give it another shot...
hambonious
Any luck? In general rebooting works every time for me.
Eduardo Scoz
Looked good on the first run. I'll try to stress it later today.
hambonious
Haven't seen this error since running the beta channel and rebooting. If I do see it i'll try the kill procedure you stated. Otherwise I'll accept this as the answer. Thanks!
hambonious
Update - I continue to have this problem. and I can only kill one of the two processes that has my app name. Looks like I'm still stuck with rebooting every time this occurs. How do other people develop with the trial when it's as buggy as it is? Gonna be hard to get to where I want to shell out the $$ for the full version...
hambonious
+1  A: 

-- Update -- after updating to 2.0.2 I have not seen this issue.

After playing with it long enough, and coming across this bug report I've come to the conclusion that until it's fixed the way to prevent this error is by NEVER stopping a debug session in the IDE. As long as you stop the debug session when the code is not at a breakpoint by hitting the home button it appears that you will avoid this situation.

hambonious
You might still get the problem randomnly. One solution is to stop the debugger with the iPhone simulator home button
Chris S