Page 1 of 1

[raiguard] [2.0.11] Crash on Linux (X11_GL_SwapWindow)

Posted: Sun Oct 27, 2024 9:00 am
by pusty52
Hi, game crashes on startup with the following log. Using Ubuntu 6.11.0-9-generic.
log

Re: [2.0.11] Crash on Linux

Posted: Sun Oct 27, 2024 11:52 am
by gattacus
same here on Ubuntu 24.10

Re: [raiguard] [2.0.11] Crash on Linux (X11_GL_SwapWindow)

Posted: Mon Oct 28, 2024 3:30 pm
by pusty52
I have observed some weird behavior. I doesnt happen every time. Sometimes the game crashes 8 times in a row and then it works, sometimes it works on the first try. I hope that this info does help at least a bit.

Re: [raiguard] [2.0.11] Crash on Linux (X11_GL_SwapWindow)

Posted: Mon Oct 28, 2024 4:05 pm
by gattacus
Well, I use wayland on my system. It seems factorio is using the x11 driver (although I tried to force wayland with SDL_VIDEODRIVER=wayland and the setting in factorio), causing the crash.

Re: [raiguard] [2.0.11] Crash on Linux (X11_GL_SwapWindow)

Posted: Tue Oct 29, 2024 3:13 pm
by jonathanhrl
For me the game did not crash, but froze instead, I had to open gdb and find where the executable was stuck:

Code: Select all

Thread 1 (Thread 0x7f611b3bb0c0 (LWP 432287) "factorio"):
#0  0x00007f611b7c762b in __recvmsg_syscall (fd=33, msg=0x7ffeb6bd3370, flags=0) at ../sysdeps/unix/sysv/linux/recvmsg.c:27
#1  __libc_recvmsg (fd=33, msg=0x7ffeb6bd3370, flags=0) at ../sysdeps/unix/sysv/linux/recvmsg.c:41
#2  0x00007f611ba30438 in ?? () from target:/tmp/pressure-vessel-libs-YL92V2/lib/gameoverlayrenderer.so
#3  0x00007f611ba31346 in ?? () from target:/tmp/pressure-vessel-libs-YL92V2/lib/gameoverlayrenderer.so
#4  0x00007f611ba32552 in ?? () from target:/tmp/pressure-vessel-libs-YL92V2/lib/gameoverlayrenderer.so
#5  0x00007f611ba33a42 in ?? () from target:/tmp/pressure-vessel-libs-YL92V2/lib/gameoverlayrenderer.so
#6  0x00007f611ba22cc5 in glXSwapBuffers () from target:/tmp/pressure-vessel-libs-YL92V2/lib/gameoverlayrenderer.so
#7  0x0000000002e010f6 in X11_GL_SwapWindow () at /tmp/factorio-build-wNHLhy/libraries/SDL2/src/video/x11/SDL_x11opengl.c:1009
#8  0x000000000168c4f7 in GraphicsInterfaceOpenGL::swapBuffers () at /tmp/factorio-build-wNHLhy/src/Graphics/OpenGL/GraphicsInterfaceOpenGL.cpp:275
#9  0x0000000000e21366 in SDLWindow::swap () at /tmp/factorio-build-wNHLhy/src/Graphics/SDLWindow.cpp:396
#10 0x0000000000ecc5c2 in GlobalContext::swapRenderBuffers () at /tmp/factorio-build-wNHLhy/src/GlobalContext.cpp:1486
#11 0x00000000021bd27f in GlobalContext::swapRenderBuffers () at /tmp/factorio-build-wNHLhy/src/GlobalContext.cpp:1448
#12 MainLoop::mainLoopStep () at /tmp/factorio-build-wNHLhy/src/MainLoop.cpp:720
#13 0x00000000021bd5ee in MainLoop::run () at /tmp/factorio-build-wNHLhy/src/MainLoop.cpp:412
#14 0x00000000021ca597 in fmain () at /tmp/factorio-build-wNHLhy/src/Main.cpp:1325
#15 0x000000000240338e in main () at /tmp/factorio-build-wNHLhy/src/Main.cpp:1347
Detaching from program: target:/home/user/.local/share/Steam/steamapps/common/Factorio/bin/x64/factorio, process 432287
[Inferior 1 (process 432287) detached]
gattacus wrote: Mon Oct 28, 2024 4:05 pm Well, I use wayland on my system. It seems factorio is using the x11 driver (although I tried to force wayland with SDL_VIDEODRIVER=wayland and the setting in factorio), causing the crash.
I'm currently using this to force it to use Wayland (in addition to configuring Wayland in Factorio):

Code: Select all

env --unset DISPLAY SDL_VIDEODRIVER=wayland %command%
This will unset the DISPLAY environment variable, which is used by X11 applications to find the X.Org Server. With this unset Factorio will have no other choice than either use Wayland (determined by the WAYLAND_DISPLAY env) or crash. If it crashes, ensure the WAYLAND_DISPLAY env is set (normally its value is wayland-0).

Re: [raiguard] [2.0.11] Crash on Linux (X11_GL_SwapWindow)

Posted: Sat Nov 02, 2024 7:05 pm
by Masztufa
Encountered a similar looking freeze/lockup on wayland KDE plasma

I was watching an ore patch dry up in map mode. It resulted in granting the achievement in game and in steam as well.
After the achievement triggered it locked up, and didn't seem to respond to signals. The music continued to play though.

It looks like that save (and steam) already has the achievement unlocked, so i'm not sure how to go about replicating it.
Just watching it deplete without getting the achievement was not enough.

Posted it here instead of elsewhere because the trace in log looks similar enough.

Re: [raiguard] [2.0.11] Crash on Linux (X11_GL_SwapWindow)

Posted: Sat Nov 02, 2024 11:44 pm
by jonathanhrl
Masztufa wrote: Sat Nov 02, 2024 7:05 pm ...
I was watching an ore patch dry up in map mode. It resulted in granting the achievement in game and in steam as well.
After the achievement triggered it locked up, and didn't seem to respond to signals. The music continued to play though.
...
Adding up to this, this is exactly what happened to me, achievement unlocked on Steam and the game at the same time and it froze right after.

I'm attaching the full gdb dump from that day, it has the stack trace of all threads (it didn't crash again the last few days, but I didn't play that much as well). I forgot to enable command logging so I commented what I did in the file itself.

The majority (if not all) of the threads seem to be stuck waiting on a Futex, some deadlock probably happened inside the engine, but it's just a guess.

Re: [raiguard] [2.0.11] Crash on Linux (X11_GL_SwapWindow)

Posted: Wed Nov 06, 2024 12:46 am
by raiguard
The freeze-on-steam-achievement is a separate bug: 111743