[Mono-bugs] [Bug 32472][Nor] New - Cross-process pipe i/o test failing

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
17 Oct 2002 21:57:06 -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 nick@chemlab.org.

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

--- shadow/32472	Thu Oct 17 17:57:06 2002
+++ shadow/32472.tmp.26385	Thu Oct 17 17:57:06 2002
@@ -0,0 +1,86 @@
+Bug#: 32472
+Product: Mono/Class Libraries
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: Unknown
+Priority: Normal
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: nick@chemlab.org               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Cross-process pipe i/o test failing
+
+Cross-process pipe i/o doesn't seem to be working. Forground process blocks
+forever on read from pipe to child process's stdout. Needs more
+investigating...
+
+using System;
+using System.Diagnostics;
+using System.IO;
+
+public class test
+{
+	public static void Main (string[] args)
+	{
+
+		if (args.Length == 0 || args[0] != "echo")
+		{
+			ProcessStartInfo psi = new ProcessStartInfo ();
+			Process proc = new Process ();
+			proc.StartInfo = psi;
+
+			psi.FileName = "mono";
+			psi.Arguments = AppDomain.CurrentDomain.FriendlyName + " echo";
+			psi.RedirectStandardInput = true;
+			psi.RedirectStandardOutput = true;
+			psi.UseShellExecute = true;
+			proc.StartInfo = psi;
+			proc.Start ();
+			StreamWriter pin = proc.StandardInput;
+			StreamReader pout = proc.StandardOutput;
+
+			Console.WriteLine (pout.ReadLine ());
+			pin.WriteLine ("Trumpy, you come down from there!");
+			Console.WriteLine (pout.ReadLine ());
+			pin.WriteLine ("Its called evil, kid.");
+			Console.WriteLine (pout.ReadLine ());
+
+			proc.Kill ();
+		}
+		else
+		{
+			Console.WriteLine ("Waiting for text...");
+
+			for (string line = Console.In.ReadLine ();
+                 line != String.Empty;
+				 line = Console.In.ReadLine ())
+			{
+				Console.WriteLine (line);
+			}
+		}
+	}
+}
+
+Actual Results:
+
+Blocks waiting for input.
+
+Expected Results:
+
+Waiting for text...
+Trumpy, you come down from there!
+Its called evil, kid.
+
+How often does this happen? 
+
+Always.
+
+Additional Information:
+
+Code works on Microsoft.NET.