Bug 2400 - Attaching to debugger from device crashes app
Summary: Attaching to debugger from device crashes app
Alias: None
Product: iOS
Classification: Xamarin
Component: Debugger ()
Version: 5.0
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Rolf Bjarne Kvinge [MSFT]
Depends on:
Reported: 2011-12-07 15:37 UTC by Andrew Young
Modified: 2013-12-05 18:36 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

crash report (20.88 KB, application/octet-stream)
2011-12-07 15:38 UTC, Andrew Young

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Andrew Young 2011-12-07 15:37:45 UTC
App crashes when trying to debug on the device. Runs fine when debugger is not started on MonoDev.

See attached crash report.
Comment 1 Andrew Young 2011-12-07 15:38:06 UTC
Created attachment 1014 [details]
crash report
Comment 2 Andrew Young 2011-12-07 15:39:42 UTC
Comment 3 Rolf Bjarne Kvinge [MSFT] 2011-12-07 19:15:55 UTC
It seems to hang while connecting to MonoDevelop.

Does it always crash, or only once in a while?

Does it happen with a simple test project (from a template for instance) too?

Can you try the WiFi mode instead (in MonoDevelop's preferences tick the checkbox in Preferences/Debugger/iPhone Debugger).
Comment 4 Andrew Young 2011-12-08 14:10:45 UTC
Yes it always crashes when debugging.
Yes it happens on a simple test project.
Does not crash over wifi.
Comment 5 Rolf Bjarne Kvinge [MSFT] 2011-12-08 16:55:45 UTC
Is anything printed to the iOS device log when you start the app on device (and it tries to connect to MonoDevelop)?

You can view the device log in MonoDevelop, View -> Pads -> iOS Device Log.

Does the app start up if you tap on it without starting to debug in MonoDevelop first?
Comment 6 Andrew Young 2011-12-08 17:33:39 UTC
This is all that is printed.

Dec  8 14:32:35 Andrew-Phone UIKitApplication:memtest[0xe9ae][3739] <Notice>: Successfully received USB connection from MonoDevelop on port 10001.
Dec  8 14:32:36 Andrew-Phone kernel[0] <Debug>: launchd[3739] Builtin profile: container (sandbox)
Dec  8 14:32:36 Andrew-Phone kernel[0] <Debug>: launchd[3739] Container: /private/var/mobile/Applications/CCEEAC97-864D-4357-87DC-FD8E67659DED [69] (sandbox)
Dec  8 14:32:50 Andrew-Phone com.apple.mobile.lockdown[21] <Notice>: receive secure message timeout!
Dec  8 14:32:50 Andrew-Phone com.apple.mobile.lockdown[21] <Notice>: receive secure message timeout!
Dec  8 14:32:55 Andrew-Phone SpringBoard[15] <Warning>: memtest failed to launch in time
Dec  8 14:32:55 Andrew-Phone SpringBoard[15] <Warning>: Forcing crash report of MemTest[3739]...
Dec  8 14:32:55 Andrew-Phone SpringBoard[15] <Warning>: Finished crash reporting.
Dec  8 14:32:55 Andrew-Phone com.apple.launchd[1] (UIKitApplication:memtest[0xe9ae][3739]) <Notice>: (UIKitApplication:memtest[0xe9ae]) Exited: Killed: 9
Dec  8 14:32:55 Andrew-Phone com.apple.launchd[1] (UIKitApplication:memtest[0xe9ae]) <Warning>: (UIKitApplication:memtest[0xe9ae]) Throttling respawn: Will start in 2147483627 seconds
Dec  8 14:32:55 Andrew-Phone SpringBoard[15] <Warning>: Application 'MemTest' exited abnormally with signal 9: Killed: 9
Dec  8 14:32:57 Andrew-Phone ReportCrash[3740] <Error>: Saved crashreport to /var/mobile/Library/Logs/CrashReporter/MemTest_2011-12-08-143255_Andrew-Phone.plist using uid: 0 gid: 0, synthetic_euid: 501 egid: 0
Comment 7 Rolf Bjarne Kvinge [MSFT] 2011-12-09 09:54:11 UTC
It's clearly getting killed because it doesn't start up in time, but that doesn't happen for me.

In any case this should have improved a lot with the current 5.1.1 beta, can you try that?
Comment 8 Andrew Young 2011-12-09 13:59:42 UTC
I thought that the app only waits about 2 sec before it gives up attaching to debugger. I'll try out the beta.
Comment 9 Rolf Bjarne Kvinge [MSFT] 2011-12-09 17:13:34 UTC
The app only waits 2 seconds before giving up, but the catch is that the app connects twice (once to redirect stdout/stderr, once for the debugger), and it's only the first time it waits 2s. For the second it assumes that the connection will succeed (since the first did). That is apparently not true in your case (you can see the first connection succeed in the log: "Successfully received USB connection from MonoDevelop on port 10001").

In the 5.1.1 beta this has changed (it has a 2s timeout for all connections, not only the first).
Comment 10 PJ 2013-11-19 17:05:41 UTC
This bug has been in the NEEDINFO state with no changes for the last 90 days. Can we put this back into the NEW or CONFIRMED state, or are we still awaiting response?

If there is no change in the status of this bug over the next two weeks, this bug will be marked as NORESPONSE.
Comment 11 PJ 2013-12-05 18:36:07 UTC
This bug has not been changed from the NEEDINFO state since my previous comment, marking as RESOLVED NORESPONSE.

Please feel free to REOPEN this bug at any time if you are still experiencing the issue. Please add the requested information and set the bug back to the NEW (or CONFIRMED) state.