[Mono-bugs] [Bug 78318][Maj] New - ThreadAbort does not abort in simple output to console loop

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sat May 6 19:09:03 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 bbjamey at gmail.com.


--- shadow/78318	2006-05-06 19:09:03.000000000 -0400
+++ shadow/78318.tmp.12575	2006-05-06 19:09:03.000000000 -0400
@@ -0,0 +1,67 @@
+Bug#: 78318
+Product: Mono: Runtime
+Version: 1.1
+OS Details: 
+Status: NEW   
+Priority: Major
+Component: JIT
+AssignedTo: lupus at ximian.com                            
+ReportedBy: bbjamey at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: ThreadAbort does not abort in simple output to console loop
+ThreadAbort does not abort a simple "output to console" loop.  
+On Microsoft .NET you can abort just about any thread, though 
+occasionally I've seen loops that couldn't be interrupted (though I think 
+they would regard that as a bug).  Certainly you can abort threads doing 
+I understand that it's non-trivial to get ThreadAbort working.  But I was 
+surprised the aprogram below doesn't abort.  It does if a Thread.Sleep() 
+call is added, so Mono seems to be checking abort flags at some 
+Steps to reproduce the problem:
+1. Compile and run this program
+using System.Threading;
+class C { 
+  static void Main() { 
+     Thread t = new Thread(new ThreadStart(go));
+     t.Start();
+     Thread.Sleep(100);
+     System.Console.WriteLine("aborting...."); 
+     t.Abort();
+  }
+  static void go() { 
+     while (true)  
+     {
+        System.Console.WriteLine("go on punk, shoot..");
+     } 
+  }
+Actual Results:
+On Mono Windows 1.1.15 the thread doesn't get aborted.
+Expected Results:
+The thread gets reliably aborted.
+How often does this happen? 
+Additional Information:

More information about the mono-bugs mailing list