https://bugs.winehq.org/show_bug.cgi?id=51345
Bug ID: 51345 Summary: Regression: Visual Studio 2005 "package load failure" Product: Wine Version: 6.11 Hardware: x86-64 OS: FreeBSD Status: NEW Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: damjan.jov@gmail.com
winetricks vc2005trial wine cmd "C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat" devenv
Some time during 28-31 March 2021, the Visual Studio 2005 trial began giving +/- 10 of these error dialogs on startup, each relating to a different package. This is a rough transcript of one of them:
------------------------ Package Load Failure ------------------------ Package 'Microsoft.VisualStudio.TestTools.TestCaseManagement.QualtyToolsPackage, Microsoft.VisualStudio.QualityTools.TestCaseManagement, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03F5F7f11d50s3a' has failed to load properly { GUID = {AS4DSAES-9ACE-4FOE-ADGF-7AFESSFEFCET) ). Please contact package vendor for assistance. Application restart is recommended, due to possible environment corruption. Would you like to disable loading this package in the future? You may use 'devenv /resetskippkgs' to re-enable package loading.
Yes No ------------------------
It is the worst git bisect I've ever done. Apart from the lengthy time needed to test each commit, the regression occurs within a range of 44 commits (bb065801a69..2a8a4cbbe63), the first 43 of which all die on startup, so we can't easily distinguish that bug from this one.
I've now had to make a separate branch, "git rebase --onto <that range>" to copy commits from that range there, then "git rebase -i" to reorder them and separate the startup-breaking commits (ntdll/kernel32/kernelbase) from the other commits.
Unfortunately, having done so, it appears the startup-breaking commits are also the commits that caused this regression. One or more of these is the culprit:
ntdll: Move kernel32 loading into LdrInitializeThunk(). ntdll: Return system dir path for PE mapping bootstrap placeholders. ntdll: Fail to load non-existent dlls, except during prefix bootstrap. ntdll: Also check syswow64 to determine if the prefix was initialized. include: Add more SYSTEM_INFORMATION_CLASS definitions. kernel32: Implement GetSystemCpuSetInformation(). ntdll: Implement NtQuerySystemInformationEx(SystemCpuSetInformation). kernelbase: Don't fall back to dll loading for LOAD_LIBRARY_AS_DATAFILE. ntdll: Set the window title to the image name on the Unix side. ntdll: Remove load_builtin_dll() and get_load_order() from the Unix interface. ntdll: Map the builtin or fake dll from the Wine dirs if it's missing from the prefix.
https://bugs.winehq.org/show_bug.cgi?id=51345
Damjan Jovanovic damjan.jov@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |julliard@winehq.org Keywords| |download, regression, | |testcase
--- Comment #1 from Damjan Jovanovic damjan.jov@gmail.com --- I've narrowed it down further to these 7 commits:
ntdll: Move kernel32 loading into LdrInitializeThunk(). ntdll: Return system dir path for PE mapping bootstrap placeholders. ntdll: Fail to load non-existent dlls, except during prefix bootstrap. ntdll: Also check syswow64 to determine if the prefix was initialized. kernelbase: Don't fall back to dll loading for LOAD_LIBRARY_AS_DATAFILE. ntdll: Remove load_builtin_dll() and get_load_order() from the Unix interface. ntdll: Map the builtin or fake dll from the Wine dirs if it's missing from the prefix.
CC their author.
https://bugs.winehq.org/show_bug.cgi?id=51345
Damjan Jovanovic damjan.jov@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Distribution|--- |Ubuntu OS|FreeBSD |Linux
--- Comment #2 from Damjan Jovanovic damjan.jov@gmail.com --- Happens on Linux too.
Happens on both the PE and ELF builds.
https://bugs.winehq.org/show_bug.cgi?id=51345
Damjan Jovanovic damjan.jov@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |Installer
--- Comment #3 from Damjan Jovanovic damjan.jov@gmail.com --- The order of the startup-related vs other commits within that sequence of 44 commits does not matter, the startup-related commits by themselves always reproduce the bug:
good bad... | | | v v v +-----------------+-----------------+ | other | startup-related | +-----------------+-----------------+
good bad.................... | | | | | | | | v v v v v v v v +-----------------+-----------------+ | startup-related | other | +-----------------+-----------------+
Also, the bug happens during installation, not execution. Installing with a bad Wine version then running with a good version, still reproduces the bug.
https://bugs.winehq.org/show_bug.cgi?id=51345
--- Comment #4 from Damjan Jovanovic damjan.jov@gmail.com --- One definite regression caused by those startup-related patches is the following:
winetricks -q 7zip -> winemenubuilder crashes
Why? 1. In winemenubuilder, to thumbnail the shortcut, open_module_icon() is called. 2. It calls: hModule = LoadLibraryExW(szFileName, 0, LOAD_LIBRARY_AS_DATAFILE); 3. The szFileName in this case is a .chm file, so loading fails. 4. open_module_icon() returns with the error: return HRESULT_FROM_WIN32(GetLastError()); 5. But GetLastError() == 0 with this startup-related patchset (which it didn't before), so HRESULT_FROM WIN32() returns 0. 6. The caller wrongly sees success. 7. The caller thus accesses the invalid IStream pointer -> CRASH.
Hacking winemenubuilder to always return a failed HRESULT when LoadLibraryExW() fails stops it from crashing, but it still does not fix this bug. Maybe this bug is caused by the same problem happening somewhere other than winemenubuilder. Or, there are additional regressions introduced by that patchset.
https://bugs.winehq.org/show_bug.cgi?id=51345
--- Comment #5 from Damjan Jovanovic damjan.jov@gmail.com --- (In reply to Damjan Jovanovic from comment #4)
Hacking winemenubuilder to always return a failed HRESULT when LoadLibraryExW() fails stops it from crashing, but it still does not fix this bug. Maybe this bug is caused by the same problem happening somewhere other than winemenubuilder. Or, there are additional regressions introduced by that patchset.
This is only a problem immediately after the patchset, it is no longer a problem in the latest master, so this bug must be due to a different regression from that patchset.
https://bugs.winehq.org/show_bug.cgi?id=51345
Damjan Jovanovic damjan.jov@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|-unknown |ntdll
--- Comment #6 from Damjan Jovanovic damjan.jov@gmail.com --- The kernelbase patch neither fixes the problem when reverted nor breaks it when applied alone on the prior good commits. The 6 remaining patches where the bug must lie, only affect ntdll:
ntdll: Move kernel32 loading into LdrInitializeThunk(). ntdll: Return system dir path for PE mapping bootstrap placeholders. ntdll: Fail to load non-existent dlls, except during prefix bootstrap. ntdll: Also check syswow64 to determine if the prefix was initialized. ntdll: Remove load_builtin_dll() and get_load_order() from the Unix interface. ntdll: Map the builtin or fake dll from the Wine dirs if it's missing from the prefix.
Setting component.
https://bugs.winehq.org/show_bug.cgi?id=51345
Alex Henrie alexhenrie24@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |alexhenrie24@gmail.com
--- Comment #7 from Alex Henrie alexhenrie24@gmail.com --- Does it require 64-bit Wine to reproduce this bug? That could be an important clue. I ran `winetricks vc2005trial && wine cmd "C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat" devenv` in a 32-bit Wine bottle and didn't get any errors.
https://bugs.winehq.org/show_bug.cgi?id=51345
Hans Leidekker hans@meelstraat.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Component|ntdll |msi Fixed by SHA1| |d9d700f3328f00ec419571df0e0 | |2cef208fa1e7b Status|NEW |RESOLVED
--- Comment #8 from Hans Leidekker hans@meelstraat.net --- This turned out to be an msi bug uncovered by the loader changes. It should be fixed with d9d700f3328f00ec419571df0e02cef208fa1e7b.
https://bugs.winehq.org/show_bug.cgi?id=51345
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #9 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 8.2.
https://bugs.winehq.org/show_bug.cgi?id=51345
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |8.0.x
https://bugs.winehq.org/show_bug.cgi?id=51345
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|8.0.x |---
--- Comment #10 from Michael Stefaniuc mstefani@winehq.org --- Removing the 8.0.x milestone from bug fixes included in 8.0.1.