[Mono-bugs] [Bug 74835][Maj] New - can't run more than about 4000 processes
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Thu, 5 May 2005 12:59:56 -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 lupus@ximian.com.
http://bugzilla.ximian.com/show_bug.cgi?id=74835
--- shadow/74835 2005-05-05 12:59:56.000000000 -0400
+++ shadow/74835.tmp.28564 2005-05-05 12:59:56.000000000 -0400
@@ -0,0 +1,72 @@
+Bug#: 74835
+Product: Mono: Runtime
+Version: 1.1
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Major
+Component: io-layer
+AssignedTo: dick@ximian.com
+ReportedBy: lupus@ximian.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: can't run more than about 4000 processes
+
+The following test fails at about 4080 loops.
+Note that this is cumulative: if you run first with
+mono redirect-stdout.exe 2080
+and then
+mono redirect-stdout.exe 2080
+it will fail again.
+The error is:
+Unhandled Exception: System.ComponentModel.Win32Exception: Some sort of w32
+error occurred: 14
+in <0x003d8> System.Diagnostics.Process:Start_common
+(System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process
+process)
+in <0x00013> System.Diagnostics.Process:Start ()
+Subsequent runs will give a SEGV in unmanaged code after a few warnings:
+** (redirect-stdout.exe:21278): WARNING **: process_set_current: error
+creating process handle
+
+** (redirect-stdout.exe:21278): WARNING **: CreateProcess: error creating
+process handle
+
+Unhandled Exception: System.NullReferenceException: Object reference not
+set to an instance of an object
+in <0x00000> <unknown method>
+in (wrapper managed-to-native) System.Diagnostics.Process:Start_internal
+(string,string,string,intptr,intptr,intptr,System.Diagnostics.Process/ProcInfo&)
+
+To be able to restart the process, ~/.wapi is removed.
+
+using System.Diagnostics;
+using System;
+
+class T {
+
+ static void Main (string[] args) {
+ int loops = 5000;
+ if (args.Length > 0)
+ loops = int.Parse (args [0]);
+ for (int i = 0; i < loops; ++i)
+ run ();
+ }
+ static void run () {
+ Process proc = new Process ();
+ proc.StartInfo.UseShellExecute = false;
+ proc.StartInfo.RedirectStandardOutput = true;
+ proc.StartInfo.FileName = "/bin/df";
+ proc.StartInfo.Arguments = "-TPl --block-size=1";
+
+ proc.Start ();
+ string output = proc.StandardOutput.ReadToEnd ();
+ proc.WaitForExit ();
+ proc.Close ();
+ //Console.Write (output);
+ }
+}