[Mono-bugs] [Bug 72549][Wis] New - Dns.GetHostName and Environment.CommandLine problem

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sun, 13 Feb 2005 03:46:39 -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=72549

--- shadow/72549	2005-02-13 03:46:38.000000000 -0500
+++ shadow/72549.tmp.22707	2005-02-13 03:46:38.000000000 -0500
@@ -0,0 +1,82 @@
+Bug#: 72549
+Product: Mono: Runtime
+Version: unspecified
+OS: GNU/Linux [Other]
+OS Details: Linux server 2.4.20-8bigmem #1 SMP Thu Mar 13 17:32:29 EST 2003 i686 i686 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: Dns.GetHostName and Environment.CommandLine problem
+
+Description of Problem:
+On Mono 1.1.3 when parameters are specified for command line the call of 
+Dns.GetHostName() destroys the Environment.CommandLine environment.
+
+Steps to reproduce the problem:
+1. mcs A.cs
+--8<-----A.cs----------------------
+using System;
+using System.Net;
+
+public class B {
+ public static void Main( string[] args ) {
+  Console.WriteLine( System.Environment.CommandLine );
+  string hostName = Dns.GetHostName();
+  Console.WriteLine( System.Environment.CommandLine );
+ }
+}
+--8<-----A.cs----------------------
+2. mono A.exe 35 /np 1
+
+Actual Results:
+You'll see something like that:
+--8<-------------------------------
+/home/vadim/mcsharp2/A.exe 35 /np 1
+And then some garbage is printed until you press Ctrl+C...
+--8<-------------------------------
+
+Sometimes it throws exceptions like this:
+--8<-------------------------------
+Unhandled Exception: System.NullReferenceException: Object reference not 
+set to an instance of an object
+in <0xc7a61a27> (wrapper managed-to-native) System.String:InternalJoin 
+(string,string[],int,int)
+in <0x00004> (wrapper managed-to-native) System.String:InternalJoin 
+(string,string[],int,int)
+in <0x000f6> System.String:Join (string,string[],int,int)
+in <0x00045> System.String:Join (string,string[])
+in <0x00015> System.Environment:get_CommandLine ()
+--8<-------------------------------
+
+Expected Results:
+It should print the same lines
+/home/vadim/mcsharp2/A.exe 35 /np 1
+/home/vadim/mcsharp2/A.exe 35 /np 1
+
+How often does this happen? 
+Always
+
+Additional Information:
+[vadim@itk-104 vadim]$ uname -a
+Linux server 2.4.20-8bigmem #1 SMP Thu Mar 13 17:32:29 EST 2003 i686 i686 
+i386 GNU/Linux
+[vadim@itk-104 vadim]$ mono --version
+Mono JIT compiler version 1.1.3, (C) 2002-2004 Novell, Inc and 
+Contributors. www.go-mono.com
+        TLS:           __thread
+        GC:            Included Boehm (with typed GC)
+        SIGSEGV      : normal
+        Globalization: none
+
+
+Best regards,
+Vadim B. Guzev
+http://u.pereslavl.ru/~vadim/MCSharp/