http://bugs.winehq.org/show_bug.cgi?id=16577
Summary: ntdll/loader/actctx: add support of SxS assembly binding redirects Product: Wine Version: 1.1.10 Platform: All URL: http://nikonusa.com/software/NX/1.3/win/CNX130NSAEN.EXE OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: ntdll AssignedTo: wine-bugs@winehq.org ReportedBy: focht@gmx.net
Hello,
this is a showcase bug. I used the app from bug 12414 as example because it highlights some of the issues and hopefully helps to understand the problem (with my comments). We need to end this winetricks vcrun2XXX SxS mess/hell, which requires direct match of SxS assembly dependencies/bindings.
Download: http://nikonusa.com/software/NX/1.3/win/CNX130NSAEN.EXE
$ sha1sum CNX130NSAEN.EXE -> f31b38e3bcca17c8050c207b79315c9be23d582d
Prerequisite: clean WINEPREFIX, winetricks dotnet20
---
The first installer show stopper (which is this bug report out) are actually two bugs: one in winetricks and one in the installer. When you did 'sh winetricks dotnet20' step and start the installer, an error message box will be shown shortly thereafter:
--- snip --- Microsoft Visual C++ Runtime Library
Program: c:\windows\temp\RarSFX0\cnx.exe
R6034 An application has made an attempt to load the C runtime library incorrectly. --- snip ---
The problem comes in form of a sub-installer dependency:
WINEDEBUG=+tid,+seh,+loaddll,+process wine ./nikon.exe
--- snip --- ... 0079:trace:process:CreateProcessW app (null) cmdline L"C:\windows\temp\RarSFX0\cnx.exe" ... 0079:trace:process:CreateProcessW started process pid 007a tid 007b ... 007b:trace:loaddll:free_modref Unloaded module L"C:\windows\temp\nshbb9d.tmp\UserInfo.dll" : native 007b:trace:loaddll:load_native_dll Loaded L"C:\windows\temp\nshbb9d.tmp\process.dll" at 0x10000000: native 007b:fixme:actctx:parse_depend_manifests Could not find dependent assembly L"Microsoft.VC80.CRT" 007b:trace:loaddll:load_native_dll Loaded L"C:\windows\temp\nshbb9d.tmp\LIBEXPATW.dll" at 0x3d0000: native 007b:trace:loaddll:load_builtin_dll Loaded L"C:\windows\system32\mpr.dll" at 0x60c50000: builtin 007b:trace:loaddll:load_builtin_dll Loaded L"C:\windows\system32\wininet.dll" at 0x60c00000: builtin 007b:trace:loaddll:load_builtin_dll Loaded L"C:\windows\system32\msvcrt.dll" at 0x60c80000: builtin 007b:trace:loaddll:load_native_dll Loaded L"C:\windows\system32\MSVCR80.dll" at 0x78130000: native 007b:trace:loaddll:load_native_dll Loaded L"C:\windows\system32\MSVCP80.dll" at 0x7c420000: native 007b:trace:loaddll:load_native_dll Loaded L"C:\windows\temp\nshbb9d.tmp\Activation.dll" at 0x3a0000: native --- snip ---
The culprit is: "fixme:actctx:parse_depend_manifests Could not find dependent assembly L"Microsoft.VC80.CRT"
If we dump the embedded manifest from PE for the "Activation.dll":
--- snip --- <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version="8.0.50727.762" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity> </dependentAssembly> </dependency> <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version="8.0.50608.0" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"> </assemblyIdentity> --- snip ---
We can see two VC 8.0 runtime versions referenced, the VC 8.0 SP1 and an older VC 8.0 one.
"8.0.50727.762" -> Visual C++ 2005 SP1 Redistributable Pack 8.0.50727.762
At this stage, only .NET Framwork 2.0 redist got installed as prerequisite in WINEPREFIX. Because of winetricks' winver 2k hack (missing junction point workaround, bug 12401), VC 8.0.50727.42 runtimes are placed in both: system32 and SxS repo.
This results in errorneous behaviour in case of SxS assembly resolver failure (app references 8.x CRT assemblies not found in SxS) - a fallback load from system32 - which causes the CRT error.
I already explained the differences between 2K and XP in several other bug reports when it comes to loading of SxS assemblies. In short: prevent any CRT (and ATL/MFC) 8.x+ runtime from being put into system32! Such assemblies are never to be loaded from system32 with winver > 2K!
To fix this, 'winetricks dotnet20' step needs to include the removal of these assemblies from system32 as cleanup procedure. A second copy is properly installed into SxS as precaution from M$ guys in the light of win2k -> winxp update which knows about activation contexts/SxS.
--- snip .wine/drive_c/windows/system32 --- $ ls -lsa msvc* 472 -rw-rw-r-- 1 focht focht 479232 2005-09-23 08:29 msvcm80.dll 540 -rw-rw-r-- 1 focht focht 548864 2005-09-23 08:29 msvcp80.dll 616 -rw-rw-r-- 1 focht focht 626688 2005-09-23 08:29 msvcr80.dll .. --- snip .wine/drive_c/windows/system32 ---
The vendor msi installer bug at this stage is that the sub-installer is executed *before* the VC redist installer which would install all required CRT dependencies into SxS. Hence this error is only shown once. That sub-installer failure seems not critical.
Now one might think: "ok, lets do the usual winetricks vcrun2005 ... vcrun2005sp1 mess" before install. If you do this, the error will still remain (assuming you restart with clean WINEPREFIX). The reason is the other "old" VC 8.0 CRT version, referenced in dll manifest: 8.0.50608.0
Winetricks dotnet20 installed a VC 8.0.50727.42 CRT version into SxS (after we removed the ones from system32). This would ideally work but Wine's loader doesn't support the redirection of assembly bindings yet. If you take a look at the policy file from .NET 2.0 installed VC 8 runtime:
"c:\windows\winSxS\policies\x86_policy.8.0.Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_x-ww_77c24773":
--- snip 8.0.50727.42.policy --- <bindingRedirect oldVersion="8.0.41204.256-8.0.50608.0" newVersion="8.0.50727.42"/> --- snip 8.0.50727.42.policy ---
The policy rule would be satisfied, because the assembly asks for version 8.0.50608.0 and the current "up-to-date" version 8.0.50727.42 can be used for that.
After VC 8.0 SP1 install (sh winetricks vcrun2005sp1), another policy file is added:
--- snip 8.0.50727.762.policy ---
<bindingRedirect oldVersion="8.0.41204.256-8.0.50608.0" newVersion="8.0.50727.762"/> <bindingRedirect oldVersion="8.0.50727.42-8.0.50727.762" newVersion="8.0.50727.762"/>
--- snip 8.0.50727.762.policy ---
This would cover (match) the first assembly binding dependency, 8.0.50727.762
Regards
http://bugs.winehq.org/show_bug.cgi?id=16577
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- URL|http://nikonusa.com/software%7Chttp://nikonusa.com/software |/NX/1.3/win/CNX130NSAEN.EXE |/NX/1.3/win/CNX130NSAEN.EXE Platform|All |Other
http://bugs.winehq.org/show_bug.cgi?id=16577
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Keywords| |download
--- Comment #1 from Austin English austinenglish@gmail.com 2008-12-22 10:40:54 --- Confirming.
http://bugs.winehq.org/show_bug.cgi?id=16577
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dank@kegel.com
--- Comment #2 from Dan Kegel dank@kegel.com 2009-02-24 17:00:06 --- Hi Anastasius, Sorry for the delay. I just noticed this winetricks bug report. For the record, winetricks bugs are tracked at http://code.google.com/p/winezeug/issues/list I'll have a look when I get a chance. If you are so inclined you might open an issue there.
http://bugs.winehq.org/show_bug.cgi?id=16577
m.massing@warped-space.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |m.massing@warped-space.de
http://bugs.winehq.org/show_bug.cgi?id=16577
Ken Sharp kennybobs@o2.co.uk changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |kennybobs@o2.co.uk
http://bugs.winehq.org/show_bug.cgi?id=16577
--- Comment #3 from Dan Kegel dank@kegel.com 2010-08-21 01:39:09 --- http://forum.paradoxplaza.com/forum/showthread.php?p=11523967 mentions another app supposedly affected by this.
http://bugs.winehq.org/show_bug.cgi?id=16577
fracting fracting@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |fracting@gmail.com
http://bugs.winehq.org/show_bug.cgi?id=16577
Sylvain Petreolle spetreolle@yahoo.fr changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |spetreolle@yahoo.fr
http://bugs.winehq.org/show_bug.cgi?id=16577
Sven sven.koehler@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |sven.koehler@gmail.com
http://bugs.winehq.org/show_bug.cgi?id=16577
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |Installer Platform|Other |x86 Severity|normal |enhancement
--- Comment #4 from Anastasius Focht focht@gmx.net 2013-05-01 06:03:25 CDT --- Hello folks,
although the app installer doesn't suffer from this bug anymore (Wine now provides all VC++ runtimes as builtins) it's still valid.
Prerequisites: 'winetricks dotnet11 dotnet20 corefonts'
Downgrading to "enhancement".
$ wine --version wine-1.5.29-38-g8e4317c
Regards
https://bugs.winehq.org/show_bug.cgi?id=16577
--- Comment #5 from Anastasius Focht focht@gmx.net --- Hello folks,
revisiting, likely still present.
$ wine --version wine-3.13
Regards
https://bugs.winehq.org/show_bug.cgi?id=16577
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- URL|http://nikonusa.com/softwar |https://web.archive.org/web |e/NX/1.3/win/CNX130NSAEN.EX |/20210206175546/https://cdn |E |-10.nikon-cdn.com/software/ | |NX/1.3/win/CNX130NSAEN.EXE Status|NEW |RESOLVED Resolution|--- |ABANDONED
--- Comment #6 from Anastasius Focht focht@gmx.net --- Hello folks,
adding stable download links via Internet Archive:
https://web.archive.org/web/20210206175546/https://cdn-10.nikon-cdn.com/soft...
https://web.archive.org/web/20210206180035/https://download.gamestar.de/publ...
--- snip --- $ grep -Hrni bindingRedirect ~/.wine/drive_c/windows/winsxs
$ winetricks -q vcrun2005 vcrun2005sp1
$ grep -Hrni bindingRedirect ~/.wine/drive_c/windows/winsxs/policies/*CRT*
/home/focht/.wine/drive_c/windows/winsxs/policies/policy.8.0.Microsoft.VC80.CRT/8.0.50727.6195.policy:9: <bindingRedirect oldVersion="8.0.41204.256-8.0.50608.0" newVersion="8.0.50727.6195"/>
/home/focht/.wine/drive_c/windows/winsxs/policies/policy.8.0.Microsoft.VC80.CRT/8.0.50727.6195.policy:10: <bindingRedirect oldVersion="8.0.50727.42-8.0.50727.6195" newVersion="8.0.50727.6195"/>
/home/focht/.wine/drive_c/windows/winsxs/policies/policy.8.0.Microsoft.VC80.CRT/8.0.50727.42.policy:9: <bindingRedirect oldVersion="8.0.41204.256-8.0.50608.0" newVersion="8.0.50727.42"/> --- snip ---
--- snip --- $ WINEDEBUG=+seh,+loaddll,+actctx wine ./CNX130NSAEN.EXE >>log.txt 2>&1 ... 0114:trace:actctx:get_manifest_in_module looking for res #0002 in module 01910000 L"C:\users\focht\Temp\nsw6ef6.tmp\Activation.dll" 0114:trace:actctx:parse_manifest parsing manifest loaded from (null) base dir (null) 0114:trace:actctx:parse_assembly_elem (0031C314) 0114:trace:actctx:parse_assembly_identity_elem name=L"Microsoft.VC80.CRT" version=8.0.50727.762 arch=L"x86" 0114:trace:actctx:parse_dependent_assembly_elem adding name=L"Microsoft.VC80.CRT" version=8.0.50727.762 arch=L"x86" 0114:trace:actctx:parse_assembly_identity_elem name=L"Microsoft.VC80.CRT" version=8.0.50608.0 arch=L"x86" 0114:trace:actctx:parse_dependent_assembly_elem adding name=L"Microsoft.VC80.CRT" version=8.0.50608.0 arch=L"x86" 0114:trace:actctx:add_dependent_assembly_id reusing existing dependency for L"Microsoft.VC80.CRT" arch L"x86" version 8.0.50608.0 0114:trace:actctx:lookup_assembly looking for name=L"Microsoft.VC80.CRT" version=8.0.50727.762 arch=L"x86" 0114:trace:actctx:get_manifest_in_manifest_file loading manifest file L"\??\C:\windows\winsxs\manifests\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.6195_none_deadbeef.manifest" 0114:trace:actctx:parse_manifest parsing manifest loaded from L"\??\C:\windows\winsxs\manifests\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.6195_none_deadbeef.manifest" base dir L"x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.6195_none_deadbeef" 0114:trace:actctx:parse_assembly_elem (0031C2EC) 0114:trace:actctx:parse_assembly_identity_elem name=L"Microsoft.VC80.CRT" version=8.0.50727.6195 arch=L"x86" 0114:trace:actctx:parse_file_elem name=L"msvcr80.dll" 0114:warn:actctx:parse_file_elem asmv2:hash (undocumented) not supported 0114:trace:actctx:parse_file_elem name=L"msvcp80.dll" 0114:warn:actctx:parse_file_elem asmv2:hash (undocumented) not supported 0114:trace:actctx:parse_file_elem name=L"msvcm80.dll" 0114:warn:actctx:parse_file_elem asmv2:hash (undocumented) not supported 0114:trace:actctx:RtlActivateActivationContextEx 001A9BA0 cookie=1a00a0 ... 0114:trace:actctx:RtlFindActivationContextSectionString 00000001 (null) 2 L"MSVCR80.dll" 0031E728 .. 0114:trace:loaddll:build_module Loaded L"C:\windows\system32\msvcrt.dll" at 01A00000: builtin ... 0114:trace:loaddll:build_module Loaded L"C:\windows\winsxs\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.6195_none_deadbeef\MSVCR80.dll" at 78130000: native 0114:trace:actctx:RtlFindActivationContextSectionString 00000001 (null) 2 L"MSVCP80.dll" 0031E728 0114:trace:actctx:RtlQueryInformationActivationContext 00000000 001A9BA0 0031E74C 3 001AACC0 1024 0031E770 0114:trace:actctx:RtlFindActivationContextSectionString 00000001 (null) 2 L"MSVCR80.dll" 0031E388 0114:trace:actctx:RtlQueryInformationActivationContext 00000000 001A9BA0 0031E3AC 3 001AAE88 1024 0031E3D0 0114:trace:actctx:RtlFindActivationContextSectionString 00000001 (null) 2 L"KERNEL32.dll" 0031E388 0114:trace:loaddll:build_module Loaded L"C:\windows\winsxs\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.6195_none_deadbeef\MSVCP80.dll" at 7C420000: native 0114:trace:actctx:RtlDeactivateActivationContext 0 cookie=1a00a0 0114:trace:loaddll:build_module Loaded L"C:\users\focht\Temp\nsw6ef6.tmp\Activation.dll" at 01910000: native ... ---snip ---
Resolving 'ABANDONED' here as the old behaviour can't be reproduced without disabling builtins, removing manifests/policies and further WinSxS "tweaks" to simulate pre-VC8-builtins/manifests state.
$ sha1sum CNX130NSAEN.EXE f31b38e3bcca17c8050c207b79315c9be23d582d CNX130NSAEN.EXE
$ du -sh CNX130NSAEN.EXE 63M CNX130NSAEN.EXE
$ sha1sum Victoria-2-Demo.exe ab216c52d38de55d498edffce3ba90c9e8d6d547 Victoria-2-Demo.exe $ du -sh Victoria-2-Demo.exe 356M Victoria-2-Demo.exe
Regards
https://bugs.winehq.org/show_bug.cgi?id=16577
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #7 from Austin English austinenglish@gmail.com --- Closing.
https://bugs.winehq.org/show_bug.cgi?id=16577
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|CLOSED |RESOLVED
--- Comment #8 from Austin English austinenglish@gmail.com --- Closing.
https://bugs.winehq.org/show_bug.cgi?id=16577
Ken Sharp imwellcushtymelike@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #9 from Ken Sharp imwellcushtymelike@gmail.com --- Closing bugs marked as abandoned