https://bugs.winehq.org/show_bug.cgi?id=51758
Bug ID: 51758 Summary: Wine's time zone information has gaps in "Dynamic DST" causing InvalidTimeZoneException Product: Wine Version: 6.17 Hardware: x86-64 OS: Linux Status: NEW Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: madewokherd@gmail.com Distribution: ---
Hi, since commit 3e370f761a24878ae4047fd7803673d108bea430 wine-mono's test suite fails in MonoTests.System.TimeZoneInfoTest+IsDaylightSavingTimeTests:Bug_9664
commit 3e370f761a24878ae4047fd7803673d108bea430 Author: Giovanni Mascellani gmascellani@codeweavers.com Date: Mon Sep 6 17:36:27 2021 +0200
tzres: Regenerate TZ data from de facto standard sources.
The test failure:
1) Bug_9664 (MonoTests.System.TimeZoneInfoTest+IsDaylightSavingTimeTests.Bug_9664) System.InvalidTimeZoneException : The time zone ID 'Iran Standard Time' was found on the local computer, but the registry information was corrupt. at System.TimeZoneInfo.FindSystemTimeZoneById (System.String id) [0x0009c] in <2b59a54be42b4db59a5b1855eee0c040>:0 at MonoTests.System.TimeZoneInfoTest+IsDaylightSavingTimeTests.Bug_9664 () [0x00170] in <f77f913a6a434c5597e82a9098fa240c>:0 at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&) at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in <2b59a54be42b4db59a5b1855eee0c040>:0
The code Mono uses to read registry timezones looks for a Dynamic DST entry for every year between FirstEntry and LastEntry: https://github.com/mono/corefx/blob/main/src/Common/src/CoreLib/System/TimeZ...
If one of the entries doesn't exist, it raises that exception.
This was a problem with some timezones before that commit, it just happened to reveal the problem because it changed "Iran Standard Time" which is used in the Mono test suite.
To test this, download wine-mono-6.3.0-tests.zip and run $ wine run-tests.exe MonoTests.System.TimeZoneInfoTest+IsDaylightSavingTimeTests:Bug_9664
I'd like to create a new testcase that checks all timezones.
https://bugs.winehq.org/show_bug.cgi?id=51758
Esme Povirk madewokherd@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |gmascellani@codeweavers.com | |, madewokherd@gmail.com Keywords| |dotnet, download, source, | |testcase URL| |https://dl.winehq.org/wine/ | |wine-mono/6.3.0/wine-mono-6 | |.3.0-tests.zip
https://bugs.winehq.org/show_bug.cgi?id=51758
--- Comment #1 from Esme Povirk madewokherd@gmail.com --- Because this is shared code between Mono and .NET, it probably affects .NET as well.
https://bugs.winehq.org/show_bug.cgi?id=51758
--- Comment #2 from Esme Povirk madewokherd@gmail.com --- Created attachment 70658 --> https://bugs.winehq.org/attachment.cgi?id=70658 test case
I added a test to do a more thorough validation, forcing .NET to load all timezone information: https://github.com/madewokherd/wine-mono/commit/1364f4bee49613401dbaf98cad28...
For convenience, here it is in exe form.
https://bugs.winehq.org/show_bug.cgi?id=51758
--- Comment #3 from Giovanni Mascellani gmascellani@codeweavers.com --- Hi, thanks for the report!
Could you check if this version of wine.inf.in is better?
https://gitlab.com/giomasce/wine/-/raw/tzdata/loader/wine.inf.in
https://bugs.winehq.org/show_bug.cgi?id=51758
--- Comment #4 from Esme Povirk madewokherd@gmail.com --- It fixes the particular error I was getting before, but my test program now encounters a different error:
[ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidTimeZoneException: The time zone ID 'Samoa Standard Time' was found on the local computer, but the registry information was corrupt. ---> System.ArgumentOutOfRangeException: The TimeSpan parameter must be within plus or minus 14.0 hours. Parameter name: daylightDelta Actual value was 1.01:00:00.
https://bugs.winehq.org/show_bug.cgi?id=51758
--- Comment #5 from Giovanni Mascellani gmascellani@codeweavers.com --- Hi, I fixed this as well. Unfortunately Windows' time zone format is very restrictive, so when converting from tzdata sometimes choices have to be made, and it's never clear how to them the way Microsoft would do them.
Can you try again and let me know?
https://gitlab.com/giomasce/wine/-/blob/tzdata/loader/wine.inf.in
Thanks, Giovanni.
https://bugs.winehq.org/show_bug.cgi?id=51758
--- Comment #6 from Esme Povirk madewokherd@gmail.com --- Test succeeds now, thanks.
https://bugs.winehq.org/show_bug.cgi?id=51758
--- Comment #7 from Giovanni Mascellani gmascellani@codeweavers.com --- Good, I just submitted my patches upstream.
https://bugs.winehq.org/show_bug.cgi?id=51758
Gijs Vermeulen gijsvrm@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Regression SHA1| |3e370f761a24878ae4047fd7803 | |673d108bea430 Keywords| |regression
--- Comment #8 from Gijs Vermeulen gijsvrm@gmail.com --- The tests work for me with wine-7.0. I'm guessing this was fixed by:
https://source.winehq.org/git/wine.git/commit/dc9165895e1761de931b77827e2031cc5453578b https://source.winehq.org/git/wine.git/commit/3f54e5c0b21e216b55753d6e325a90de937f2da7
It still works after https://source.winehq.org/git/wine.git/commit/929face08481845304315a5dcdf5d01a03119a7e as well.
Esme, can you confirm?
https://bugs.winehq.org/show_bug.cgi?id=51758
Esme Povirk madewokherd@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|NEW |RESOLVED
--- Comment #9 from Esme Povirk madewokherd@gmail.com --- Yep.
https://bugs.winehq.org/show_bug.cgi?id=51758
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #10 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 7.1.
https://bugs.winehq.org/show_bug.cgi?id=51758
Gijs Vermeulen gijsvrm@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |3f54e5c0b21e216b55753d6e325 | |a90de937f2da7