[Mono-dev] Opinion on a bug/fix?

Rob Wilkens robwilkens at gmail.com
Mon May 28 23:50:38 UTC 2012


Without giving the specific code changes, which i'll commit and push to 
github later if i don't get objections, I'm curious if any of the more 
experienced developers here (anyone who's done more changes than me, 
which is one or two) want to comment on the following bug report and 
proposed fix I have for it:

https://bugzilla.xamarin.com/show_bug.cgi?id=2234

Specifically, summarizing, there is a behavior in the Microsoft platform 
which 'eats' exceptions, under certain conditions (one was reported, 
there may be more in the future), and mono does not ignore it which 
results in a crash in mono that doesn't happen on windows.

This is for the combobox, so it is a visual control.

I am proposing a fix, which i have coded, which does something like this:

if (Debugger.IsAttached){
      fire event // so if we're debugging we see it
} else {
      try{
            fire event
      } catch
      {
	    //ignore exceptions outside of debugger
      }
}

If someone wants to see precise code i can probably do a diff...  Before 
I commit it, i'll probably make a comment in the code explaining why it 
was done the way it is.  Also, I'm not sure if i can create a unit test 
that displays a window, therefore i may not be able to create a unit test.

This code seems to solve the problem reported - which i have confirmed 
is correct in a windows virtual machine with visual studio and .net on 
windows 7.

That is:
1) In the debugger, exceptions are fired regardless if they occur.
2) When this condition happens in a normal run, exceptions are ignored. 
  As requested.
3) When this condition doesn't happen under this special circumstance, 
and the same code is reached in the event handler, an exception will be 
raised and not ignored.

This is identical to what happens on Windows/Visual Studio.

Any opinions from anyone on this?

-Rob


More information about the Mono-devel-list mailing list