[Mono-bugs] [Bug 38824][Nor] Changed - Infinite loop in ves_icall_System_CurrentTimeZone_GetTimeZoneData

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Sat, 1 Mar 2003 14:18: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 efeingold@mn.rr.com.

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

--- shadow/38824	Sat Mar  1 12:44:35 2003
+++ shadow/38824.tmp.27887	Sat Mar  1 14:18:47 2003
@@ -1,13 +1,13 @@
 Bug#: 38824
 Product: Mono/Runtime
 Version: unspecified
 OS: unknown
 OS Details: 
-Status: RESOLVED   
-Resolution: NOTABUG
+Status: REOPENED   
+Resolution: 
 Severity: Unknown
 Priority: Normal
 Component: misc
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: efeingold@mn.rr.com               
 QAContact: mono-bugs@ximian.com
@@ -57,6 +57,45 @@
 }
 ----
 
 which ends up calling
 ves_icall_System_CurrentTimeZone_GetTimeZoneData, and it does not loop
 forever.
+
+------- Additional Comments From efeingold@mn.rr.com  2003-03-01 14:18 -------
+I have verified with your program, and I do get the infinite loop. 
+Latest CVS sources, RedHat 8.0.
+
+The critical problem is at icall.c:2596, when gmt_offset is 
+calculated, it returns 0 for the year 1969. The infinite loop happens 
+in the do...while loop around line 2618, where t1 starts at 86399 and 
+gets degremented. gmt_offset(tt1) returns -21600, which never matches 
+the 0 it got above.
+
+Here is a C program which also demonstrates the problem:
+
+#include <time.h>
+
+int main()
+{
+  struct tm start;
+  time_t    t;
+
+  memset(&start, 0, sizeof(start));
+  start.tm_mday = 1;
+  start.tm_year = 1969-1900;
+
+  t = mktime(&start);
+
+  printf("t = %d\n", t);
+  printf("GMT offset = %d\n", start.tm_gmtoff);
+}
+
+On my system, mktime() returns -1!
+
+I found the following bit from Google:
+
+"It seems that Red Hat's latest glibc has introduced a strict 
+interpretation of the  ISO C mktime() definition, such that dates 
+before 1970 are now considered to be out of range.  This has caused 
+breakage of any application that relies on the old behaviour, such as 
+PostgreSQL."