[Mono-bugs] [Bug 61152][Nor] New - system_assembly gets NULL when System.dll is loaded by reflection LoadFrom

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sun, 4 Jul 2004 18:24:26 -0400 (EDT)

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 nazgul@omega.pl.


--- shadow/61152	2004-07-04 18:24:26.000000000 -0400
+++ shadow/61152.tmp.21488	2004-07-04 18:24:26.000000000 -0400
@@ -0,0 +1,66 @@
+Bug#: 61152
+Product: Mono: Runtime
+Version: unspecified
+OS Details: Linux Mandrake 10.0, mono 1.0
+Status: NEW   
+Priority: Normal
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: nazgul@omega.pl               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+Summary: system_assembly gets NULL when System.dll is loaded by reflection LoadFrom
+Description of Problem: 
+When running  
+  public class MainClass 
+  { 
+    public static void Main () 
+    { 
+      System.Reflection.Assembly a = System.Reflection.Assembly.LoadFrom 
+      Npgsql.NpgsqlConnection connection = new 
+         Npgsql.NpgsqlConnection ("Server=localhost;Database=test;User 
+      connection.Open (); 
+    } 
+  } 
+Steps to reproduce the problem: 
+1. compile above code with mcs t.cs -r Npgsql 
+2. run it with mono t.exe 
+Actual Results: 
+Unhandled Exception: System.NullReferenceException: Object reference not 
+set to an instance of an object 
+in (unmanaged) (wrapper managed-to-native) 
+in <0x00004> (wrapper managed-to-native) 
+in <0x0005a> System.Net.Dns:GetHostByName (string) 
+in <0x00032> System.Net.Sockets.TcpClient:Connect (string,int) 
+in <0x00026> System.Net.Sockets.TcpClient:.ctor (string,int) 
+in <0x00073> Npgsql.NpgsqlClosedState:Open (Npgsql.NpgsqlConnection) 
+in <0x00319> Npgsql.NpgsqlConnection:Open () 
+Expected Results: 
+How often does this happen?  
+Always (the bug related to this is occuring since beta1, but it's 
+possible that it was the first time when we tried this kind of code) 
+Additional Information: 
+I get null reference exception occuring inside mono runtime. My earlier 
+investigations show that during execution of 
+GetHostByName_internal/../get_family_hint (socket-io.c:557) variable 
+'system_assembly' of mono runtime's C API is NULL.