[Mono-bugs] [Bug 70860][Nor] New - No stacktrace with exceptions in other threads

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 28 Dec 2004 20:10:53 -0500 (EST)


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 fxjrlists@yahoo.com.br.

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

--- shadow/70860	2004-12-28 20:10:53.000000000 -0500
+++ shadow/70860.tmp.10689	2004-12-28 20:10:53.000000000 -0500
@@ -0,0 +1,107 @@
+Bug#: 70860
+Product: Mono: Runtime
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: fxjrlists@yahoo.com.br               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: No stacktrace with exceptions in other threads
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+
+
+When an exception is thrown in a code run by a thread other than main, no
+stack trace is shown.
+
+Remenic on #mono reported this bug.
+Kangaroo asked to try on ms implementation.
+
+Steps to reproduce the problem:
+1. 
+
+This is the test code:
+
+using System;
+    using System.Threading;
+    class NullApp
+    {
+     Thread t;
+     object o = null;
+     NullApp()
+     {
+     t = new Thread(new ThreadStart (Run));
+     t.Start();
+     t.Join();
+     }
+     static void Main (string [] args)
+     {
+     new NullApp();
+     }
+     public void YoureWrong()
+     {
+    Console.WriteLine (o.GetHashCode ());
+     Thread.Sleep (1500);
+     }
+     public void Run()
+     {
+     while ( true )
+     {
+    YoureWrong ();
+    }
+      }
+     }
+
+
+Actual Results:
+
+Run this code with Mono, even compiled with -g:
+
+Unhandled Exception: System.NullReferenceException: Object reference not
+set toan instance of an object
+
+
+Run this code with ms.net 1.1 without -debug:
+
+Unhandled Exception: System.NullReferenceException: Object reference not
+set to an instance of an object
+
+at NullApp.Run()
+
+with -debug:
+
+Unhandled Exception: System.NullReferenceException: Object reference not
+set to an instance of an object
+
+at NullApp.YoureWrong() in c:\Desenvolvimento\testes\t2.cs: line 33
+at NullApp.Run() in c:\Desenvolvimento\testes\t2.cs: line 47
+
+Expected Results:
+
+
+at NullApp.YoureWrong()
+at NullApp.Run() 
+
+when not using --debug
+
+
+and
+
+at NullApp.YoureWrong()
+at NullApp.Run() 
+
+with line number info when compiled and run with debug symbols.
+
+How often does this happen? 
+
+Always.