https://bugs.winehq.org/show_bug.cgi?id=58071
Bug ID: 58071 Summary: Sacred Gold: Crash on startup with specific setup Product: Wine Version: 10.5 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: major Priority: P2 Component: d3d Assignee: wine-bugs@winehq.org Reporter: wine@kryotek.mozmail.com Distribution: ---
Created attachment 78325 --> https://bugs.winehq.org/attachment.cgi?id=78325 Tar containing the winedbg log and both system's info
The game crashes on startup on my desktop PC, but works on my laptop.
All the detailed info is in the attachment, here's a TLDR:
Game is really old and runs DX7
Both systems are running the latest Arch Linux with KDE Plasma on Wayland, using the zen kernel.
Laptop is old, with an integrated Intel i3 GPU and a dedicated NVIDIA 610M. I'm NOT using Nvidia dedicated drivers. Integrated display, it believes an external VGA is connected but that's disabled in KDE.
Desktop is a full AMD system with no integrated GPU and a dedicated 6750XT. I have a multi monitor setup with the main being a 1440p 165hz display with VRR, the secondary a 1280x1024 75HZ without VRR.
Initially I had the problem using Bottles, but I tried again with a fresh wine installation and a fresh wine prefix and had the same results.
I'm using the latest wine 10.5 and manually cloning and building wine didn't fix the problem.
The bug is triggered inside "d3d7_EnumZBufferFormats" because the device_iid pointer is 0x438, probably too low to be an actual pointer?
If you want help in reproducing and debugging I'm free most of the time and will be happy to help!
https://bugs.winehq.org/show_bug.cgi?id=58071
--- Comment #1 from Rafał Mużyło galtgendo@o2.pl --- Actually, given the content of wine_dbgstr_guid, this might be something else, though I can't find explanation for that special case...
https://bugs.winehq.org/show_bug.cgi?id=58071
--- Comment #2 from Rafał Mużyło galtgendo@o2.pl --- Scratch that, you might have a quite interesting case here wrt. windowing bugs.
Check the config program and try setting fullscreen off.
(then try moving the window...)
https://bugs.winehq.org/show_bug.cgi?id=58071
--- Comment #3 from wine@kryotek.mozmail.com --- (In reply to Rafał Mużyło from comment #2)
Scratch that, you might have a quite interesting case here wrt. windowing bugs.
Check the config program and try setting fullscreen off.
(then try moving the window...)
Changing the fullscreen option and video compatibility option in Config.exe doesn't change anything. The app always locks with a fullscreen black window that gets drawn over everything else while showing the wine crash screen.
Since you did mention windowing I tried using gamescope and it still crashed, althought on a different path it seems?
0024:fixme:ddraw:ddraw7_Initialize Ignoring guid {aeb2cdd4-6e41-43ea-941c-8361cc760781}. wine: Unhandled page fault on read access to 00000000 at address 0064537C (thread 0024), starting debugger...
As a last resort I tried the wine virtual desktop and it worked fine!
Config.exe and GameServer.exe work just fine, the initial setup from the GameServer doesn't appear in the taskbar but IIRC it does that on Windows too. The only weird thing is that it's behind every other window so you need to minimize everything to see it. But I think that's a separate issue.
Thank you for your help! I will wait for more instructions
https://bugs.winehq.org/show_bug.cgi?id=58071
--- Comment #4 from Rafał Mużyło galtgendo@o2.pl --- Did you check if Wayland is a factor here ?
Check also 32bit color option in config, both with fullscreen on and off.
http://bugs.winehq.org/show_bug.cgi?id=58071
Zeb Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |z.figura12@gmail.com
--- Comment #5 from Zeb Figura z.figura12@gmail.com --- Created attachment 78337 --> http://bugs.winehq.org/attachment.cgi?id=78337 hack
Can you please test the attached patch?
http://bugs.winehq.org/show_bug.cgi?id=58071
--- Comment #6 from wine@kryotek.mozmail.com --- Sorry for the slow response, wine emails are getting into spam for some reason :/
(In reply to Rafał Mużyło from comment #4)
Did you check if Wayland is a factor here ?
Check also 32bit color option in config, both with fullscreen on and off.
Tested about any combination of 32bit color, fullscreen, video compat mode, and GFX_LIMIT128 in Settings.cfg, nothing seemed to work without virtual desktop.
I tried on an X11 session and got the same results, aside from (Wine? X11?) trying to set my monitor's video mode to 1024x768 when fullscreen was checked and made my monitor cry blood. The only difference was that the crash was at offset 0x540 i believe (always consistent) while on wayland it was at 0x438.
(In reply to Zeb Figura from comment #5)
Created attachment 78337 [details] hack
Can you please test the attached patch?
I've just done ./configure and ./wine <path to Sacred.exe> from the source cloned from gitlab, I don't know if I need to configure stuff differently.
I tried on wayland only and it seems consistent with the last crash.
Unhandled exception: page fault on read access to 0x00000480 in 32-bit code (0x7e3d2b6a). Register dump: CS:0023 SS:002b DS:002b ES:002b FS:0063 GS:006b EIP:7e3d2b6a ESP:002d2b20 EBP:002d2b38 EFLAGS:00010212( R- -- I -A- - ) EAX:00000490 EBX:00000480 ECX:00000002 EDX:7e8efae4 ESI:00000480 EDI:002d2c08 Stack dump: 0x002d2b20: 02d358f8 00000000 00000072 02d7c3e0 0x002d2b30: 00000480 002d2c08 002d2bb8 7e8b3e2d 0x002d2b40: 00000480 7e8efae4 00000010 1000e203 0x002d2b50: 00000002 002d2be8 00644e60 00000008 0x002d2b60: 00000002 002d2c28 03d50020 00644ccf 0x002d2b70: 02d35b80 002d2b9c 00644ccf 02d35b80 Backtrace: =>0 0x7e3d2b6a memcmp_blocks+0x2f(ptr1=<internal error>, ptr2=<internal error>, size=<internal error>) [/home/giulio/Source/wine/dlls/msvcrt/string.c:2754] in ucrtbase.dll.so (0x002d2b38) 1 0x7e3d2b6a memcmp+0x10a(ptr1=00000480, ptr2=7E8EFAE4, n=<is not available>) [/home/giulio/Source/wine/dlls/msvcrt/string.c:2783] in ucrtbase.dll.so (0x002d2b38) 2 0x7e8b3e2d d3d7_EnumZBufferFormats+0x4d(iface=<couldn't compute location>, device_iid=<couldn't compute location>, callback=<couldn't compute location>, context=<couldn't compute location>) [/home/giulio/Source/wine/dlls/ddraw/ddraw.c:4561] in ddraw.dll.so (0x002d2bb8) 3 0x00644f34 in sacred (+0x244f34) (0x00000480) 0x7e3d2b6a memcmp+0x10a [/home/giulio/Source/wine/dlls/msvcrt/string.c:2783] in ucrtbase.dll.so: movl (%ebx), %ecx 2783 p2 += align;
http://bugs.winehq.org/show_bug.cgi?id=58071
--- Comment #7 from wine@kryotek.mozmail.com --- (Obviously I applied the patch and built it, I just forgot to mention it)
http://bugs.winehq.org/show_bug.cgi?id=58071
--- Comment #8 from wine@kryotek.mozmail.com --- I found something else that could be useful!
For reference
Big monitor: 2560x1440, 165HZ, VRR, HDR Small monitor: 1280x1024 75HZ Laptop: 1366x768 60HZ
By setting the big display to be 1920x1080 120HZ, the game crashes differently. I can see the loading screen for half a second before the game closes, it doesn't seem like a crash, it just abruply exits.
Anything higher gets the same result as before (I tried 1920x1200).
I tested both with and without the hacky patch (yes I recompiled).
Weirdly enough, this is all with fullscreen turned OFF.
I used Arch's winedbg to get more info out of this:
[giulio@arch wine]$ WINEDEBUG=ddraw+trace winedbg <path to Sacred.exe> 00cc:fixme:wineusb:query_id Unhandled ID query type 0x5. WineDbg starting on pid 0134 0130:fixme:dbghelp:elf_search_auxv can't find symbol in module 0130:fixme:dbghelp:elf_search_auxv can't find symbol in module process_breakpoint () at /build/wine/src/wine-32-build/../wine/dlls/ntdll/signal_i386.c: 578 0x7bd31746 process_breakpoint+0x36 [/build/wine/src/wine-32-build/../wine/dlls/ntdll/sig nal_i386.c:578] in ntdll: movl -0x58(%ebp), %eax 578 __ENDTRY Wine-dbg>cont 0138:fixme:system:NtUserSystemParametersInfo Unimplemented action: 59 (SPI_SETSTICKYKEYS) 0138:fixme:system:NtUserSystemParametersInfo Unimplemented action: 53 (SPI_SETTOGGLEKEYS) 0138:fixme:system:NtUserSystemParametersInfo Unimplemented action: 51 (SPI_SETFILTERKEYS) 0138:fixme:ddraw:DirectDrawEnumerateExA flags 0x6 not handled 0138:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION 0138:fixme:ddraw:ddraw7_Initialize Ignoring guid {aeb2cdd4-6e41-43ea-941c-8361cc760781}. 0138:fixme:ddraw:ddraw7_Initialize Ignoring guid {aeb2cdd4-6e41-43ea-941c-8361cc760781}. 0138:fixme:pulse:pulse_channel_map_to_channel_mask Unhandled channel aux0 0138:fixme:pulse:pulse_channel_map_to_channel_mask Unhandled channel aux0 Thread ID=0164 not in our list of threads -> can't rename 0138:fixme:ddraw:ddraw7_WaitForVerticalBlank iface 02D34EB0, flags 0x1, event 00000000 stub! wine client error:150: write: Descrittore di file errato Process of pid=0134 has terminated
http://bugs.winehq.org/show_bug.cgi?id=58071
--- Comment #9 from wine@kryotek.mozmail.com --- Created attachment 78338 --> http://bugs.winehq.org/attachment.cgi?id=78338 Offset screen
http://bugs.winehq.org/show_bug.cgi?id=58071
--- Comment #10 from wine@kryotek.mozmail.com --- (In reply to wine from comment #9)
Created attachment 78338 [details] Offset screen
Disregard the last comment, I just had to cd into the game's directory before launching it. Lowering the resolution to 1920x1080 lets me launch the game, but the menu is offset as in the provided screenshot.
This patch let's me start the game without crashing but with the offset view.
while (wined3d_output_get_mode(ddraw->wined3d_output, checkFormatList[fmt], WINED3D_SCANLINE_ORDERING_UNKNOWN, modenum++, &mode, false) == WINED3D_OK) { + if(mode.width >= 1920 && mode.height >= 1080) + continue;
http://bugs.winehq.org/show_bug.cgi?id=58071
--- Comment #11 from Rafał Mużyło galtgendo@o2.pl --- (In reply to wine from comment #10)
(In reply to wine from comment #9)
Created attachment 78338 [details] Offset screen
Disregard the last comment, I just had to cd into the game's directory before launching it. Lowering the resolution to 1920x1080 lets me launch the game, but the menu is offset as in the provided screenshot.
This patch let's me start the game without crashing but with the offset view.
while (wined3d_output_get_mode(ddraw->wined3d_output,
checkFormatList[fmt], WINED3D_SCANLINE_ORDERING_UNKNOWN, modenum++, &mode, false) == WINED3D_OK) {
if(mode.width >= 1920 && mode.height >= 1080)
continue;
If you were to run windowed and tried moving the window, there's a strong possibility, that this 'offset' is strongly randomized as you move the window.
http://bugs.winehq.org/show_bug.cgi?id=58071
--- Comment #12 from wine@kryotek.mozmail.com --- (In reply to Rafał Mużyło from comment #11)
(In reply to wine from comment #10)
(In reply to wine from comment #9)
Created attachment 78338 [details] Offset screen
Disregard the last comment, I just had to cd into the game's directory before launching it. Lowering the resolution to 1920x1080 lets me launch the game, but the menu is offset as in the provided screenshot.
This patch let's me start the game without crashing but with the offset view.
while (wined3d_output_get_mode(ddraw->wined3d_output,
checkFormatList[fmt], WINED3D_SCANLINE_ORDERING_UNKNOWN, modenum++, &mode, false) == WINED3D_OK) {
if(mode.width >= 1920 && mode.height >= 1080)
continue;
If you were to run windowed and tried moving the window, there's a strong possibility, that this 'offset' is strongly randomized as you move the window.
It's already in windowed mode and I can't manage to move it anywhere :/
http://bugs.winehq.org/show_bug.cgi?id=58071
--- Comment #13 from Rafał Mużyło galtgendo@o2.pl --- (In reply to wine from comment #12)
It's already in windowed mode and I can't manage to move it anywhere :/
Well, while the window is undecorated, window manager still allows you to move it, usually by holding Alt as you click and drag it.
That's with X11, not sure if that's still valid with wayland (or if the key changed with more recent window managers).