Page 1 of 1

[SOLVED] [1.1.107] Crash on launch: SDL_Error: Couldn't create window

Posted: Sun Jun 09, 2024 8:37 pm
by benplumley
When I launch the game through Steam, the "Play" button cycles to "Launching" then back to "Play", and the game doesn't launch. When I launch the standalone executable:

Code: Select all

$ ./factorio
zsh: segmentation fault (core dumped)  ./factorio
This happens on every launch attempt. It's immediate:

Code: Select all

$ time ./factorio
zsh: segmentation fault (core dumped)  ./factorio
./factorio  0.01s user 0.01s system 14% cpu 0.120 total
I've reproduced it with Steam's latest stable 1.1.107, Steam's latest experimental 1.1.109, and the latest standalone stable 1.1.107. Versions later than 1.1.104 are also unable to create a log file - if I remove factorio-current.log, start the game, let it crash, then check if factorio-current.log exists:
  • With 1.1.105 and later (up to 1.1.109): factorio-current.log does not exist
  • With 1.1.104 and earlier: factorio-current.log exists
Log file, with 1.1.104:

Code: Select all

   0.000 2024-06-09 21:14:52; Factorio 1.1.104 (build 62119, linux64, steam)
   0.125 Operating system: Linux (ManjaroLinux 24.0.1)
   0.000 Initializing Steam API.
   0.125 Program arguments: "/home/ben/.local/share/Steam/steamapps/common/Factorio/bin/x64/factorio" 
   0.125 Config path: /home/ben/.factorio/config/config.ini
   0.125 Read data path: /home/ben/.local/share/Steam/steamapps/common/Factorio/data
   0.125 Write data path: /home/ben/.factorio [289717/942978MB]
   0.125 Binaries path: /home/ben/.local/share/Steam/steamapps/common/Factorio/bin
   0.134 System info: [CPU: 11th Gen Intel(R) Core(TM) i5-11300H @ 3.10GHz, 8 cores, RAM: 15738 MB]
   0.134 Environment: DISPLAY=:0 WAYLAND_DISPLAY=<unset> DESKTOP_SESSION=plasma XDG_SESSION_DESKTOP=KDE XDG_CURRENT_DESKTOP=KDE __GL_FSAA_MODE=<unset> __GL_LOG_MAX_ANISO=<unset> __GL_SYNC_TO_VBLANK=<unset> __GL_SORT_FBCONFIGS=<unset> __GL_YIELD=<unset>
   0.134 Display options: [FullScreen: 1] [VSync: 1] [UIScale: custom (100.0%)] [Native DPI: 1] [Screen: 255] [Special: lmw] [Lang: en]
   0.141 Video driver: x11
   0.141 Available displays: 1
   0.141  [0]: Q3279WG5B 33" - {[0,0], 2560x1440, SDL_PIXELFORMAT_RGB888, 75Hz}
   0.194 Error SDLWindow.cpp:210: Failed to create an application window. SDL_Error: Couldn't create window
   0.194 Error Util.cpp:86: Failed to create an application window. SDL_Error: Couldn't create window
   0.244 Error MessageDialog.cpp:218: Unable to show message dialog. SDL Error: [zenity reported error or failed to launch: 255]
   0.245 Steam API shutdown.
   0.248 Goodbye
A relevant detail is that the standalone 1.1.107 game launches fine when I run it with sudo.

Re: [1.1.107] Crash on launch: SDL_Error: Couldn't create window

Posted: Sun Jun 09, 2024 8:49 pm
by benplumley
I've reproduced this (on the same device) with both an Nvidia 1070Ti thunderbolt eGPU, and Intel integrated graphics. It doesn't seem GPU-related but it's not in the log file so I thought I'd mention it for completeness.

Re: [1.1.107] Crash on launch: SDL_Error: Couldn't create window

Posted: Tue Jun 11, 2024 6:51 pm
by benplumley
I've moved ~/.factorio away, and let it create a new one, to rule out any problems in there (disabled Steam cloud first so it didn't download anything old back into there).

Re: [1.1.107] Crash on launch: SDL_Error: Couldn't create window

Posted: Fri Jun 14, 2024 6:18 pm
by benplumley
Reinstalled Factorio in Steam, no change. Updated Manjaro to its latest release, no change except the version number in the log file:

Code: Select all

   0.000 2024-06-14 19:12:00; Factorio 1.1.104 (build 62119, linux64, steam)
   0.115 Operating system: Linux (ManjaroLinux 24.0.2)
   0.000 Initializing Steam API.
   0.115 Program arguments: "/home/ben/.local/share/Steam/steamapps/common/Factorio/bin/x64/factorio" 
   0.115 Config path: /home/ben/.factorio/config/config.ini
   0.115 Read data path: /home/ben/.local/share/Steam/steamapps/common/Factorio/data
   0.115 Write data path: /home/ben/.factorio [288910/942978MB]
   0.115 Binaries path: /home/ben/.local/share/Steam/steamapps/common/Factorio/bin
   0.121 System info: [CPU: 11th Gen Intel(R) Core(TM) i5-11300H @ 3.10GHz, 8 cores, RAM: 15738 MB]
   0.121 Environment: DISPLAY=:0 WAYLAND_DISPLAY=<unset> DESKTOP_SESSION=plasma XDG_SESSION_DESKTOP=KDE XDG_CURRENT_DESKTOP=KDE __GL_FSAA_MODE=<unset> __GL_LOG_MAX_ANISO=<unset> __GL_SYNC_TO_VBLANK=<unset> __GL_SORT_FBCONFIGS=<unset> __GL_YIELD=<unset>
   0.122 Display options: [FullScreen: 1] [VSync: 1] [UIScale: custom (100.0%)] [Native DPI: 1] [Screen: 255] [Special: lmw] [Lang: en]
   0.128 Video driver: x11
   0.128 Available displays: 1
   0.128  [0]: Q3279WG5B 33" - {[0,0], 2560x1440, SDL_PIXELFORMAT_RGB888, 75Hz}
   0.211 Error SDLWindow.cpp:210: Failed to create an application window. SDL_Error: Couldn't create window
   0.212 Error Util.cpp:86: Failed to create an application window. SDL_Error: Couldn't create window
   0.263 Error MessageDialog.cpp:218: Unable to show message dialog. SDL Error: [zenity reported error or failed to launch: 255]
   0.265 Steam API shutdown.
   0.267 Goodbye
Steam versions after 1.1.104 are also still unable to produce logs.

However, the standalone version does now launch without sudo and seems completely healthy. My next step might be to reinstall Steam.

Re: [1.1.107] Crash on launch: SDL_Error: Couldn't create window

Posted: Sat Jul 06, 2024 6:46 pm
by benplumley
I looked at this again today (now with 1.1.109), found this in the journal:

Code: Select all

Jul 06 19:33:40 roxide steam[3657]: chdir "/home/ben/.local/share/Steam/steamapps/common/Factorio"
Jul 06 19:33:40 roxide steam[3657]: ERROR: ld.so: object '/home/ben/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
Jul 06 19:33:40 roxide steam[3657]: ERROR: ld.so: object '/home/ben/.local/share/Steam/ubuntu12_64/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
Jul 06 19:33:40 roxide steam[3657]: ERROR: ld.so: object '/home/ben/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
Jul 06 19:33:40 roxide steam[3657]: ERROR: ld.so: object '/home/ben/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
Jul 06 19:33:40 roxide steam[3657]: Adding process 6656 for gameID 427520
Jul 06 19:33:40 roxide kernel: factorio[6657]: segfault at 0 ip 0000000001ee04c0 sp 00007ffc09ec52d8 error 6 in factorio[400000+2335000] likely on CPU 4 (core 0, socket 0)
Jul 06 19:33:40 roxide kernel: Code: 00 00 00 48 89 e6 e8 2f c5 52 fe 48 69 04 24 00 ca 9a 3b 48 03 44 24 08 48 83 c4 18 c3 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 <49> 89 10 b8 03 00 00 00 c3 0f 1f 80 00 00 00 00 31 c0 c3 66 66 66
Jul 06 19:33:40 roxide systemd-coredump[6658]: Process 6657 (factorio) of user 1000 terminated abnormally with signal 11/SEGV, processing...
Jul 06 19:33:40 roxide systemd[1]: Started Process Core Dump (PID 6658/UID 0).
Jul 06 19:33:40 roxide steam[3657]: Adding process 6657 for gameID 427520
Jul 06 19:33:40 roxide systemd-coredump[6660]: [🡕] Process 6657 (factorio) of user 1000 dumped core.
                                               
                                               Module /home/ben/.local/share/Steam/steamapps/common/Factorio/bin/x64/factorio without build-id.
                                               Stack trace of thread 6657:
                                               #0  0x0000000001ee04c0 n/a (/home/ben/.local/share/Steam/steamapps/common/Factorio/bin/x64/factorio + 0x1ae04c0)
                                               #1  0x00000000016708e4 n/a (/home/ben/.local/share/Steam/steamapps/common/Factorio/bin/x64/factorio + 0x12708e4)
                                               #2  0x0000000001647489 n/a (/home/ben/.local/share/Steam/steamapps/common/Factorio/bin/x64/factorio + 0x1247489)
                                               #3  0x0000000001610096 n/a (/home/ben/.local/share/Steam/steamapps/common/Factorio/bin/x64/factorio + 0x1210096)
                                               #4  0x00000000015918dc n/a (/home/ben/.local/share/Steam/steamapps/common/Factorio/bin/x64/factorio + 0x11918dc)
                                               #5  0x00000000016473a3 n/a (/home/ben/.local/share/Steam/steamapps/common/Factorio/bin/x64/factorio + 0x12473a3)
                                               #6  0x0000000001610096 n/a (/home/ben/.local/share/Steam/steamapps/common/Factorio/bin/x64/factorio + 0x1210096)
                                               #7  0x000000000161014b n/a (/home/ben/.local/share/Steam/steamapps/common/Factorio/bin/x64/factorio + 0x121014b)
                                               #8  0x000000000161014b n/a (/home/ben/.local/share/Steam/steamapps/common/Factorio/bin/x64/factorio + 0x121014b)
                                               #9  0x00000000015918dc n/a (/home/ben/.local/share/Steam/steamapps/common/Factorio/bin/x64/factorio + 0x11918dc)
                                               #10 0x0000000001b00c7f n/a (/home/ben/.local/share/Steam/steamapps/common/Factorio/bin/x64/factorio + 0x1700c7f)
                                               #11 0x0000000001b0bd91 n/a (/home/ben/.local/share/Steam/steamapps/common/Factorio/bin/x64/factorio + 0x170bd91)
                                               #12 0x0000000001a864de n/a (/home/ben/.local/share/Steam/steamapps/common/Factorio/bin/x64/factorio + 0x16864de)
                                               #13 0x0000000000664c7d n/a (/home/ben/.local/share/Steam/steamapps/common/Factorio/bin/x64/factorio + 0x264c7d)
                                               #14 0x0000000001f89c9d n/a (/home/ben/.local/share/Steam/steamapps/common/Factorio/bin/x64/factorio + 0x1b89c9d)
                                               ELF object binary architecture: AMD x86-64
Jul 06 19:33:40 roxide systemd[1]: systemd-coredump@2-6658-0.service: Deactivated successfully.
Solved by setting launch options:

Code: Select all

LD_PRELOAD=~/.steam/steam/steamapps/common/Factorio/lib/libsteam_api.so %command%