[Bug 51821] New: EVE Online Sisi Client Crashes Due to differences in how Wine and Windows handle LoadLibraryExW Undefined Behavior
https://bugs.winehq.org/show_bug.cgi?id=51821 Bug ID: 51821 Summary: EVE Online Sisi Client Crashes Due to differences in how Wine and Windows handle LoadLibraryExW Undefined Behavior Product: Wine Version: 6.16 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs(a)winehq.org Reporter: algebro(a)tuta.io Distribution: --- I've been chasing this for the last few days and think I may finally have enough information to finally open a bug report. As of a few days ago, the Sisi testing client for EVE stopped working in recent versions of Wine, and the logs showed an unhandled Python error in a module called launchdarkly_client.pyd: ```ImportError: Failed to load DLL: Success``` I chased this down in a debugger and noticed they're passing a relative path to LoadLibraryExW for this library only (full/absolute paths for every other module), and 8 for dwFlags: ```hLibModule = LoadLibraryExW((LPCWSTR)plVar4[3],(HANDLE)0x0,8)``` Per the Microsoft documentation, 8 for dwFlags is undefined when the first argument is a relative path: https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloader... Weirdly enough, the library loads fine on Windows (I've confirmed in windbg), but it fails with error code 0x7e (Module not found) when trying to load it in wine. Other users running Wine 4.4 say Sisi launches fine and doesn't run into the error, although I havent been able to get older versions to build to try and test it, but it sounds like there is a difference between how recent Wine versions implement LoadLibraryExW() and how Windows does, at least with regards to the undefined behavior. Let me know if I can provide any other information that would be helpful for tracking this down. Thanks! -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=51821 --- Comment #1 from algebro(a)tuta.io --- Created attachment 70705 --> https://bugs.winehq.org/attachment.cgi?id=70705 LoadLibraryTest This POC reproduces the behavior accurately I believe. It attempts to load the library with a relative path and dwFlags 8. On Windows, it loads successfully if ran from a parent directory: bin64\LoadLibraryTest.exe Full path name: C:\EVE\SharedCache\sisi\launchdarkly_client.pyd Attempting to load launchdarkly_client.pyd Module loaded successfully On Linux with Wine 6.16, it fails: wine ./bin64/LoadLibraryTest.exe Full path name: C:\EVE\SharedCache\sisi\launchdarkly_client.pyd Attempting to load launchdarkly_client.pyd Module failed to load I can't share the actual module due to copyright/drm issues, but you should be able to test it with any shared library I imagine. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=51821 --- Comment #2 from algebro(a)tuta.io --- Forgot to add that Wine DOES load the module successfully when being ran from the same directory, so it's not an issue with Wine just refusing to load it: SharedCache sisi bin64 wine ./LoadLibraryTest.exe Full path name: C:\EVE\SharedCache\sisi\bin64\launchdarkly_client.pyd Attempting to load launchdarkly_client.pyd Module loaded successfully -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=51821 Anton Vorobyov <phoenix(a)mail.ru> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |phoenix(a)mail.ru --- Comment #3 from Anton Vorobyov <phoenix(a)mail.ru> --- I am affected by this issue as well -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=51821 algebro(a)tuta.io changed: What |Removed |Added ---------------------------------------------------------------------------- Component|-unknown |loader -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=51821 yuratsts <yura.tsts(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |yura.tsts(a)gmail.com -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=51821 ConcernedCapsuleer <cuchumino(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |cuchumino(a)gmail.com --- Comment #4 from ConcernedCapsuleer <cuchumino(a)gmail.com> --- Similarly am having this issue as well when loading SiSi for this launcher. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=51821 algebro(a)tuta.io changed: What |Removed |Added ---------------------------------------------------------------------------- Component|loader |-unknown -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=51821 --- Comment #5 from algebro(a)tuta.io --- I've been digging through the loader.c source and am still trying to understand what the problem is. In a debugging session, I was able to verify that LdrGetDllPath() within load_library() does not return the executable directory in the path for this module, but it does with all the others: ``` Stopped on breakpoint 1 at 0x000000007b027ee8 Wine-dbg>x/u $rcx C:\EVE\SharedCache\sisi\bin64;C:\windows\system32;C:\windows\system;C:\windows;.;C:\windows\system32;C:\windows;C:\windows\system32\wbem;C:\w indows\system32\WindowsPowershell\v1.0 Wine-dbg>x/x $r8 + 8 077c6440 Wine-dbg>x/u 0x077c6440 C:\EVE\SharedCache\sisi\bin64\factionsLoader.pyd [...] ``` Stopped on breakpoint 1 at 0x000000007b027ee8 Wine-dbg>x/x $r8 + 8 1584b780 Wine-dbg>x/u 0x1584b780 launchdarkly_client.pyd Wine-dbg>x/u $rcx C:\windows\system32;C:\windows\system;C:\windows;.;C:\windows\system32;C:\windows;C:\windows\system32\wbem;C:\windows\system32\WindowsPowersh ell\v1.0 ``` I guess the problem is somewhere in LdrGetDllPath() or get_dll_load_path(), but I don't see any comments that look like they would've directly broken something that was working before... -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=51821 --- Comment #6 from algebro(a)tuta.io --- I've confirmed that by moving `launchdarkly_client.pyd` one directory up into the parent (from C:\EVE\SharedCache\sisi\bin64 to C:\EVE\SharedCache\sisi), the game launches perfectly, which should confirm it's an issue with the search path in Wine. Still digging into things but if the wine devs have any input I'd be glad to hear it :) Thanks for tolerating all of my rubber ducking! -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=51821 algebro(a)tuta.io changed: What |Removed |Added ---------------------------------------------------------------------------- Component|-unknown |ntdll -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=51821 --- Comment #7 from algebro(a)tuta.io --- Per @gofman's suggestion, I added a test in dlls/kernel32/tests/path.c that simply calls LdrGetDllPath() with LOAD_WITH_ALTERED_SEARCH_PATH and prints the value: ret = pLdrGetDllPath( buffer, LOAD_WITH_ALTERED_SEARCH_PATH, &path, &unknown_ptr ); ok( ret != 0, "algebro Test: Path: %s\n", wine_dbgstr_w(path)); When running on Windows, the current directory is added to the PATH: Path: L"C:\\Users\\algebro\\Documents;C:\\WINDOWS\\SYSTEM32;C:\\WINDOWS\\system;C:\\WINDOWS;." When running on Wine, it is not added: Path: L"C:\\windows\\system32;C:\\windows\\system;C:\\windows;." So this appears to be a bug specifically in LdrGetDllPath() with LOAD_WITH_ALTERED_SEARCH_PATH, where wine doesn't behave like windows. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=51821 winetest(a)luukku.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |winetest(a)luukku.com --- Comment #8 from winetest(a)luukku.com --- duplicate or at least related to bug 26350. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=51821 --- Comment #9 from algebro(a)tuta.io --- Created attachment 70739 --> https://bugs.winehq.org/attachment.cgi?id=70739 Patch to append the exe directory when loading DLLs with 0x8 Attaching a patch here for EVE players to test with Sisi. Working on conformance tests to try and figure out if removing this condition is the correct approach, or if finer checks are needed. Currently there are no conformance tests for LOAD_WITH_ALTERED_SEARCH_PATH. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=51821 algebro(a)tuta.io changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|EVE Online Sisi Client |EVE Online Client Crashes |Crashes Due to differences |Due to differences in how |in how Wine and Windows |Wine and Windows handle |handle LoadLibraryExW |LoadLibraryExW Undefined |Undefined Behavior |Behavior -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=51821 --- Comment #10 from algebro(a)tuta.io --- I updated the title because this change has now been rolled into the release client as well (tranquility). https://source.winehq.org/patches/data/216868 is confirmed to fix both clients. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=51821 algebro(a)tuta.io changed: What |Removed |Added ---------------------------------------------------------------------------- Version|6.16 |6.19 -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=51821 ppfeufer <info(a)ppfeufer.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |info(a)ppfeufer.de -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=51821 algebro(a)tuta.io changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|EVE Online Client Crashes |EVE Online Client Crashes |Due to differences in how |Due to differences in how |Wine and Windows handle |Wine and Windows handle |LoadLibraryExW Undefined |LdrGetDllPath with dwFlags |Behavior |0x8 and relative path -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=51821 --- Comment #11 from yuratsts <yura.tsts(a)gmail.com> --- proposed patch works for me (gentoo, wine-staging-6.19) -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=51821 willy <wilroz(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wilroz(a)gmail.com --- Comment #12 from willy <wilroz(a)gmail.com> --- Release client now crashes on launch for me too. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=51821 N. Andrew Walsh <n.andrew.walsh(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |n.andrew.walsh(a)gmail.com --- Comment #13 from N. Andrew Walsh <n.andrew.walsh(a)gmail.com> --- this issue affects me. How do I apply the patch? -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=51821 --- Comment #14 from Austin English <austinenglish(a)gmail.com> --- (In reply to N. Andrew Walsh from comment #13)
this issue affects me. How do I apply the patch?
See https://wiki.winehq.org/Patching / https://wiki.winehq.org/Building_Wine -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=51821 greg2008200(a)gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |greg2008200(a)gmail.com --- Comment #15 from greg2008200(a)gmail.com --- The proposed patch worked for me. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=51821 heroeschman(a)gmx.de changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |heroeschman(a)gmx.de --- Comment #16 from heroeschman(a)gmx.de --- The patch works for me too. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=51821 Kevin Andrews <kjandrews0(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kjandrews0(a)gmail.com --- Comment #17 from Kevin Andrews <kjandrews0(a)gmail.com> --- Patch working for me on both wine and wine-staging across two machines. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=51821 g2g591(a)gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |g2g591(a)gmail.com --- Comment #18 from g2g591(a)gmail.com --- still have this issue with wine 6.21 (with staging patchset) , and the attached patch still fixes it. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=51821 nick(a)foxsec.net changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick(a)foxsec.net --- Comment #19 from nick(a)foxsec.net --- Created attachment 71084 --> https://bugs.winehq.org/attachment.cgi?id=71084 Upstream patch v5 - 1/2 -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=51821 --- Comment #20 from nick(a)foxsec.net --- Created attachment 71085 --> https://bugs.winehq.org/attachment.cgi?id=71085 Upstream patch v5 - 2/2 I've attached the patches I've been trying to get upstreamed for a bit, but it's been slow-going because there aren't a lot of maintainers who are comfortable with this area of the codebase. @zf, @gofman etc., would you guys consider adding this to wine-staging for now? I'm planning to continue trying to get these upstreamed but I'm not sure it's going to be able to happen before the upcoming code freeze. Please let me know if there's anything I can do to help. Thanks! -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=51821 nick(a)foxsec.net changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |gofmanp(a)gmail.com, | |z.figura12(a)gmail.com -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=51821 --- Comment #21 from algebro(a)tuta.io --- The patches to fix this have been merged upstream in https://source.winehq.org/git/wine.git/commit/ef26f7bd5cf36806f7b465dc1942ab... -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=51821 algebro(a)tuta.io changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|UNCONFIRMED |RESOLVED --- Comment #22 from algebro(a)tuta.io --- Fixed by ef26f7bd5cf36806f7b465dc1942ab6a2e0541b9 -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=51821 algebro(a)tuta.io changed: What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |ef26f7bd5cf36806f7b465dc194 | |2ab6a2e0541b9 -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=51821 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #23 from Alexandre Julliard <julliard(a)winehq.org> --- Closing bugs fixed in 7.0-rc1. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=51821 Michael Stefaniuc <mstefani(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |6.0.x -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=51821 Michael Stefaniuc <mstefani(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|6.0.x |--- --- Comment #24 from Michael Stefaniuc <mstefani(a)winehq.org> --- Removing the 6.0.x milestone from bug fixes included in 6.0.4. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
WineHQ Bugzilla