[Mono-bugs] [Bug 72605][Wis] New - NullReferenceException, GdiPlus and rsh problem

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 15 Feb 2005 03:14:24 -0500 (EST)


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 vguzev@yandex.ru.

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

--- shadow/72605	2005-02-15 03:14:24.000000000 -0500
+++ shadow/72605.tmp.22410	2005-02-15 03:14:24.000000000 -0500
@@ -0,0 +1,104 @@
+Bug#: 72605
+Product: Mono: Runtime
+Version: unspecified
+OS: GNU/Linux [Other]
+OS Details: Linux skif 2.4.25 #2 SMP Fri Apr 23 14:03:00 MSD 2004 i686 athlon i386 GNU/Linux
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: vguzev@yandex.ru               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: NullReferenceException, GdiPlus and rsh problem
+
+Description of Problem:
+NullReferenceException is thrown when trying to launch GDI application 
+through rsh which uses a lot of threads.
+
+Steps to reproduce the problem:
+1. mcs /r:System.Drawing TestGDIPlus.cs
+--8<-------------------------------------
+using System;
+using System.Threading;
+using System.Drawing;
+
+public class TestGDIPlus  {
+ public static void Main( string[] args ) {
+  int nThreads = int.Parse( args [0] );
+  
+  for ( int i = 0; i < nThreads; i++ ) {
+   Thread t = new Thread( new ThreadStart( TestGDIPlus.Run ) );
+   t.Start();
+  }
+ }
+
+ public static void Run() {
+  Bitmap bmp = new Bitmap ( 1000, 1000, 
+                  System.Drawing.Imaging.PixelFormat.Format32bppArgb );
+ }
+}
+--8<-------------------------------------
+
+2. rsh <node-name> mono /path/to/TestGDIPlus.exe 100
+
+Actual Results:
+It throws this exception for each thread
+--8<-------------------------------------
+Unhandled Exception: System.NullReferenceException: Object reference not 
+set to an instance of an object
+in (unmanaged) (wrapper managed-to-native) 
+System.Drawing.GDIPlus:GdipCreateBitmapFromScan0 
+(int,int,int,System.Drawing.Imaging.PixelFormat,intptr,intptr&)
+in <0x00004> (wrapper managed-to-native) 
+System.Drawing.GDIPlus:GdipCreateBitmapFromScan0 
+(int,int,int,System.Drawing.Imaging.PixelFormat,intptr,intptr&)
+in <0x00058> System.Drawing.Bitmap:.ctor 
+(int,int,System.Drawing.Imaging.PixelFormat)
+in <0x0006f> (wrapper remoting-invoke-with-check) 
+System.Drawing.Bitmap:.ctor (int,int,System.Drawing.Imaging.PixelFormat)
+in <0x00036> TestGDIPlus:Run ()
+in <0x0005f> (wrapper delegate-invoke) 
+System.MulticastDelegate:invoke_void ()
+--8<-------------------------------------
+
+or this one
+
+--8<-------------------------------------
+Unhandled Exception: System.NullReferenceException: Object reference not 
+set to an instance of an object
+in (unmanaged) System.Drawing.Bitmap:.ctor 
+(int,int,System.Drawing.Imaging.PixelFormat)
+--8<-------------------------------------
+
+
+Expected Results:
+Should just finish creating objects and exit
+
+How often does this happen? 
+Always, when big number of threads is specified (>=100)
+
+Additional Information:
+[vadim@skif testgdi]$ uname -a
+Linux skif 2.4.25 #2 SMP Fri Apr 23 14:03:00 MSD 2004 i686 athlon i386 
+GNU/Linux
+[vadim@skif testgdi]$ mono --version
+Mono JIT compiler version 1.0.5, (C) 2002-2004 Novell, Inc and 
+Contributors. www.go-mono.com
+        TLS:           __thread
+        GC:            Included Boehm (with typed GC)
+        SIGSEGV      : normal
+        Globalization: ICU
+
+And we use libgdiplus - 1.0.5
+
+We've tried it on different clusters - result is the same.
+
+
+Best regards,
+Vadim B. Guzev
+http://u.pereslavl.ru/~vadim/MCSharp/