keeperfx
keeperfx copied to clipboard
Intermittent hangs under Wine
Debian sid, wine-8.19, KeeperFX 1.0 release.
The game is hanging and starts consuming 200% CPU at seemingly random moments, be it three minutes or an hour into the game. How should I debug this? Is there a binary built with debug symbols so I can produce some sort of stacktrace?
There isn't one, but I could make you one. Would you join the discord and ask in #techsupport?
EDIT: Yes, yes there is, the included heavylog version has debug symbols.
I've disabled ambience sounds and I'm trying to check if that fixes anything; if I can still reproduce this, I'll join and ask. Is the heavylog version suitable for running for long games?
I've disabled ambience sounds and I'm trying to check if that fixes anything; if I can still reproduce this, I'll join and ask. Is the heavylog version suitable for running for long games?
Not really, it writes a lot of stuff to the log file, making huge log files to the extend that it might slow down everything.
Other users have also reported freezes when using Wine.
Been playing it extensively today, no hangs so far with atmospheric sounds disabled.
Been playing it extensively today, no hangs so far with atmospheric sounds disabled.
Why do you figure this is related?
No idea, just my gut feeling. Hangs at random moments during game that seem unrelated to other parts of the game kind of sounds like atmospheric events that are played at random moments during game that are unrelated to other parts of the game.
Just got a hang with atmospheric sounds disabled, so that's not the culprit.
A shame, but that does not surprise me at all.
Looked a little deeper into that issue, as I am having it too (Arch Linux, Wine 8.20, KeeperFX 1.0, DK Gold from GOG). Symptoms are the same: random hang, 200% CPU. It's worth mentioning though it started happening on "Tickle" level, haven't been experiencing it earlier. From the technical point of view:
-
strace
reported that KeeperFX is waiting on some specific pipe (read(6,
) -
lsof +c 0 | grep <pipe_id>
produces the following:
keeperfx.exe 8569 przem 8r FIFO 0,14 0t0 32375 pipe
keeperfx.exe 8569 przem 9w FIFO 0,14 0t0 32375 pipe
keeperfx.exe 8569 8628 wine_mmdevapi_n przem 8r FIFO 0,14 0t0 32375 pipe
keeperfx.exe 8569 8628 wine_mmdevapi_n przem 9w FIFO 0,14 0t0 32375 pipe
keeperfx.exe 8569 8629 audio_client_ma przem 8r FIFO 0,14 0t0 32375 pipe
keeperfx.exe 8569 8629 audio_client_ma przem 9w FIFO 0,14 0t0 32375 pipe
keeperfx.exe 8569 8630 audio_client_ti przem 8r FIFO 0,14 0t0 32375 pipe
keeperfx.exe 8569 8630 audio_client_ti przem 9w FIFO 0,14 0t0 32375 pipe
keeperfx.exe 8569 8631 wine_dsound_mix przem 8r FIFO 0,14 0t0 32375 pipe
keeperfx.exe 8569 8631 wine_dsound_mix przem 9w FIFO 0,14 0t0 32375 pipe
keeperfx.exe 8569 8632 keeperfx.exe przem 8r FIFO 0,14 0t0 32375 pipe
keeperfx.exe 8569 8632 keeperfx.exe przem 9w FIFO 0,14 0t0 32375 pipe
keeperfx.exe 8569 8633 SDLAudioP2 przem 8r FIFO 0,14 0t0 32375 pipe
keeperfx.exe 8569 8633 SDLAudioP2 przem 9w FIFO 0,14 0t0 32375 pipe
wineserver 8571 przem 23w FIFO 0,14 0t0 32375 pipe
Not sure how or why, but it looks sound-related. I would however point to OGG CD-audio (-nocd
), because I didn't use this feature when playing previous levels.
Not sure how or why, but it looks sound-related. I would however point to OGG CD-audio (
-nocd
), because I didn't use this feature when playing previous levels.
@madmanxxx: a bit more info, when I was getting my own crashes, I was running wine keeperfx.exe
without any switches, so without -nocd
.
tioning though it started happening on "Tickle" level, haven't been experiencing it earlier. From the technical point of view:
this would be an easy test, run the game with a '-cd' command line option and see if the hangs disappear again.
I got a heavylog logfile where it froze: https://keeperfx.net/uploads/keeperfx-heavylog-wine-freeze.log
@Loobinex said on Discord regarding the heavylog logfile:
it does this bit in loop, in wine:
Sync: update_light_render_area: Starting Sync: keeper_screen_redraw: Starting Sync: setup_engine_window: Starting for size (1544,1080) at (376,0) Sync: redraw_display: Starting Sync: process_pointer_graphic: Starting for view 1, player state PLAYER_STATE_CTRLDUNGEON, instance 0 Sync: set_pointer_graphic: Setting to 2 Sync: redraw_isometric_view: Starting Sync: update_explored_flags_for_power_sight: Starting Sync: engine: Starting Sync: draw_view: Starting Sync: display_drawlist: Starting Sync: draw_view: Finished Sync: remove_explored_flags_for_power_sight: Starting Sync: pannel_map_draw_overlay_things: Starting Sync: draw_gui: Starting Sync: update_fade_active_menus: Starting Sync: draw_active_menus_buttons: Starting with 2 active menus Sync: draw_active_menus_buttons: Finished Sync: draw_gui: Finished Sync: message_draw: Starting Sync: gui_draw_all_boxes: Starting Sync: draw_tooltip: Starting Sync: redraw_isometric_view: Finished Sync: draw_eastegg: Starting Sync: redraw_display: Finished Sync: draw_onscreen_direct_messages: Starting
my guess is this fails sometimes on Wine:
TbResult LbScreenUnlock(void) { SYNCDBG(12,"Starting"); if (!lbScreenInitialised) return Lb_FAIL; lbDisplay.WScreen = NULL; lbDisplay.GraphicsWindowPtr = NULL; SDL_UnlockSurface(lbDrawSurface); return Lb_SUCCESS; }
It's just a guess, but this might be a an SDL2 issue.
The SDL2 DLL's were updated in #2557
I suggest testing the the included SDL2 DLL's that were used before: https://github.com/dkfans/keeperfx/releases/tag/v3081
The older SDL2 DLL's can give issues in other parts of the codebase, and were updated with a reason, so we'll most likely not revert the DLL's if using older DLL's fixes it.
I will test too.
FWIW, after updating Wine to 8.21-2 (Arch Linux) the crashes are gone... I've been playing 5+ hours and everything works.
FWIW, after updating Wine to 8.21-2 (Arch Linux) the crashes are gone... I've been playing 5+ hours and everything works.
Thanks for the report, please keep us updated! @yani this might interest you?
@phoe does that fix from madmanxxx work for you too?
I've updated wine to 9.0-rc1 and I see no crash after several hours of playing. I'll reopen in the worst case, but let's close it for now. Thanks.
Nope, it just hung again.
I'm able to reproduce this, where do I obtain the debug version of keeperfx? I don't use Discord.
@zaggynl I would have to make you one, or you can build one yourself. What is it you want to do exactly?
Here is build instructions: https://github.com/dkfans/keeperfx/wiki/Building-KeeperFX
Or would you want me to make you a debug version? For the latest alpha?
If you could, yes please, I got as far as that it starts compiling but fails on: 0024:err:module:import_dll Library libwinpthread-1.dll Which doesn't make sense to me as there is https://github.com/dkfans/keeperfx/pull/1018
I don't know why you still get that error, I'll ask around, but here is the file you asked for: keeperfx.devbuild.debug.3695.zip
Be sure to download and install alpha 3695 first.
0024:err:module:import_dll Library libwinpthread-1.dll
Hi @zaggynl What were you using to compile?
I don't know why you still get that error, I'll ask around, but here is the file you asked for: keeperfx.devbuild.debug.3695.zip
Be sure to download and install alpha 3695 first.
Thanks, this is working, will report back with log file once I get a hang.
0024:err:module:import_dll Library libwinpthread-1.dll
Hi @zaggynl What were you using to compile?
vscode RPM from https://code.visualstudio.com/download# on opensuse tumbleweed.
I am not familiar with opensuse, but I did a quick internet search to see if I could see anything interesting.
This might be what you need: https://github.com/godotengine/godot/issues/10387 (i.e. it seems you need special cross-compile versions of mingw to be able to compile a windows exe in opensuse).
FWIW, after updating Wine to 8.21-2 (Arch Linux) the crashes are gone... I've been playing 5+ hours and everything works.
Now I'm like 20+ hours of playing and no crashes. @zaggynl, @phoe what versions of Wine, kernel, Mesa are you using?
GL_VERSION = 4.6 (Compatibility Profile) Mesa 23.3.1-3 wine-9.0-rc2 Linux helix 6.5.0-5-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.5.13-1 (2023-11-29) x86_64 GNU/Linux
Funny enough, if I play using the keeperfx_hvlog.exe binary I don't get any crashes.
Unfortunately I don't think the log shows anything useful,...