[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.
http://bugzilla.ximian.com/show_bug.cgi?id=61152
--- 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:
+OS Details: Linux Mandrake 10.0, mono 1.0
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: misc
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: nazgul@omega.pl
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+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
+("file:///usr/lib/mono/1.0/System.dll");
+ Npgsql.NpgsqlConnection connection = new
+ Npgsql.NpgsqlConnection ("Server=localhost;Database=test;User
+ID=postgres;Password=sql;");
+ 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)
+System.Net.Dns:GetHostByName_internal
+(string,string&,string[]&,string[]&)
+in <0x00004> (wrapper managed-to-native)
+System.Net.Dns:GetHostByName_internal
+(string,string&,string[]&,string[]&)
+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:
+<blank>
+
+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.