[Mono-bugs] [Bug 45302][Cos] Changed - Mono should throw bug when getting exit code of unfinished process

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Tue, 24 Jun 2003 14:53:35 -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 bmaurer@users.sf.net.

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

--- shadow/45302	Mon Jun 23 13:36:33 2003
+++ shadow/45302.tmp.15979	Tue Jun 24 14:53:35 2003
@@ -1,23 +1,23 @@
 Bug#: 45302
-Product: Mono/MCS
+Product: Mono/Runtime
 Version: unspecified
-OS: 
+OS: unknown
 OS Details: Gentoo 1.4 RC4
 Status: NEW   
 Resolution: 
-Severity: 
-Priority: Major
-Component: Misc
+Severity: 001 One hour
+Priority: Cosmetic
+Component: misc
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: gert.driesen@pandora.be               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
 URL: 
 Cc: 
-Summary: mcs return incorrect exit code when compiling with debug on
+Summary: Mono should throw bug when getting exit code of unfinished process
 
 When I compile rather large assemblies with debug on, compilation succeeds
 but mcs returns exit code 259 instead of exit code 0.
 
 I've attached an archive containing a small testcase and the log4net
 sources, that will allow you to reproduce this issue.
@@ -36,6 +36,48 @@
 You'll see that it will always return exit code 259.
 
 ------- Additional Comments From gert.driesen@pandora.be  2003-06-23 13:36 -------
 Created an attachment (id=4690)
 archive containing testcase and log4net sources to repro this issue
 
+
+------- Additional Comments From bmaurer@users.sf.net  2003-06-24 14:53 -------
+Here is the real problem:
+
+According to
+http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdiagnosticsprocessclassexitcodetopic.asp
+When you get the status code of an unfinished process, it should throw
+an InvalidOperationException. However, we return 259, the Windows
+"process not finished" status.
+
+tbf ran this on Windows, and this is Microsoft's actual behavior.
+
+To repro, compile a program that sleeps for a very long time and run
+it with this code:
+using System;
+using System.Diagnostics;
+using System.IO;
+
+namespace Mcs {
+	public class Test {
+		public static int Main(string[] args) {
+
+
+			for (int counter = 0; counter < 20; counter++) {
+				Process cp = new Process();
+				cp.StartInfo.FileName = "program";
+				cp.StartInfo.Arguments = "args";
+				cp.StartInfo.UseShellExecute = false;
+				cp.Start();
+				cp.WaitForExit(2000);
+				Console.WriteLine("Exit Code: " + cp.ExitCode);
+			}
+
+			return 0;
+		}
+	}
+}		
+
+
+Obviously replacing program and args.
+
+The problem with NAnt is that it is not giving MCS a long enough timeout.