Page 1 of 1
[2.0.7] Crash on Linux Wayland after wake-up from suspend
Posted: Mon Oct 21, 2024 5:01 pm
by Sivecano
Factorio crashes when waking up from suspend.
Setup:
OS: Linux
Distro: Arch
Display Protocol: Wayland
Compositor: Hyprland
Steps to reproduce:
- start factorio
- suspend system (systemctl suspend)
- wake up from suspend (by pressing keys for example)
- factorio crashes (both in menu and in-game)
Log;
Re: Crash on Linux Wayland after wake-up from suspend
Posted: Mon Oct 21, 2024 5:03 pm
by Rseding91
Thanks for the report however as far as I know we do not support suspending the operating system while Factorio is running. If it works, that's great, and we don't do anything in an attempt to prevent it from working. But, if it doesn't work - we aren't interested in spending time trying to work around operating system bugs.
As far as I'm aware suspend and resume is supposed to be transparent from the program/application perspective. So, if it isn't working, the operating system or drivers are doing something wrong that's breaking things.
Re: [2.0.7] Crash on Linux Wayland after wake-up from suspend
Posted: Mon Oct 21, 2024 5:05 pm
by raiguard
This is actually crashing in SDL, so it's not our bug to fix anyway.
Re: [2.0.7] Crash on Linux Wayland after wake-up from suspend
Posted: Mon Oct 21, 2024 5:06 pm
by Sivecano
alright, maybe the issue is also to be found in SDL or libwayland. thanks for the quick response though <3
Re: [2.0.7] Crash on Linux Wayland after wake-up from suspend
Posted: Mon Oct 21, 2024 5:14 pm
by raiguard
We are not quite on the latest SDL version so it's possible that it has since been fixed. We will update SDL at some point after the bug rush dies down.
Re: [2.0.7] Crash on Linux Wayland after wake-up from suspend
Posted: Mon Oct 21, 2024 9:37 pm
by NeveHanter
From the logs I've noticed you're using Nvidia RTX 3080. Both open-source and proprietary Nvidia drivers
by default don't preserve video memory after system suspend. In pre-2.0 Factorio I've had problems with corrupted texture atlas after resuming from sleep but after configuring driver's memory preservation these were gone, maybe in SDL used in 2.0 or because of some rendering updates game now crashes.
Try following the steps described here on ArchLinux Wiki:
https://wiki.archlinux.org/title/NVIDIA ... er_suspend.
For me with Factorio: Space Age 2.0.7 on up-to-date ArchLinux, with Nvidia RTX A2000 running on KDE Plasma 6 with Wayland, open-source drivers with Nvidia memory preservation enabled, running through prime-run command (PRIME GPU offloading), with specific video driver selected from the game settings menu:
- X11, game resumes just fine and I can continue the game without any problems,
- Wayland, game doesn't crash but soft-locks itself (I can still hear game audio, maximize the screen but it no longer processes system events and KDE asks if I want to kill not responding app, there're zero errors in the logs until I allow KDE to stop the process, logs below)
Code: Select all
118.585 Error CrashHandler.cpp:643: Received 6
Factorio crashed. Generating symbolized stacktrace, please wait ...
/tmp/factorio-build-QueLkE/src/Util/StacktraceToStream.cpp (52): walkStackAndPrintToStream
/tmp/factorio-build-QueLkE/src/Util/StacktraceToStream.cpp (60): Util::printStacktraceToStream(WriteStream&)
/tmp/factorio-build-QueLkE/src/Util/Logger.cpp (334): Logger::writeStacktrace(WriteStream*, StackTraceInfo*)
/tmp/factorio-build-QueLkE/src/Util/Logger.cpp (379): Logger::logStacktrace(StackTraceInfo*)
/tmp/factorio-build-QueLkE/src/Util/CrashHandler.cpp (183): CrashHandler::writeStackTrace(CrashHandler::CrashReason)
/tmp/factorio-build-QueLkE/src/Util/CrashHandler.cpp (644): CrashHandler::commonSignalHandler(int)
/tmp/factorio-build-QueLkE/src/Util/CrashHandler.cpp (652): CrashHandler::SignalHandler(int)
0x71ea89e611cf
sched_yield
0x71ea765f9e3d
0x71ea76710a82
0x71ea766700e9
0x71ea7667098b
0x71ea765eae04
0x71ea7660f014
0x71ea77c9a405
0x71ea77c9d256
0x71ea77c35559
0x71ea77c3c1b0
0x71ea77c3b4fe
0x71ea77c3b5b0
0x71ea77c3be2f
0x71ea77c4e1fb
0x71ea8a139f34
0x71ea8a13ae65
/tmp/factorio-build-QueLkE/libraries/SDL2/src/video/wayland/SDL_waylandwindow.c (238): ConfigureWindowGeometry
/tmp/factorio-build-QueLkE/libraries/SDL2/src/video/wayland/SDL_waylandwindow.c (2127): Wayland_HandleResize
/tmp/factorio-build-QueLkE/libraries/SDL2/src/video/wayland/SDL_waylandwindow.c (550): handle_configure_xdg_shell_surface
0x71ea89e0c595
0x71ea89e0900d
ffi_call
0x71ea89e148af
0x71ea89e15138
wl_display_dispatch_queue_pending
wl_display_roundtrip_queue
/tmp/factorio-build-QueLkE/libraries/SDL2/src/video/SDL_video.c (1537): SDL_UpdateFullscreenMode
/tmp/factorio-build-QueLkE/libraries/SDL2/src/video/SDL_video.c (2641): SDL_SetWindowFullscreen
/tmp/factorio-build-QueLkE/src/Graphics/SDLWindow.cpp (746): SDLWindow::setFullscreen(bool)
/opt/gcc-13.2.0/include/c++/13.2.0/bits/std_function.h (591): std::function<void ()>::operator()() const
/tmp/factorio-build-QueLkE/src/Util/Signal.hpp (40): Signal<>::operator()()
/tmp/factorio-build-QueLkE/src/Info/ConfigItem.hpp (172): StorageConfigItem<bool>::setValue(bool)
/tmp/factorio-build-QueLkE/src/MainLoop.cpp (881): MainLoop::processEvent(Event const&, bool)
/tmp/factorio-build-QueLkE/src/MainLoop.cpp (761): MainLoop::processEvents(bool)
/tmp/factorio-build-QueLkE/src/MainLoop.cpp (603): MainLoop::prePrepare()
/tmp/factorio-build-QueLkE/src/MainLoop.cpp (682): MainLoop::mainLoopStep(WorkerThread&, MainLoop::HeavyMode)
/tmp/factorio-build-QueLkE/src/MainLoop.cpp (412): MainLoop::run(Filesystem::Path const&, Filesystem::Path const&, bool, bool, std::function<void ()>, Filesystem::Path const&, MainLoop::HeavyMode)
/tmp/factorio-build-QueLkE/src/Main.cpp (1325): fmain(int, char**)
/tmp/factorio-build-QueLkE/src/Main.cpp (1347): main
0x71ea89e49e07
__libc_start_main
_start
0xffffffffffffffff
Stack trace logging done
Re: [2.0.7] Crash on Linux Wayland after wake-up from suspend
Posted: Mon Oct 21, 2024 11:11 pm
by raiguard
Ah, I missed the fact that you're on nvidia.
Nvidia Wayland issues are very difficult to debug and vary wildly from machine to machine. I'm not sure that there is anything I can do.