[Mono-bugs] [Bug 32344][Wis] New - System.Console.Write() problem in a multi-threaded program

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
16 Oct 2002 01:44:47 -0000


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 weiqigao@networkusa.net.

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

--- shadow/32344	Tue Oct 15 21:44:47 2002
+++ shadow/32344.tmp.9224	Tue Oct 15 21:44:47 2002
@@ -0,0 +1,102 @@
+Bug#: 32344
+Product: Mono/Runtime
+Version: unspecified
+OS: 
+OS Details: Red Hat Linux 7.2
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: weiqigao@networkusa.net               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: System.Console.Write() problem in a multi-threaded program
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+
+System.Console.Write() prints extra characters when running in a
+multi-threaded program
+
+Steps to reproduce the problem:
+
+1.  Compile this program (Simplified version of O'Reilly C# In a Nutshell
+p.188):
+
+// threading.cs
+using System;
+using System.Threading;
+
+class ThreadTest {
+	static void Main() {
+		Thread t = new Thread(new ThreadStart(Go));
+		t.Start();
+		Go();
+	}
+
+	static void Go() {
+		Console.Write(0);
+	}
+}
+
+2. Run the command "while true; do mono threading.exe; echo; done"
+
+
+Actual Results:
+000
+000
+000
+00
+00
+00
+000
+000
+00
+000
+000
+000
+000
+000
+00
+000
+000
+000
+000
+000
+...
+
+Expected Results:
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+...
+
+How often does this happen? 
+
+Always.  The occurance of a three-zero output seems to be random.  If I ran
+"mono threading.exe" on the command prompt repeatedly, I also get a mixture
+of two-zero and three-zero outputs.
+
+Additional Information: