Bug 3541 - Breakpoint in ComboBox.SelectedIndexChanged hangs desktop
Summary: Breakpoint in ComboBox.SelectedIndexChanged hangs desktop
Alias: None
Product: Class Libraries
Classification: Mono
Component: Windows.Forms ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2012-02-20 00:46 UTC by Seth Randall
Modified: 2012-03-18 23:38 UTC (History)
3 users (show)

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 GitHub or Developer Community 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 Seth Randall 2012-02-20 00:46:22 UTC
When I set a break point in a project and then debug, when the break point is hit, the entire desktop will become unresponsive. 

To use the desktop again, I have to Ctrl+Alt+F1 to the console and kill the /usr/bin/mono --debug process. Then I can switch back and use my desktop.

I am running 2.8.6 on Xubuntu 11.10. I compiled MonoDevelop from the Git repository.

I've also had it occur on MonoDevelop 2.6.
Comment 1 Mikayla Hutchinson [MSFT] 2012-02-21 17:02:10 UTC
What kind of project? Where did you set the breakpoint?
Comment 2 Seth Randall 2012-02-21 21:23:47 UTC
The project is an imported Visual Studio 2008 project. I also recreated it as an empty class in MonoDevelop. The breakpoint is being set in a SelectedIndexChanged event handler.
Comment 3 Seth Randall 2012-02-21 23:27:51 UTC
It was originally a Windows Forms project.
Comment 4 Mikayla Hutchinson [MSFT] 2012-02-22 14:07:56 UTC
My guess is that you have a breakpoint in an event handler that's fired from an open combobox, and the combobox grabs exclusive control of input when it opens and releases when it closes.

There isn't any straightforward way to handle this, AFAIK it's a limitation of the way that input grabs work in X11. You'd probably see with breakpoints in similar kinds of event handlers in any Linux debugger & app.
Comment 5 Seth Randall 2012-02-22 22:21:20 UTC
It's actually in a ListBox, but I can also duplicate it in a ListView as well.

I tested a Gtk# solution to see if the same thing happened there. I can put a break point in the Selection.Changed event for a TreeView (closest thing I could find to a ListBox or ListView) and it doesn't freeze up like the Windows.Forms solution does.
Comment 6 Jeffrey Stedfast 2012-02-23 11:39:06 UTC
it depends on what the state of the X Window grab is when the breakpoint is hit.

In any event, I used to debug GUI applications (when I ran into these issues) from another physical terminal over ssh or, if I didn't have another machine available, via a non-X terminal.

This link has some other ideas: http://developer.gnome.org/gtk-faq/stable/x461.html
Comment 7 Seth Randall 2012-02-23 19:16:11 UTC
It seems odd to me that it would work in Gtk# and not Windows.Forms.

Regardless, if I set the DISPLAY environment in the Project options, I can have it run in a Xephyr or Xnest window and debug it that way.
Comment 8 Jeffrey Stedfast 2012-02-24 11:17:27 UTC
Windows.Forms and Gtk# are completely different toolkits and their combo boxes have completely different semantics for when they emit events.
Comment 9 Seth Randall 2012-03-18 23:38:11 UTC
The bug is caused by input being held by the X server. I moved to a workaround where the program displays in nested X windows session.