[Mono-bugs] [Bug 69964][Nor] New - Removing a threaded trace listener breaks tracing

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sat, 27 Nov 2004 14:58:02 -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 jhardin@impsec.org.

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

--- shadow/69964	2004-11-27 14:58:02.000000000 -0500
+++ shadow/69964.tmp.10615	2004-11-27 14:58:02.000000000 -0500
@@ -0,0 +1,39 @@
+Bug#: 69964
+Product: Mono: Class Libraries
+Version: 1.0
+OS: 
+OS Details: RH 9.0
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: System
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: jhardin@impsec.org               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Removing a threaded trace listener breaks tracing
+
+If a threaded trace listener removes itself from the Trace listeners list
+using Trace.Listeners.Remove(this); a quick subsequent call to
+Trace.WriteLine from the another thread will fail:
+
+Unhandled Exception: System.InvalidOperationException: List has changed.
+in <0x00045> SimpleEnumerator:MoveNext ()
+in <0x00065> System.Diagnostics.TraceImpl:WriteLine (string)
+in <0x0000a> System.Diagnostics.Trace:WriteLine (string)
+
+Subsequent calls to Trace.WriteLine() do not output anything to remaining
+valid listeners.
+
+If there is an adequate delay (10 sec?) between one thread removing the
+listener and another thread calling Thread.WriteLine() then the error does
+not occur.
+
+This does not occur in MS .NET framework 1.1 - according to
+http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemdiagnosticstracelistenercollectionclasstopic.asp
+operations on this list should be thread-safe.
+
+I don't have a minimal example available yet, let me know if one is needed.