Bug 14561 - Xamarin Studio crashes with (Remote) Soft Debugger custom command (might be local PC-issue)
Summary: Xamarin Studio crashes with (Remote) Soft Debugger custom command (might be l...
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Debugger ()
Version: 4.1.10
Hardware: PC Windows
: --- normal
Target Milestone: master
Assignee: Jeffrey Stedfast
URL:
Depends on:
Blocks:
 
Reported: 2013-09-09 11:42 UTC by Rogier Hofboer
Modified: 2013-09-13 13:52 UTC (History)
1 user (show)

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

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:
Status:
RESOLVED FIXED

Description Rogier Hofboer 2013-09-09 11:42:40 UTC
Note: This worked in the past with version 4.0.3, but now crashes in all versions.
So it might be al local problem, still Xamarin Studio should not crash.

When running the debugger with a custom command specified (even if this a hello world batch file), Xamarin Studio crashes.

Environment:
MONODEVELOP_SDB_TEST=1


Dialog:

Window Title:
Launch Soft Debugger

Dialog fields:
Command: c:\proj\test.cmd
Arguments: (doesn't matter)
IP: 192.168.1.42 (but doesn't matter)
Port: 12345 (but doesn't matter)
Output:

Click the connect button

Crash:

Problem signature:
  Problem Event Name:	CLR20r3
  Problem Signature 01:	xamarinstudio.exe
  Problem Signature 02:	4.0.0.0
  Problem Signature 03:	5202caca
  Problem Signature 04:	System
  Problem Signature 05:	4.0.30319.18021
  Problem Signature 06:	506a72b7
  Problem Signature 07:	3f9d
  Problem Signature 08:	17
  Problem Signature 09:	System.InvalidOperationException
  OS Version:	6.1.7601.2.1.0.256.48
  Locale ID:	1043
  Additional Information 1:	0a9e
  Additional Information 2:	0a9e372d3b4ad19135b953a78882e789
  Additional Information 3:	0a9e
  Additional Information 4:	0a9e372d3b4ad19135b953a78882e789
Comment 1 Mikayla Hutchinson [MSFT] 2013-09-09 14:15:36 UTC
Do you have the stack trace of the exception?

It may be in the log. You can get to the log files from the Help menu.
Comment 2 Rogier Hofboer 2013-09-10 03:22:57 UTC
By pressing "Always Send" very fast in Xamarin Studio crash dialog, I was able to capture to log below. 
(The Xamarin Studio crash dialog is only visible for a very short time (< 1 sec) and is taken over by a Windows showing 'Xamarin Studio has stopped working', maybe this is not the intented behaviour)

ERROR [2013-09-10 09:18:38Z]: An unhandled exception has occured. Terminating MonoDevelop? True
System.InvalidOperationException: StandardError has not been redirected.
   at System.Diagnostics.Process.get_StandardError()
   at MonoDevelop.Core.Execution.ProcessWrapper.CaptureError()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()
ERROR [2013-09-10 09:18:38Z]: An unhandled exception has occured. Terminating MonoDevelop? True
System.InvalidOperationException: StandardOut has not been redirected or the process hasn't started yet.
   at System.Diagnostics.Process.get_StandardOutput()
   at MonoDevelop.Core.Execution.ProcessWrapper.CaptureOutput()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()
Comment 3 Rogier Hofboer 2013-09-10 03:31:05 UTC
The log above is from version 4.0.3, but the exact version doesn't seem to matter much.

Also the error below sometimes appears before the errors above:

ERROR [2013-09-10 09:18:18Z]: Gtk-Critical: gtk_file_chooser_default_set_current_name: assertion `impl->action == GTK_FILE_CHOOSER_ACTION_SAVE || impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER' failed
Stack trace: 
   at Gtk.FileChooserDialog.gtk_file_chooser_set_current_name(IntPtr raw, IntPtr name)
   at Gtk.FileChooserDialog.set_CurrentName(String value)
   at MonoDevelop.Components.Extensions.SelectFileDialog`1.SetDefaultProperties(FileSelector fdiag)
   at MonoDevelop.Components.Extensions.SelectFileDialog`1.RunDefault()
   at MonoDevelop.Components.Extensions.PlatformDialog`1.Run()
   at MonoDevelop.Components.Extensions.SelectFileDialog`1.Run()
   at MonoDevelop.Components.FileEntry.ShowBrowseDialog(String name, String start_in)
   at MonoDevelop.Components.BaseFileEntry.OnButtonClicked(Object o, EventArgs args)
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at GLib.Signal.ClosureInvokedCB(Object o, ClosureInvokedArgs args)
   at GLib.SignalClosure.Invoke(ClosureInvokedArgs args)
   at GLib.SignalClosure.MarshalCallback(IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data)
   at Gtk.Dialog.gtk_dialog_run(IntPtr raw)
   at Gtk.Dialog.Run()
   at Mono.TextEditor.GtkWorkarounds.RunDialogWithNotification(Dialog dialog)
   at MonoDevelop.Ide.MessageService.RunCustomDialog(Dialog dialog, Window parent)
   at MonoDevelop.Ide.MessageService.RunCustomDialog(Dialog dialog)
   at MonoDevelop.Debugger.Soft.CustomSoftDebuggerEngine.DebuggerOptionsDialog.Run()
   at MonoDevelop.Debugger.Soft.CustomSoftDebuggerEngine.GetDebuggerInfo()
   at MonoDevelop.Debugger.Soft.CustomSoftDebuggerEngine.<>c__DisplayClass1`1.<InvokeSynch>b__0(Object , EventArgs )
   at Gtk.Application.InvokeCB.Invoke()
   at GLib.Timeout.TimeoutProxy.Handler()
   at Gtk.Application.gtk_main()
   at Gtk.Application.Run()
   at MonoDevelop.Ide.IdeApp.Run()
   at MonoDevelop.Ide.IdeStartup.Run(MonoDevelopOptions options)
   at MonoDevelop.Ide.IdeStartup.Main(String[] args)
   at Xamarin.Startup.MainClass.Main(String[] args)
Comment 4 Mikayla Hutchinson [MSFT] 2013-09-10 21:06:47 UTC
Should be fixed by https://github.com/mono/monodevelop/commit/21d7290821c3ee6467bbb6af5f4e14e48b285de2
Comment 5 Rogier Hofboer 2013-09-13 09:46:58 UTC
Thanks. I've found out some more details (and why it is not always a problem):

If the is a setting in the project file like this:

<PropertyGroup>
  <Externalconsole>true</Externalconsole>   

- When doing a local debug, the program is started in a separate Console window and a Console.ReadLine() works ok (waits for input).

- When doing Custom command remote debugging, the custom command is started in a separate Console window and works ok (no crash)


But when the setting above is not available or false:


- A local debug starts in the application output window inside Xamarin Studio, but Console.Readline() is 'ignored', it just steps over as if enter is pressed. So it does not work as expected. 

- Custom command remote debugging crashes (the original reported bug)

I am note sure if the above fix takes care of both problems.
(still need to wait for a new Alpha Release)


Also when using the application output window inside Xamarin Studio, not Console text colours are visible. It's only B&W. (this is a nice to have)

I am not able to find the "use external console" setting in the project properties. Is it not available or do I need to look elsewhere?
Comment 6 Rogier Hofboer 2013-09-13 09:57:51 UTC
Note, the:

<Externalconsole>true</Externalconsole>

setting is automatically added when a project is created using Xamarin Studio.
But not present in projects created by from Visual Studio.
Comment 7 Mikayla Hutchinson [MSFT] 2013-09-13 13:52:59 UTC
Please open new bugs for new issues. The issue tracked in this bug is fixed.

Anyway: the built-in console its known not to support input or colorization. That's why we have an option to enable the external console. However, VS does not respect this option.

The option is in Project Options -> Run -> General, IIRC.