https://bugs.winehq.org/show_bug.cgi?id=52618
Bug ID: 52618 Summary: 32-bit EXEs do not launch from build dir on macOS 10.14 in WOW64 Product: Wine Version: 7.3 Hardware: x86-64 OS: Mac OS X Status: UNCONFIRMED Severity: normal Priority: P2 Component: build-env Assignee: wine-bugs@winehq.org Reporter: bshanks@codeweavers.com
Created attachment 71943 --> https://bugs.winehq.org/attachment.cgi?id=71943 patch to use @rpath
On macOS 10.14, when running Wine built for WOW64 from the build dir, 32-bit EXEs do not launch correctly (including rundll32 on prefix creation to set up syswow64).
64-bit EXEs launch correctly, and a standalone 32-bit build also works correctly. I'm building the 64-bit side with Xcode 10, and the 32-bit side with Xcode 9.
The problem is a crash on the first NtUser* call, since the __wine_syscall_dispatcher was never set in win32u. The root cause is that dlopen() on the unixlibs is failing because ntdll.so cannot be loaded. Here's the dlerror():
177158.077:00ac:00b0:trace:virtual:load_builtin_unixlib loading /Users/pip/wine/build32/dlls/win32u/win32u.so failed dlerror dlopen(/Users/pip/wine/build32/dlls/win32u/win32u.so, 2): Library not loaded: @loader_path/ntdll.so Referenced from: /Users/pip/wine/build32/dlls/win32u/win32u.so Reason: no suitable image found. Did find: /Users/pip/wine/build64/dlls/ntdll/ntdll.so: mach-o, but wrong architecture /Users/pip/wine/build64/dlls/ntdll/ntdll.so: mach-o, but wrong architecture
This doesn't make sense, it almost seems like @loader_path is still set to the 64-bit dlls/ntdll, which it obviously shouldn't be.
Changing the install name to '@rpath/(lib).so' and adding an rpath of '@loader_path/' seems to fix the issue, even though that should be equivalent to the current approach.
Can anyone else reproduce this problem? If so, does the attached patch help?
https://bugs.winehq.org/show_bug.cgi?id=52618
Gijs Vermeulen gijsvrm@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever confirmed|0 |1
--- Comment #1 from Gijs Vermeulen gijsvrm@gmail.com --- I've been having this issue when running from build dir as well. Also on macOS 10.14, building with the 10.13 SDK and XCode 10. This is some kind of regressions, since it definitely worked a while back, but I haven't had the time to narrow it down.
I'll try your patch in the coming days.
https://bugs.winehq.org/show_bug.cgi?id=52618
Gcenx gcenx83@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |gcenx83@gmail.com
--- Comment #2 from Gcenx gcenx83@gmail.com --- I’ve also seen this issue but not had chance to do a full WoW64 build (had to leave for work before it was done)
However the patch looks correct to me as it’s now using @loadet_path & @rpath correctly where prior it was not being used correctly.
https://bugs.winehq.org/show_bug.cgi?id=52618
--- Comment #3 from Gcenx gcenx83@gmail.com --- Gotten around to testing a full WoW64 build and this patch doesn't really help
Deans-MBP:~ gcenx$ /Users/gcenx/Desktop/WineGIT7.3_BUILD64/wine64 winecfg wine: created the configuration directory '/Users/gcenx/.wine' 002c:fixme:actctx:parse_depend_manifests Could not find dependent assembly L"Microsoft.Windows.Common-Controls" (6.0.0.0) 0048:fixme:actctx:parse_depend_manifests Could not find dependent assembly L"Microsoft.Windows.Common-Controls" (6.0.0.0) 0050:fixme:actctx:parse_depend_manifests Could not find dependent assembly L"Microsoft.Windows.Common-Controls" (6.0.0.0) 0050:err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hr 0x80004002 0050:err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, hr 0x80004002 0050:err:ole:apartment_get_local_server_stream Failed: 0x80004002 0048:err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hr 0x80004002 0048:err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, hr 0x80004002 0048:err:ole:apartment_get_local_server_stream Failed: 0x80004002 0050:err:ole:start_rpcss Failed to open RpcSs service 0048:fixme:imm:ImeSetActiveContext (0x25f330, 0): stub 0048:fixme:imm:ImmReleaseContext (0000000000010020, 000000000025F330): stub 002c:fixme:imm:ImeSetActiveContext (0x28b440, 1): stub 002c:fixme:imm:ImmReleaseContext (000000000001004E, 000000000028B440): stub 0088:fixme:file:NtLockFile I/O completion on lock not implemented yet 0088:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION 0088:err:mscoree:LoadLibraryShim error reading registry key for installroot 0088:err:mscoree:LoadLibraryShim error reading registry key for installroot 0088:err:mscoree:LoadLibraryShim error reading registry key for installroot 0088:err:mscoree:LoadLibraryShim error reading registry key for installroot 0088:err:mscoree:LoadLibraryShim error reading registry key for installroot 0088:err:mscoree:LoadLibraryShim error reading registry key for installroot 0088:err:mscoree:LoadLibraryShim error reading registry key for installroot 0088:err:mscoree:LoadLibraryShim error reading registry key for installroot 0090:err:setupapi:register_fake_dll failed to create IRegistrar: 80004002 0090:err:module:DelayLoadFailureHook failed to delay load ole32.dll.CoInitialize wine: Call from 7B012867 to unimplemented function ole32.dll.CoInitialize, aborting wine: Unimplemented function ole32.dll.CoInitialize called at address 7B012867 (thread 0090), starting debugger... 0090:err:seh:start_debugger Couldn't start debugger L"winedbg --auto 140 48" (2) Read the Wine Developers Guide on how to set up winedbg or another debugger 0088:err:msi:execute_script Execution of script 0 halted; action L"INSTALLFAKEDLLS" returned 1627 0088:err:msi:ITERATE_Actions Execution halted, action L"InstallFinalize" returned 1627 0088:fixme:msi:internal_ui_handler internal UI not implemented for message 0x0b000000 (UI level = 1) 0088:fixme:msi:internal_ui_handler internal UI not implemented for message 0x0b000000 (UI level = 1) 0088:err:mscoree:install_wine_mono MsiInstallProduct failed, err=1627 0098:fixme:imm:ImeSetActiveContext (0x2679f0, 1): stub 0098:fixme:imm:ImmReleaseContext (0000000000010084, 00000000002679F0): stub 00e4:err:module:LdrInitializeThunk "user32.dll" failed to initialize, aborting 00e4:err:module:LdrInitializeThunk Initializing dlls for L"C:\windows\syswow64\rundll32.exe" failed, status c0000005 wine: configuration in L"/Users/gcenx/.wine" has been updated. 0130:fixme:imm:ImeSetActiveContext (0x277170, 1): stub 0130:fixme:imm:ImmReleaseContext (0000000000040038, 0000000000277170): stub Deans-MBP:~ gcenx$ /Users/gcenx/Desktop/WineGIT7.3_BUILD64/wine explorer wine: could not load kernel32.dll, status c0000135
https://bugs.winehq.org/show_bug.cgi?id=52618
--- Comment #4 from Brendan Shanks bshanks@codeweavers.com --- (In reply to Gcenx from comment #3)
Gotten around to testing a full WoW64 build and this patch doesn't really help
Deans-MBP:~ gcenx$ /Users/gcenx/Desktop/WineGIT7.3_BUILD64/wine64 winecfg wine: created the configuration directory '/Users/gcenx/.wine' 002c:fixme:actctx:parse_depend_manifests Could not find dependent assembly L"Microsoft.Windows.Common-Controls" (6.0.0.0) 0048:fixme:actctx:parse_depend_manifests Could not find dependent assembly L"Microsoft.Windows.Common-Controls" (6.0.0.0) 0050:fixme:actctx:parse_depend_manifests Could not find dependent assembly L"Microsoft.Windows.Common-Controls" (6.0.0.0) 0050:err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hr 0x80004002 0050:err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, hr 0x80004002 0050:err:ole:apartment_get_local_server_stream Failed: 0x80004002 0048:err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hr 0x80004002 0048:err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, hr 0x80004002 0048:err:ole:apartment_get_local_server_stream Failed: 0x80004002 0050:err:ole:start_rpcss Failed to open RpcSs service 0048:fixme:imm:ImeSetActiveContext (0x25f330, 0): stub 0048:fixme:imm:ImmReleaseContext (0000000000010020, 000000000025F330): stub 002c:fixme:imm:ImeSetActiveContext (0x28b440, 1): stub 002c:fixme:imm:ImmReleaseContext (000000000001004E, 000000000028B440): stub 0088:fixme:file:NtLockFile I/O completion on lock not implemented yet 0088:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION 0088:err:mscoree:LoadLibraryShim error reading registry key for installroot 0088:err:mscoree:LoadLibraryShim error reading registry key for installroot 0088:err:mscoree:LoadLibraryShim error reading registry key for installroot 0088:err:mscoree:LoadLibraryShim error reading registry key for installroot 0088:err:mscoree:LoadLibraryShim error reading registry key for installroot 0088:err:mscoree:LoadLibraryShim error reading registry key for installroot 0088:err:mscoree:LoadLibraryShim error reading registry key for installroot 0088:err:mscoree:LoadLibraryShim error reading registry key for installroot 0090:err:setupapi:register_fake_dll failed to create IRegistrar: 80004002 0090:err:module:DelayLoadFailureHook failed to delay load ole32.dll.CoInitialize wine: Call from 7B012867 to unimplemented function ole32.dll.CoInitialize, aborting wine: Unimplemented function ole32.dll.CoInitialize called at address 7B012867 (thread 0090), starting debugger... 0090:err:seh:start_debugger Couldn't start debugger L"winedbg --auto 140 48" (2) Read the Wine Developers Guide on how to set up winedbg or another debugger 0088:err:msi:execute_script Execution of script 0 halted; action L"INSTALLFAKEDLLS" returned 1627 0088:err:msi:ITERATE_Actions Execution halted, action L"InstallFinalize" returned 1627 0088:fixme:msi:internal_ui_handler internal UI not implemented for message 0x0b000000 (UI level = 1) 0088:fixme:msi:internal_ui_handler internal UI not implemented for message 0x0b000000 (UI level = 1) 0088:err:mscoree:install_wine_mono MsiInstallProduct failed, err=1627 0098:fixme:imm:ImeSetActiveContext (0x2679f0, 1): stub 0098:fixme:imm:ImmReleaseContext (0000000000010084, 00000000002679F0): stub 00e4:err:module:LdrInitializeThunk "user32.dll" failed to initialize, aborting 00e4:err:module:LdrInitializeThunk Initializing dlls for L"C:\windows\syswow64\rundll32.exe" failed, status c0000005 wine: configuration in L"/Users/gcenx/.wine" has been updated. 0130:fixme:imm:ImeSetActiveContext (0x277170, 1): stub 0130:fixme:imm:ImmReleaseContext (0000000000040038, 0000000000277170): stub Deans-MBP:~ gcenx$ /Users/gcenx/Desktop/WineGIT7.3_BUILD64/wine explorer wine: could not load kernel32.dll, status c0000135
Hmm that OLE error is weird but maybe just related to wine-mono? (which I don't have installed). The 'could not load kernel32.dll, status c0000135' error is what I was seeing. If you run otool -L on win32u.so, did the changes take effect?
$ otool -L ../build32/dlls/win32u/win32u.so ../build32/dlls/win32u/win32u.so: @rpath/win32u.so (compatibility version 0.0.0, current version 0.0.0) @rpath/ntdll.so (compatibility version 0.0.0, current version 0.0.0) /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 158.0.0) /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1561.40.112) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.50.4)
https://bugs.winehq.org/show_bug.cgi?id=52618
--- Comment #5 from Gcenx gcenx83@gmail.com --- (In reply to Brendan Shanks from comment #4)
(In reply to Gcenx from comment #3)
Hmm that OLE error is weird but maybe just related to wine-mono? (which I don't have installed). The 'could not load kernel32.dll, status c0000135' error is what I was seeing. If you run otool -L on win32u.so, did the changes take effect?
$ otool -L ../build32/dlls/win32u/win32u.so ../build32/dlls/win32u/win32u.so: @rpath/win32u.so (compatibility version 0.0.0, current version 0.0.0) @rpath/ntdll.so (compatibility version 0.0.0, current version 0.0.0) /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 158.0.0) /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1561.40.112) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.50.4)
wine-mono wasn’t found I’d skipped the install prompt.
I don’t remember the output from otool -L, need to check that again after work and report back.
https://bugs.winehq.org/show_bug.cgi?id=52618
--- Comment #6 from Gcenx gcenx83@gmail.com --- After resetting wine git and applying the patch/regenerating configure I can now confirm the proposed patch does indeed resolve running from the builddir!
https://bugs.winehq.org/show_bug.cgi?id=52618
Brendan Shanks bshanks@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED Fixed by SHA1| |7b27e60e67d966a6db99dd26113 | |10bc6e02a8e77
--- Comment #7 from Brendan Shanks bshanks@codeweavers.com --- Thanks, patch was committed as 7b27e60e67d966a6db99dd2611310bc6e02a8e77
makefiles: On macOS, use @rpath instead of @loader_path when building Unix libs.
Fixes launching 32-bit EXEs from a WOW64 build dir.
https://bugs.winehq.org/show_bug.cgi?id=52618
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #8 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 7.4.
https://bugs.winehq.org/show_bug.cgi?id=52618
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |7.0.x
https://bugs.winehq.org/show_bug.cgi?id=52618
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|7.0.x |---
--- Comment #9 from Michael Stefaniuc mstefani@winehq.org --- Removing the 7.0.x milestone from bug fixes included in 7.0.1.