[Mono-bugs] [Bug 76578][Nor] New - crash when a Form is Disposed while a MessageBox on another thread is open

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Oct 28 01:24:02 EDT 2005


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by 4lw0e0402 at sneakemail.com.

http://bugzilla.ximian.com/show_bug.cgi?id=76578

--- shadow/76578	2005-10-28 01:24:02.000000000 -0400
+++ shadow/76578.tmp.15173	2005-10-28 01:24:02.000000000 -0400
@@ -0,0 +1,84 @@
+Bug#: 76578
+Product: Mono: Class Libraries
+Version: unspecified
+OS: SUSE 9.1
+OS Details: (all operating systems where the X11 XPlatUI driver is used)
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Windows.Forms
+AssignedTo: peter at novonyx.com                            
+ReportedBy: 4lw0e0402 at sneakemail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: crash when a Form is Disposed while a MessageBox on another thread is open
+
+Description of Problem:
+ An application starts a background thread for initialization and then 
+shows a splash screen using .ShowDialog(). The background thread 
+encounters a difficulty and displays a message box using MessageBox.Show 
+(guaranteed to be threadsafe: http://msdn2.microsoft.com/en-
+us/library/system.windows.forms.messagebox.aspx). Before the messagebox is 
+closed, the splash screen's timeout elapses and it closes. The main thread 
+calls .Dispose() on the splash screen, and mono promptly crashes.
+
+Steps to reproduce the problem:
+1. Start a background thread which delays for a short period of time and 
+then calls S.W.F.MessageBox.Show().
+2. Create a form and display it using .ShowDialog().
+3. Close the dialog and .Dispose() of it after the message box has 
+appeared.
+
+Actual Results:
+ On the background thread:
+  Unhandled Exception: System.NullReferenceException: Object reference not 
+set to an instance of an object
+  in <0x0002f> System.Windows.Forms.XplatUIX11:Activate (IntPtr handle)
+  in <0x00dbf> System.Windows.Forms.XplatUIX11:UpdateMessageQueue ()
+  in <0x00132> System.Windows.Forms.XplatUIX11:GetMessage 
+(System.Windows.Forms.MSG msg, IntPtr handle, Int32 wFilterMin, Int32 
+wFilterMax)
+  in <0x0001e> System.Windows.Forms.XplatUI:GetMessage 
+(System.Windows.Forms.MSG msg, IntPtr hWnd, Int32 wFilterMin, Int32 
+wFilterMax)
+  in <0x0081a> System.Windows.Forms.Application:ModalRun 
+(System.Windows.Forms.Form form)
+  in <0x00157> System.Windows.Forms.Form:ShowDialog (IWin32Window 
+ownerWin32)
+  in <0x0000c> System.Windows.Forms.Form:ShowDialog ()
+  in <0x00029> System.Windows.Forms.MessageBox+MessageBoxForm:RunDialog ()
+  in (wrapper remoting-invoke-with-check) MessageBoxForm:RunDialog ()
+  in <0x00036> System.Windows.Forms.MessageBox:Show (System.String text)
+  in <0x00021> MainForm:bleep ()
+  in (wrapper delegate-invoke) System.MulticastDelegate:invoke_void ()
+ On the main thread:
+  Unhandled Exception: System.NullReferenceException: Object reference not 
+set to an instance of an object
+  in <0x0002f> System.Windows.Forms.XplatUIX11:Activate (IntPtr handle)
+  in <0x00dbf> System.Windows.Forms.XplatUIX11:UpdateMessageQueue ()
+  in <0x00132> System.Windows.Forms.XplatUIX11:GetMessage 
+(System.Windows.Forms.MSG msg, IntPtr handle, Int32 wFilterMin, Int32 
+wFilterMax)
+  in <0x0001e> System.Windows.Forms.XplatUI:GetMessage 
+(System.Windows.Forms.MSG msg, IntPtr hWnd, Int32 wFilterMin, Int32 
+wFilterMax)
+  in <0x0027a> System.Windows.Forms.Application:Run ()
+  in <0x000a4> System.Windows.Forms.Application:Run 
+(System.Windows.Forms.ApplicationContext context)
+  in <0x0002e> System.Windows.Forms.Application:Run 
+(System.Windows.Forms.Form mainForm)
+  in <0x000ed> MainForm:Main ()
+
+Expected Results:
+ No exceptions. The splash screen disappears and the program continues 
+with whatever task it had planned, such as displaying the main window, and 
+the message box reporting the error persists.
+
+How often does this happen? 
+ Every time.
+
+Additional Information:
+ See attached test case "crashme.cs".


More information about the mono-bugs mailing list