https://bugs.winehq.org/show_bug.cgi?id=45536
Bug ID: 45536 Summary: Total Commander 9.x crashes on unimplemented function usp10.dll.ScriptGetFontAlternateGlyphs when Wine is not detected Product: Wine Version: 3.13 Hardware: x86-64 OS: Linux Status: NEW Severity: normal Priority: P2 Component: usp10 Assignee: wine-bugs@winehq.org Reporter: focht@gmx.net Distribution: ---
Hello folks,
while investigating bug 45514 (dupe of bug 42497) my Total Commander 9.x installation stopped working because I made 'wine_get_version' a '-noname' ordinal export (cheaper way, to avoid using Wine-Staging/patchset). The app no longer detects Wine and runs into a problem.
Download: https://totalcommander.ch/win/tcmd920x64.exe
--- snip --- $ pwd /home/focht/wineprefix64-tcmd/drive_c/totalcmd
$ file *.{DLL,EXE} TC7Z64.DLL: PE32+ executable (DLL) (GUI) x86-64, for MS Windows TCLZMA64.DLL: PE32+ executable (DLL) (GUI) x86-64, for MS Windows TCUNZL64.DLL: PE32+ executable (DLL) (GUI) x86-64, for MS Windows UNRAR64.DLL: PE32+ executable (DLL) (console) x86-64, for MS Windows WCMICON2.DLL: PE32 executable (DLL) (GUI) Intel 80386, for MS Windows WCMICONS.DLL: PE32 executable (GUI) Intel 80386, for MS Windows WCMZIP64.DLL: PE32+ executable (DLL) (GUI) x86-64, for MS Windows NOCLOSE64.EXE: PE32+ executable (GUI) x86-64, for MS Windows TCMADM64.EXE: PE32+ executable (GUI) x86-64, for MS Windows TCMDX32.EXE: PE32 executable (GUI) Intel 80386, for MS Windows TCUNIN64.EXE: PE32+ executable (GUI) x86-64, for MS Windows TOTALCMD64.EXE: PE32+ executable (GUI) x86-64, for MS Windows
$ WINEDEBUG=+seh,+relay wine TOTALCMD64.EXE >>log.txt 2>&1 ... 0030:Call KERNEL32.GetProcAddress(7bc80000,00a8a890 "wine_get_version") ret=00474dbb 0030:Ret KERNEL32.GetProcAddress() retval=00000000 ret=00474dbb ... 0030:Ret usp10.ScriptItemize() retval=00000000 ret=009f4047 0030:Call usp10.ScriptShape(00250258,00bd1bc0,01cb9768,00000001,00000010,00099634,02f35050,02f35090,02f350d0,0037693c) ret=009f40d1 ... 0030:Ret usp10.ScriptShape() retval=00000000 ret=009f40d1 0030:Call KERNEL32.RaiseException(80000100,00000001,00000002,01cb96a0) ret=7fe6fee5eb50 0030:trace:seh:NtRaiseException code=80000100 flags=1 addr=0x7b4944b9 ip=7b4944b9 tid=0030 0030:trace:seh:NtRaiseException info[0]=00007fe6fee5eb80 0030:trace:seh:NtRaiseException info[1]=00007fe6fee5eb95 wine: Call from 0x7b4944b9 to unimplemented function usp10.dll.ScriptGetFontAlternateGlyphs, aborting 0030:trace:seh:call_vectored_handlers calling handler at 0x419950 code=80000100 flags=1 ... --- snip ---
Source: https://source.winehq.org/git/wine.git/blob/HEAD:/dlls/usp10/usp10.spec#l9
--- snip --- 9 @ stub ScriptGetFontAlternateGlyphs --- snip ---
Microsoft docs:
https://docs.microsoft.com/en-us/windows/desktop/api/usp10/nf-usp10-scriptge...
$ sha1sum tcmd920x64.exe d27abd02fe60002cfb60b1c68888a666c48c9142 tcmd920x64.exe
$ du -sh tcmd920x64.exe 5.0M tcmd920x64.exe
$ wine --version wine-3.13
Regards
https://bugs.winehq.org/show_bug.cgi?id=45536
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- URL| |https://totalcommander.ch/w | |in/tcmd920x64.exe Keywords| |download
https://bugs.winehq.org/show_bug.cgi?id=45536
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|Total Commander 9.x crashes |Total Commander 9.x crashes |on unimplemented function |on unimplemented function |usp10.dll.ScriptGetFontAlte |usp10.dll.ScriptGetFontAlte |rnateGlyphs when Wine is |rnateGlyphs when Wine is |not detected |not detected via named | |export | |'ntdll.wine_get_version' URL|https://totalcommander.ch/w |https://web.archive.org/web |in/tcmd920x64.exe |/20190412204700/https://tot | |alcommander.ch/win/tcmd922a | |x64.exe
--- Comment #1 from Anastasius Focht focht@gmx.net --- Hello folks,
revisiting, still present.
Adding snapshot to most recent version 9.22a via Internet Archive:
https://web.archive.org/web/20190412204700/https://totalcommander.ch/win/tcm...
The easiest way to reproduce without using Wine-Staging is to export 'ntdll.wine_get_version()' by ordinal only (one line change):
https://source.winehq.org/git/wine.git/blob/HEAD:/dlls/ntdll/ntdll.spec#l151...
--- snip --- @ cdecl wine_get_version() NTDLL_wine_get_version --- snip ---
Example:
--- snip --- 1234 cdecl -noname wine_get_version() NTDLL_wine_get_version --- snip ---
$ sha1sum tcmd922ax64.exe 0434912ab8ec1ac38aa7c2d00a06ba8e5f843c8f tcmd922ax64.exe
$ du -sh tcmd922ax64.exe 5.0M tcmd922ax64.exe
$ wine --version wine-4.6
Regards
https://bugs.winehq.org/show_bug.cgi?id=45536
--- Comment #2 from Anastasius Focht focht@gmx.net --- Hello folks,
revisiting, obviously still present.
$ wine --version wine-5.9
Regards
https://bugs.winehq.org/show_bug.cgi?id=45536
Louis Lenders xerox.xerox2000x@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |xerox.xerox2000x@gmail.com
--- Comment #3 from Louis Lenders xerox.xerox2000x@gmail.com --- Created attachment 67243 --> https://bugs.winehq.org/attachment.cgi?id=67243 stub for ScriptGetFontAlternateGlyphs
stub for ScriptGetFontAlternateGlyphs,
will send later to devel-list
https://bugs.winehq.org/show_bug.cgi?id=45536
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Fixed by SHA1| |8257fe88fb99ca0bdeec27b47b7 | |cf835bda5c061 Status|NEW |RESOLVED
--- Comment #4 from Anastasius Focht focht@gmx.net --- Hello folks,
the crash is fixed by commit https://source.winehq.org/git/wine.git/commitdiff/8257fe88fb99ca0bdeec27b47b... ("usp10: Add stub for ScriptGetFontAlternateGlyphs.").
Thanks Louis
--- snip --- $ wine ./TOTALCMD64.EXE ... 0214:fixme:uniscribe:ScriptGetFontAlternateGlyphs (0000000000250244, 0000000000BE4370, 000000000261D904, "latn", "ROM ", "tnum", 0x0013, 10, 000000000261D920, 0000000001CC9678) 0214:fixme:uniscribe:ScriptGetFontAlternateGlyphs (0000000000250244, 0000000000BE4370, 000000000261D904, "latn", "ROM ", "tnum", 0x0014, 10, 000000000261D920, 0000000001CC9678) 0214:fixme:uniscribe:ScriptGetFontAlternateGlyphs (0000000000250244, 0000000000BE4370, 000000000261D904, "latn", "ROM ", "tnum", 0x0015, 10, 000000000261D920, 0000000001CC9678) 0214:fixme:uniscribe:ScriptGetFontAlternateGlyphs (0000000000250244, 0000000000BE4370, 000000000261D904, "latn", "ROM ", "tnum", 0x0016, 10, 000000000261D920, 0000000001CC9678) 0214:fixme:uniscribe:ScriptGetFontAlternateGlyphs (0000000000250244, 0000000000BE4370, 000000000261D904, "latn", "ROM ", "tnum", 0x0017, 10, 000000000261D920, 0000000001CC9678) 0214:fixme:uniscribe:ScriptGetFontAlternateGlyphs (0000000000250244, 0000000000BE4370, 000000000261D904, "latn", "ROM ", "tnum", 0x0018, 10, 000000000261D920, 0000000001CC9678) 0214:fixme:uniscribe:ScriptGetFontAlternateGlyphs (0000000000250244, 0000000000BE4370, 000000000261D904, "latn", "ROM ", "tnum", 0x0019, 10, 000000000261D920, 0000000001CC9678) 0214:fixme:uniscribe:ScriptGetFontAlternateGlyphs (0000000000250244, 0000000000BE4370, 000000000261D904, "latn", "ROM ", "tnum", 0x001a, 10, 000000000261D920, 0000000001CC9678) 0214:fixme:uniscribe:ScriptGetFontAlternateGlyphs (0000000000250244, 0000000000BE4370, 000000000261D904, "latn", "ROM ", "tnum", 0x001b, 10, 000000000261D920, 0000000001CC9678) 0214:fixme:uniscribe:ScriptGetFontAlternateGlyphs (0000000000250244, 0000000000BE4370, 000000000261D904, "latn", "ROM ", "tnum", 0x001c, 10, 000000000261D920, 0000000001CC9678) 0218:fixme:bitmap:CreateBitmapIndirect planes = 0 0218:fixme:bitmap:CreateBitmapIndirect planes = 0 0218:fixme:bitmap:CreateBitmapIndirect planes = 0 0218:fixme:bitmap:CreateBitmapIndirect planes = 0 0218:fixme:bitmap:CreateBitmapIndirect planes = 0 ... --- snip ---
Fortunately the app checks the HRESULT so the stub doesn't do any harm.
--- snip --- ... 0000000000A03D6C | mov rax,qword ptr ss:[rbp-10] | 0000000000A03D70 | lea r8,qword ptr ds:[rax+4] | 0000000000A03D74 | lea rdx,qword ptr ds:[BE4370] | 0000000000A03D7B | mov rax,r13 | 0000000000A03D7E | mov r10,qword ptr ds:[<&ScriptGetFontAlternateGlyphs>] 0000000000A03D85 | mov rcx,rax | 0000000000A03D88 | call r10 | 0000000000A03D8B | mov r12d,eax | 0x80004001 0000000000A03D8E | mov ecx,r12d | 0000000000A03D91 | call totalcmd64.41BF60 | check HRESULT 0000000000A03D96 | test eax,eax | 0000000000A03D98 | je totalcmd64.A03DF0 | ZF fail 0000000000A03D9A | mov eax,dword ptr ss:[rbp-48] | 0000000000A03D9D | cmp eax,1 | 0000000000A03DA0 | jle totalcmd64.A03DF0 | ... 000000000041BF60 | push rbp | 000000000041BF61 | mov rbp,rsp | 000000000041BF64 | sub rsp,10 | 000000000041BF68 | mov dword ptr ss:[rbp-8],ecx | HRESULT 000000000041BF6B | mov eax,dword ptr ss:[rbp-8] | 000000000041BF6E | and eax,80000000 | 000000000041BF73 | test eax,eax | 000000000041BF75 | sete al | 000000000041BF78 | movzx eax,al | 000000000041BF7B | neg eax | 000000000041BF7D | mov dword ptr ss:[rbp-10],eax | 000000000041BF80 | mov eax,dword ptr ss:[rbp-10] | 000000000041BF83 | leave | 000000000041BF84 | ret | ... --- snip ---
$ wine --version wine-5.9-67-g8257fe88fb
Regards
https://bugs.winehq.org/show_bug.cgi?id=45536
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #5 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 5.10.
https://bugs.winehq.org/show_bug.cgi?id=45536
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |5.0.x
https://bugs.winehq.org/show_bug.cgi?id=45536
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|5.0.x |---
--- Comment #6 from Michael Stefaniuc mstefani@winehq.org --- Removing the 5.0.x milestone from bug fixes included in 5.0.3.