[Mono-bugs] [Bug 23637] New - Mono segfaults when using threads

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
18 Apr 2002 18:47:23 -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 ds98rito@thn.htu.se.

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

--- shadow/23637	Thu Apr 18 14:47:23 2002
+++ shadow/23637.tmp.12193	Thu Apr 18 14:47:23 2002
@@ -0,0 +1,66 @@
+Bug#: 23637
+Product: Mono/Runtime
+Version: unspecified
+OS: Red Hat 7.2
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: ds98rito@thn.htu.se               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Summary: Mono segfaults when using threads
+
+Description of Problem:
+Mono segfaults in some circumstances when using threads...
+This has been reported on the mailing-list as well but I fill in a report
+just-in-case.
+
+The segafult happens consistently afaict.
+This is the code to reproduce it:
+
+
+using System;
+using System.Threading;
+
+class Hello {
+  public static void Main () {
+    new MainThreadHandler ();   
+  }
+}
+
+public class MainThreadHandler {
+  int i = 0;
+  public MainThreadHandler () {
+    while ( true ) {
+      Thread.Sleep ( 100 );
+	  Console.WriteLine( "number {0}", i);
+	  i++;
+      WorkerThreadHandler myWorkerThreadHandler = new WorkerThreadHandler ();
+      ThreadStart myThreadStart = new ThreadStart (
+myWorkerThreadHandler.Handle
+Thread );
+      Thread myWorkerThread = new Thread ( myThreadStart );
+      myWorkerThread.Start ();
+    }
+  }
+}
+
+class WorkerThreadHandler {
+ public void HandleThread () {
+	Console.WriteLine ( "haha"); //remove this line and it works..
+  }
+}
+
+
+It segfaults on thread 40 on my computer.
+If I remove the "haha" console.writeline then it seems to work...
+
+I use mono-0.10_baselabs-20020418.
+
+
+/Richard