https://bugs.winehq.org/show_bug.cgi?id=50407
Bug ID: 50407 Summary: Multiple Adobe CC products fail to start, reporting 'err:module:LdrInitializeThunk "CRClient.dll" failed to initialize' ('_Syserror_map' should return non-NULL string for unknown errors) Product: Wine Version: 6.0-rc3 Hardware: x86-64 OS: Linux Status: NEW Severity: normal Priority: P2 Component: msvcp Assignee: wine-bugs@winehq.org Reporter: focht@gmx.net Distribution: ---
Hello folks,
found with various Adobe CC products. User visible symptom in console:
--- snip --- err:module:LdrInitializeThunk "CRClient.dll" failed to initialize, aborting --- snip ---
Mentioned in bug 47015 and probably more. Users install a crapload of MSVC runtimes via 'winetricks' hence the error is gone - only to run into other Wine bugs.
--- snip --- $ WINEDEBUG=+seh,+relay,+msvcp wine ./Adobe\ Audition.exe >>log.txt 2>&1 ... 0104:Ret PE DLL (proc=0000000012F6C30C,module=0000000012EF0000 L"AuUIToolkit.dll",reason=PROCESS_ATTACH,res=000000000021FB00) retval=1 0104:Call PE DLL (proc=0000000013134EF4,module=0000000013100000 L"CRClient.dll",reason=PROCESS_ATTACH,res=000000000021FB00) ... 0104:Call msvcp140.?_Syserror_map@std@@YAPEBDH@Z(00000000) ret=1310db9c 0104:trace:msvcp:_Syserror_map (0) 0104:Ret msvcp140.?_Syserror_map@std@@YAPEBDH@Z() retval=00000000 ret=1310db9c 0104:trace:seh:dispatch_exception code=c0000005 flags=0 addr=000000001310DBAA ip=000000001310DBAA tid=0104 0104:trace:seh:dispatch_exception info[0]=0000000000000000 0104:trace:seh:dispatch_exception info[1]=0000000000000000 0104:trace:seh:dispatch_exception rax=0000000000000000 rbx=0000000000000000 rcx=00000000ffe0e8d7 rdx=0000000000000050 0104:trace:seh:dispatch_exception rsi=000000000021ea10 rdi=000000000021e960 rbp=000000000021eaf0 rsp=000000000021e8b0 0104:trace:seh:dispatch_exception r8=0000000000000fff r9=0000000000000000 r10=000000000021e40b r11=0000000000000246 0104:trace:seh:dispatch_exception r12=000000000021fb00 r13=00000000ffd90000 r14=0000000000387f6a r15=0000000000387f53 0104:trace:seh:call_vectored_handlers calling handler at 000000007B011BA0 code=c0000005 flags=0 0104:trace:seh:call_vectored_handlers handler at 000000007B011BA0 returned 0 ... 0104:exception c0000005 in PE entry point (proc=0000000013134EF4,module=0000000013100000,reason=PROCESS_ATTACH,res=000000000021FB00) 0104:Ret PE DLL (proc=0000000013134EF4,module=0000000013100000 L"CRClient.dll",reason=PROCESS_ATTACH,res=000000000021FB00) retval=0 0104:Call PE DLL (proc=0000000013134EF4,module=0000000013100000 L"CRClient.dll",reason=PROCESS_DETACH,res=000000000021FB00) 0104:Ret PE DLL (proc=0000000013134EF4,module=0000000013100000 L"CRClient.dll",reason=PROCESS_DETACH,res=000000000021FB00) retval=0 0104:err:module:LdrInitializeThunk "CRClient.dll" failed to initialize, aborting 0104:err:module:LdrInitializeThunk Initializing dlls for L"Z:\home\focht\Downloads\audition\1\universal\App\Adobe Audition.exe" failed, status c0000005 ... --- snip ---
_Syserror_map(0) seems intentional at this place. I found no preceding code path in the dll init code that passes an actual error value.
Corresponding client code:
--- snip --- 000000001310DB80 | mov qword ptr ss:[rsp+8],rbx | 000000001310DB85 | push rdi | 000000001310DB86 | sub rsp,30 | 000000001310DB8A | xor ebx,ebx | 000000001310DB8C | mov ecx,r8d | error = 0 (caller) 000000001310DB8F | mov dword ptr ss:[rsp+20],ebx | 000000001310DB93 | mov rdi,rdx | 000000001310DB96 | call qword ptr ds:[<&_Syserror_map>] | 000000001310DB9C | mov qword ptr ds:[rdi+18],F | 000000001310DBA4 | mov qword ptr ds:[rdi+10],rbx | 000000001310DBA8 | mov byte ptr ds:[rdi],bl | 000000001310DBAA | cmp byte ptr ds:[rax],bl | NULL -> *boom* 000000001310DBAC | je crclient.1310DBBB | 000000001310DBAE | or rbx,FFFFFFFFFFFFFFFF | 000000001310DBB2 | inc rbx | 000000001310DBB5 | cmp byte ptr ds:[rax+rbx],0 | 000000001310DBB9 | jne crclient.1310DBB2 | 000000001310DBBB | mov r8,rbx | 000000001310DBBE | mov rdx,rax | 000000001310DBC1 | mov rcx,rdi | 000000001310DBC4 | call crclient.13106950 | 000000001310DBC9 | mov rbx,qword ptr ss:[rsp+40] | 000000001310DBCE | mov rax,rdi | 000000001310DBD1 | add rsp,30 | 000000001310DBD5 | pop rdi | 000000001310DBD6 | ret | --- snip ---
Wine source:
https://source.winehq.org/git/wine.git/blob/9d7a710fc0d1a0ecea17a68675d3899a...
--- snip --- 2853 #if _MSVCP_VER >= 110 2854 /* ?_Syserror_map@std@@YAPBDH@Z */ 2855 /* ?_Syserror_map@std@@YAPEBDH@Z */ 2856 const char* __cdecl _Syserror_map(int err) 2857 { 2858 int i; 2859 2860 TRACE("(%d)\n", err); 2861 2862 for(i = 0; i < ARRAY_SIZE(syserror_map); i++) 2863 { 2864 if(syserror_map[i].err == err) 2865 return syserror_map[i].str; 2866 } 2867 return NULL; 2868 } 2869 #endif --- snip ---
Returning NULL for unknown error codes (no mapping found) is not desirable. Wine should return a string in such cases to avoid crashes.
$ wine --version wine-6.0-rc3-34-g9d7a710fc0d
Regards