[Mono-bugs] [Bug 79438][Maj] New - Exceptions on many Windows Forms apps

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Sep 19 06:15:05 EDT 2006

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 jordimash at gmail.com.


--- shadow/79438	2006-09-19 06:15:05.000000000 -0400
+++ shadow/79438.tmp.3190	2006-09-19 06:15:05.000000000 -0400
@@ -0,0 +1,53 @@
+Bug#: 79438
+Product: Mono: Class Libraries
+Version: 1.0
+OS: Windows XP (Cygwin)
+OS Details: 
+Status: NEW   
+Priority: Major
+Component: Sys.Drawing.
+AssignedTo: peter at novonyx.com                            
+ReportedBy: jordimash at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: Exceptions on many Windows Forms apps
+Hi folks,
+On Mono on Win32, when finishing a Windows Forms apps I get:
+Got a SIGSEGV while executing native code. This usually indicates
+a fatal error in the mono runtime or one of the native libraries
+used by your application.
+ at (wrapper managed-to-native) System.Drawing.GDIPlus.GdipDisposeImage
+(intptr) <0x00004>
+ at (wrapper managed-to-native) System.Drawing.GDIPlus.GdipDisposeImage
+(intptr) <0xffffffff>
+  at System.Drawing.Image.Dispose (bool) <0x00109>
+  at System.Drawing.Image.Finalize () <0x00010>
+  at (wrapper runtime-invoke) System.Object.runtime_invoke_void
+(object,intptr,intptr,intptr) <0xffffffff>
+This application has requested the Runtime to terminate it in an unusual way.
+Please contact the application's support team for more information.
+The problem is that we call DisposeImage and other resource destroy GDI API
+calls AFTER the beast has been shutdown.
+Our code at GDIPlus.ProcessExit calls WaitForPendingFinalizers but this
+only waits for the current thread, not the Windows Forms app one for example.
+To avoid this, my suggestion is to check if GDI+ has been shutdown before
+calling any release resource function, that are called from the destructors.

More information about the mono-bugs mailing list