[Mono-bugs] [Bug 72238][Wis] New - Parallel calling of DateTime.Now throws System.ArgumentException.

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sat, 5 Feb 2005 05:57:47 -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 vguzev@yandex.ru.

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

--- shadow/72238	2005-02-05 05:57:47.000000000 -0500
+++ shadow/72238.tmp.7962	2005-02-05 05:57:47.000000000 -0500
@@ -0,0 +1,85 @@
+Bug#: 72238
+Product: Mono: Runtime
+Version: unspecified
+OS: 
+OS Details: Linux skif 2.4.25 #2 SMP Fri Apr 23 14:03:00 MSD 2004 i686 athlon i386 GNU/Linux
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: vguzev@yandex.ru               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Parallel calling of DateTime.Now throws System.ArgumentException.
+
+Description of Problem:
+Parallel calling of DateTime.Now throws System.ArgumentException.
+
+Steps to reproduce the problem:
+1. mcs testdate.cs
+--8<----------------------------------------
+[vadim@skif testload]$ cat testdate.cs
+using System;
+using System.Threading;
+
+public class A {
+ public static void Main( string[] args ) {
+  int i = 0;
+  while ( i < 10000 ) {
+   i++;
+   Thread t = new Thread( new ThreadStart( A.GenerateDate ) );
+   t.Start();
+  }
+ }
+ public static void GenerateDate() {
+  Thread.Sleep(10);
+  DateTime now1 = DateTime.Now;
+  DateTime now2 = DateTime.Now;
+ }
+}
+--8<----------------------------------------
+2. mono testdate.exe
+Perhaps you'll need to start and stop it a few times before you get this 
+exception.
+
+Actual Results:
+
+Unhandled Exception: System.ArgumentException: Key duplication when 
+adding: 2005
+in <0x0025a> System.Collections.Hashtable:PutImpl (object,object,bool)
+in <0x00019> System.Collections.Hashtable:Add (object,object)
+in <0x002ac> System.CurrentTimeZone:GetDaylightChanges (int)
+in <0x00046> System.TimeZone:IsDaylightSavingTime (System.DateTime)
+in <0x0001e> System.CurrentTimeZone:GetUtcOffset (System.DateTime)
+in <0x00077> System.DateTime:.ctor (bool,long)
+in <0x00036> System.DateTime:get_Now ()
+in <0x00028> A:GenerateDate ()
+in <0x0005f> (wrapper delegate-invoke) 
+System.MulticastDelegate:invoke_void ()
+
+Expected Results:
+No exception is thrown when I use MS.Net
+
+How often does this happen? 
+Almost always after you start this program more than 5 times.
+
+Additional information:
+[vadim@skif testload]$ mono --version
+Mono JIT compiler version 1.0.5, (C) 2002-2004 Novell, Inc and 
+Contributors. www.go-mono.com
+        TLS:           __thread
+        GC:            Included Boehm (with typed GC)
+        SIGSEGV      : normal
+        Globalization: ICU
+[vadim@skif testload]$ uname -a
+Linux skif 2.4.25 #2 SMP Fri Apr 23 14:03:00 MSD 2004 i686 athlon i386 
+GNU/Linux
+
+
+Best regards,
+Vadim B. Guzev
+http://u.pereslavl.ru/~vadim/MCSharp/