https://bugs.winehq.org/show_bug.cgi?id=46266
Bug ID: 46266 Summary: tzres is constantly being loaded/unloaded when TimeZone information is queried. Product: Wine Version: 4.0-rc1 Hardware: x86 OS: Linux Status: NEW Severity: normal Priority: P2 Component: kernel32 Assignee: wine-bugs@winehq.org Reporter: leslie_alistair@hotmail.com Distribution: ---
Function GetDynamicTimeZoneInformation is causing tzres.dll to be loaded/unloaded multiple times. Cause by the registry lookup of MUI_Std, and MUT_Dlt
Other functions are a affected kernel32.FileTimeToLocalFileTime msvcrt._ftime64
Removing the MUI_Std, and MUT_Dlt entries for my timezone, works around the issue.
https://bugs.winehq.org/show_bug.cgi?id=46266
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |regression Regression SHA1| |67574e4440ac4d9786e52a669b4 | |0197d2a4cb505
--- Comment #1 from Alistair Leslie-Hughes leslie_alistair@hotmail.com --- Author: Akihiro Sagawa sagawa.aki@gmail.com 2018-12-07 22:42:46 Parent: 1da7eebf84af26933404314e49d75f2f536b81a2 (tzres: Add time zone name resource DLL.)
wine.inf: Add MUI time zone name settings.
Signed-off-by: Akihiro Sagawa sagawa.aki@gmail.com Signed-off-by: Alexandre Julliard julliard@winehq.org
https://bugs.winehq.org/show_bug.cgi?id=46266
--- Comment #2 from Alistair Leslie-Hughes leslie_alistair@hotmail.com --- Technically this the commit that causes the issue but isn't noticeable until the registry entries were committed.
Author: Akihiro Sagawa sagawa.aki@gmail.com 2018-12-07 02:33:26
kernel32: Resolve an MUI time zone name.
Signed-off-by: Akihiro Sagawa sagawa.aki@gmail.com Signed-off-by: Alexandre Julliard julliard@winehq.org
https://bugs.winehq.org/show_bug.cgi?id=46266
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |focht@gmx.net
--- Comment #3 from Anastasius Focht focht@gmx.net --- Hello folks,
I can confirm that, seeing a large number of loads/unloads in debugger logs when debugging apps (Ollydbg 1,2, x64dbg/x32dbg etc.).
Regards
https://bugs.winehq.org/show_bug.cgi?id=46266
Sagawa sagawa.aki+winebugs@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |sagawa.aki+winebugs@gmail.c | |om
--- Comment #4 from Sagawa sagawa.aki+winebugs@gmail.com --- Umm, it needs some cache feature in RegLoadMUIString like MUICache registry. I'll work on this. Thanks for reporting.
https://bugs.winehq.org/show_bug.cgi?id=46266
--- Comment #5 from Sagawa sagawa.aki+winebugs@gmail.com --- I noticed RegLoadMUIStringW simply uses LoadLibraryW. Since we're in code freeze, I'll send a patch which uses LoadLibraryEx(LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_IMAGE_RESOURCE) instead.
https://bugs.winehq.org/show_bug.cgi?id=46266
--- Comment #6 from Sagawa sagawa.aki+winebugs@gmail.com --- I sent a patch, https://source.winehq.org/patches/data/155857
https://bugs.winehq.org/show_bug.cgi?id=46266
--- Comment #7 from Alistair Leslie-Hughes leslie_alistair@hotmail.com --- (In reply to Sagawa from comment #6)
I sent a patch, https://source.winehq.org/patches/data/155857
Yes, this improved the load/unload messages.
However, the there is still a massive slowdown because there isn't a cache of these values.
https://bugs.winehq.org/show_bug.cgi?id=46266
張修銘 cges30901@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |cges30901@gmail.com
--- Comment #8 from 張修銘 cges30901@gmail.com --- *** Bug 46288 has been marked as a duplicate of this bug. ***
https://bugs.winehq.org/show_bug.cgi?id=46266
--- Comment #9 from Sagawa sagawa.aki+winebugs@gmail.com --- Created attachment 63004 --> https://bugs.winehq.org/attachment.cgi?id=63004 proposed patch
Here is a proposed patch which caches MUI string. Could you try and/or review this patch before submitting?
https://bugs.winehq.org/show_bug.cgi?id=46266
--- Comment #10 from Nikolay Sivov bunglehead@gmail.com --- Caching may be worth it in any way, but I wonder if we actually should return those strings in a first place. Other bug report had a list of affected API, and most of them should not care at all about timezone name.
https://bugs.winehq.org/show_bug.cgi?id=46266
--- Comment #11 from Alistair Leslie-Hughes leslie_alistair@hotmail.com --- (In reply to Sagawa from comment #9)
Created attachment 63004 [details] proposed patch
Here is a proposed patch which caches MUI string. Could you try and/or review this patch before submitting?
Thanks, The cache makes it usable once again.
https://bugs.winehq.org/show_bug.cgi?id=46266
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch
https://bugs.winehq.org/show_bug.cgi?id=46266
--- Comment #12 from 張修銘 cges30901@gmail.com --- (In reply to Sagawa from comment #9)
Created attachment 63004 [details] proposed patch
Here is a proposed patch which caches MUI string. Could you try and/or review this patch before submitting?
Thank you for the patch. After applying the patch, although it is still a bit slower than before, the speed is much better now.
https://bugs.winehq.org/show_bug.cgi?id=46266
--- Comment #13 from Alistair Leslie-Hughes leslie_alistair@hotmail.com --- Created attachment 63053 --> https://bugs.winehq.org/attachment.cgi?id=63053 Hack to make it work.
There is a relay snippet of a call that doesn't need the MUI strings either.
0097:Call msvcr120._time32(00000000) ret=1f246d9d 0097:Call KERNEL32.GetTimeZoneInformation(09e291f4) ret=f69b47ad 0097:Call advapi32.RegLoadMUIStringW(00000b14,7b49ab70 L"MUI_Std",09e28fb4 L"@tzres.dll,-30368",00000040,00000000,00000000,00000000) ret=7b47a d88 0097:Ret advapi32.RegLoadMUIStringW() retval=00000000 ret=7b47ad88 0097:Call advapi32.RegLoadMUIStringW(00000b14,7b49ab60 L"MUI_Dlt",09e29008 L"@tzres.dll,-30369",00000040,00000000,00000000,00000000) ret=7b47ad88 0097:Ret advapi32.RegLoadMUIStringW() retval=00000000 ret=7b47ad88 0097:Ret KERNEL32.GetTimeZoneInformation() retval=00000002 ret=f69b47ad 0097:Call KERNEL32.GetSystemTimeAsFileTime(09e291ec) ret=f69b47c0 0097:Ret KERNEL32.GetSystemTimeAsFileTime() retval=01d4965d ret=f69b47c0 0097:Ret msvcr120._time32() retval=5c182cbc ret=1f246d9d
That attached patch makes it work for me once again. This is a just a copy of the functions from ntdll.
https://bugs.winehq.org/show_bug.cgi?id=46266
--- Comment #14 from Sagawa sagawa.aki+winebugs@gmail.com --- It seems that your application calls time32 and not ftime64 explicitly. Is it acceptable that implementing time32 without ftime64?
https://bugs.winehq.org/show_bug.cgi?id=46266
--- Comment #15 from Alistair Leslie-Hughes leslie_alistair@hotmail.com --- (In reply to Sagawa from comment #14)
It seems that your application calls time32 and not ftime64 explicitly. Is it acceptable that implementing time32 without ftime64?
It doesn't make sense in just correcting time32, since all the time functions call MSVCRT__ftime64 anyway and aren't going to use the MUI strings.
https://bugs.winehq.org/show_bug.cgi?id=46266
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |b8bafa2c58f69043debe9c7a962 | |eb5f04dee0ca5 Resolution|--- |FIXED Status|NEW |RESOLVED
--- Comment #16 from Alistair Leslie-Hughes leslie_alistair@hotmail.com --- Fixed by https://source.winehq.org/git/wine.git/?a=commit;h=b8bafa2c58f69043debe9c7a9...
https://bugs.winehq.org/show_bug.cgi?id=46266
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #17 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 4.0-rc5.