[Mono-bugs] [Bug 79063][Min] New - Occasional deadlock when running external programs

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Aug 11 20:19:26 EDT 2006


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 brian at fluggo.com.

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

--- shadow/79063	2006-08-11 20:19:26.000000000 -0400
+++ shadow/79063.tmp.7402	2006-08-11 20:19:26.000000000 -0400
@@ -0,0 +1,88 @@
+Bug#: 79063
+Product: Mono: Runtime
+Version: 1.1
+OS: SUSE 9.2
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Minor
+Component: io-layer
+AssignedTo: dick at ximian.com                            
+ReportedBy: brian at fluggo.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Occasional deadlock when running external programs
+
+Description of Problem:
+There appears to be a small chance that when external processes are run
+simultaneously (via System.Diagnostics.Process.Start), a deadlock will occur.
+
+
+Steps to reproduce the problem:
+using System;
+using System.Diagnostics;
+using System.Threading;
+
+namespace Test {
+    class Test {
+        static void Main() {
+            for( int i = 0; i < 5; i++ ) {
+                Thread empty = new Thread( new ThreadStart( StartProcess ) );
+                empty.Start();
+            }
+
+            Thread.Sleep( -1 );
+        }
+
+        static int __processIter = 0;
+
+        static void StartProcess() {
+            for( ;; ) {
+                ProcessStartInfo info = new ProcessStartInfo( "/bin/echo",
+                    "\"I'm hen-er-y the 8th I am..." +
+Interlocked.Increment( ref __processIter ).ToString() + "\"" );
+                info.UseShellExecute = false;
+                info.RedirectStandardOutput = true;
+
+                Process process = Process.Start( info );
+
+                Console.WriteLine( process.StandardOutput.ReadLine() );
+
+                process.WaitForExit();
+                process.Dispose();
+            }
+        }
+    }
+}
+
+Actual Results:
+The final lines of output might show:
+
+-----
+I'm hen-er-y the 8th I am...3962
+I'm hen-er-y the 8th I am...3963
+I'm hen-er-y the 8th I am...3964
+I'm hen-er-y the 8th I am...3965
+I'm hen-er-y the 8th I am...3966
+I'm hen-er-y the 8th I am...3967
+I'm hen-er-y the 8th I am...3968
+I'm hen-er-y the 8th I am...3969
+I'm hen-er-y the 8th I am...3896
+-----
+
+Inevitably, the last /bin/echo instance will have a counter much less than
+the ones before it.
+
+
+Expected Results:
+The program should output lines forever.
+
+
+How often does this happen? 
+Seldom. It will often happen in the first 10000 iterations.
+
+
+Additional Information:


More information about the mono-bugs mailing list