[1.1.74] Crash on program shutdown with SDL audio backend

This subforum contains all the issues which we already resolved.
next_ghost
Manual Inserter
Manual Inserter
Posts: 3
Joined: Thu Dec 29, 2022 4:01 pm
Contact:

[1.1.74] Crash on program shutdown with SDL audio backend

Post by next_ghost »

Factorio 1.1.x (including 1.1.74) crashes on my Gentoo Linux system when I exit the program and the audio backend is set to default, sdl or allegro-via-sdl. Setting audio backend to allegro works correctly.

The problem seems to be that SDL tries to use PulseAudio. However, I do not have actual PulseAudio installed. I have only apulse, a thin PulseAudio-like API wrapper around plain ALSA because it's needed by Firefox.

Code: Select all

   0.000 2022-12-29 17:35:58; Factorio 1.1.74 (build 60256, linux64, full)
   0.016 Operating system: Linux (Gentoo 2.9)
   0.016 Program arguments: "./bin/x64/factorio" 
   0.016 Config path: *redacted*
   0.016 Read data path: *redacted*
   0.016 Write data path: *redacted*
   0.016 Binaries path: *redacted*
   0.042 System info: [CPU: AMD Ryzen 5 4500U with Radeon Graphics, 6 cores, RAM: 7346 MB]
   0.042 Environment: DISPLAY=:0 WAYLAND_DISPLAY=<unset> DESKTOP_SESSION=/usr/share/xsessions/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.042 Display options: [FullScreen: 1] [VSync: 0] [UIScale: automatic (100.0%)] [Native DPI: 1] [Screen: 255] [Special: lmw] [Lang: en]
   0.096 Available displays: 1
   0.096  [0]: 0 - {[0,0], 1920x1080, SDL_PIXELFORMAT_RGB888, 60Hz}
   0.700 Initialised OpenGL:[0] AMD Radeon Graphics (renoir, LLVM 15.0.6, DRM 3.47, 5.19.11-gentoo); driver: 4.6 (Core Profile) Mesa 22.3.1
   0.700   [Extensions] s3tc:yes; KHR_debug:yes; ARB_clear_texture:yes, ARB_copy_image:yes
   0.700   [Version] 4.6
   0.701 Graphics settings preset: medium-with-low-vram
   0.701   Dedicated video memory size 512 MB
   0.854 Graphics options: [Graphics quality: normal] [Video memory usage: high] [DXT: high-quality] [Color: 32bit]
   0.855                   [Max threads (load/render): 32/6] [Max texture size: 4096] [Tex.Stream.: 1] [Rotation quality: low] [Other: sTDCWT] [B:0,C:0,S:100]
   1.038 [Audio] Backend:SDL(default); Driver:pulseaudio, Device:Default device, Depth:16, Channels:2, Frequency:44100
   1.386 Loading mod core 0.0.0 (data.lua)
   1.446 Loading mod base 1.1.74 (data.lua)
   1.615 Loading mod base 1.1.74 (data-updates.lua)
   1.706 Checksum for core: 870127790
   1.706 Checksum of base: 4211423066
   2.106 Prototype list checksum: 3034860339
   2.158 Loading sounds...
   2.184 Info PlayerData.cpp:71: Local player-data.json available, timestamp 1672329410
   2.184 Info PlayerData.cpp:78: Cloud player-data.json unavailable
   2.562 Crop bitmaps.
  49.277 Parallel Sprite Loader initialized (threads: 4)
  52.336 Initial atlas bitmap size is 4096
  52.346 Created atlas bitmap 4096x4088 [none]
  52.351 Created atlas bitmap 4096x4096 [none]
  52.354 Created atlas bitmap 4096x4096 [none]
  52.357 Created atlas bitmap 4096x4084 [none]
  52.361 Created atlas bitmap 4096x4096 [none]
  52.368 Created atlas bitmap 4096x4096 [none]
  52.368 Created atlas bitmap 4096x512 [none]
  52.370 Created atlas bitmap 4096x2120 [decal]
  52.390 Created atlas bitmap 4096x4096 [low-object, linear-minification]
  52.397 Created atlas bitmap 4096x1792 [low-object]
  52.407 Created atlas bitmap 4096x2464 [mipmap, linear-minification, linear-magnification, linear-mip-level]
  52.425 Created atlas bitmap 4096x4080 [terrain, mipmap, linear-minification, linear-mip-level]
  52.434 Created atlas bitmap 4096x3472 [terrain, mipmap, linear-minification, linear-mip-level]
  52.438 Created atlas bitmap 4096x1632 [terrain-effect-map, mipmap, linear-minification, linear-mip-level]
  52.446 Created atlas bitmap 4096x1664 [smoke, mipmap, linear-minification, linear-magnification]
  52.449 Created atlas bitmap 4096x928 [mipmap]
  52.496 Created atlas bitmap 4096x4064 [icon, not-compressed, mipmap, linear-minification, linear-magnification, linear-mip-level]
  52.503 Created atlas bitmap 4096x368 [icon, not-compressed, mipmap, linear-minification, linear-magnification]
  52.504 Created atlas bitmap 4096x828 [alpha-mask]
  52.516 Created atlas bitmap 4096x4084 [shadow, linear-magnification, alpha-mask]
  52.524 Created atlas bitmap 4096x4096 [shadow, linear-magnification, alpha-mask]
  52.531 Created atlas bitmap 4096x4096 [shadow, linear-magnification, alpha-mask]
  52.534 Created atlas bitmap 4096x3124 [shadow, linear-magnification, alpha-mask]
  52.537 Created atlas bitmap 4096x1312 [shadow, mipmap, linear-magnification, alpha-mask]
  52.539 Created atlas bitmap 2048x240 [icon-background, not-compressed, mipmap, linear-minification, linear-magnification, linear-mip-level, ]
  52.556 Created virtual atlas pages 4096x4096x2
  52.587 Texture processor created (2048). GPU accelerated compression Supported: yes, Enabled: yes/yes. Test passed. YCoCgDXT PSNR: 35.83, BC3 PSNR: 33.82
  82.389 Parallel Sprite Loader initialized (threads: 4)
  85.794 Sprites loaded
  85.817 Generated mipmaps (3) for atlas [8] of size 4096x4096   
  85.824 Generated mipmaps (3) for atlas [9] of size 4096x1792   
  85.834 Generated mipmaps (3) for atlas [10] of size 4096x2464   
  85.846 Generated mipmaps (3) for atlas [11] of size 4096x4080   
  85.854 Generated mipmaps (3) for atlas [12] of size 4096x3472   
  85.859 Generated mipmaps (3) for atlas [13] of size 4096x1632   
  85.864 Generated mipmaps (3) for atlas [14] of size 4096x1664   
  85.888 Generated mipmaps (3) for atlas [15] of size 4096x928   
  85.901 Generated mipmaps (5) for atlas [16] of size 4096x4064   
  85.903 Generated mipmaps (5) for atlas [17] of size 4096x368   
  85.907 Generated mipmaps (3) for atlas [23] of size 4096x1312   
  85.918 Custom mipmaps uploaded.
  85.972 Generated mipmaps for virtual atlas of size 4096x8192
  86.423 Factorio initialised
 125.407 Quitting: user-quit.
 125.548 Error CrashHandler.cpp:635: Received SIGSEGV
Factorio crashed. Generating symbolized stacktrace, please wait ...
/tmp/factorio-build-TRMZ2q/src/Util/Logger.cpp (313): Logger::writeStacktrace(FileWriteStream*, StackTraceInfo*)
/tmp/factorio-build-TRMZ2q/src/Util/Logger.cpp (322): Logger::logStacktrace(StackTraceInfo*)
/tmp/factorio-build-TRMZ2q/src/Util/CrashHandler.cpp (184): CrashHandler::writeStackTrace(CrashHandler::CrashReason)
/tmp/factorio-build-TRMZ2q/src/Util/CrashHandler.cpp (636): CrashHandler::commonSignalHandler(int)
/tmp/factorio-build-TRMZ2q/src/Util/CrashHandler.cpp (642): CrashHandler::SignalHandler(int)
0x7ff5cf162f5f
pa_mainloop_run
/tmp/factorio-build-TRMZ2q/libraries/SDL2/src/audio/pulseaudio/SDL_pulseaudio.c (801): HotplugThread
/tmp/factorio-build-TRMZ2q/libraries/SDL2/src/thread/SDL_thread.c (275): SDL_RunThread
/tmp/factorio-build-TRMZ2q/libraries/SDL2/src/thread/pthread/SDL_systhread.c (77): RunThread
/var/tmp/portage/sys-libs/glibc-2.36-r6/work/glibc-2.36/nptl/pthread_create.c (442): start_thread
../sysdeps/unix/sysv/linux/x86_64/clone3.S (81): clone3
0xffffffffffffffff
Stack trace logging done
 129.719 Error Util.cpp:97: Unexpected error occurred. If you're running the latest version of the game you can help us solve the problem by posting the contents of the log file on the Factorio forums.
Please also include the save file(s), any mods you may be using, and any steps you know of to reproduce the crash.
next_ghost
Manual Inserter
Manual Inserter
Posts: 3
Joined: Thu Dec 29, 2022 4:01 pm
Contact:

Re: [1.1.74] Crash on program shutdown with SDL audio backend

Post by next_ghost »

Loewchen wrote: Thu Dec 29, 2022 6:10 pm Ref.: 102982
This is likely a separate issue from 102982. Audio plays correctly under the sdl backend and the game does not freeze at any point. The only issue is the segfault on exit which opens an error window. Running the game with allegro-via-sdl backend results in audio initialization failure, no sound, and the same segfault on exit. I do not have any pipewire packages installed.
Donion
Factorio Staff
Factorio Staff
Posts: 326
Joined: Sun Aug 22, 2021 9:18 am
Contact:

Re: [1.1.74] Crash on program shutdown with SDL audio backend

Post by Donion »

Hello,
Would using SDL's ALSA driver be an option for you? You should be able to force it by setting the environment variable

Code: Select all

SDL_AUDIODRIVER=alsa
next_ghost
Manual Inserter
Manual Inserter
Posts: 3
Joined: Thu Dec 29, 2022 4:01 pm
Contact:

Re: [1.1.74] Crash on program shutdown with SDL audio backend

Post by next_ghost »

Donion wrote: Fri Dec 30, 2022 5:00 pm Hello,
Would using SDL's ALSA driver be an option for you? You should be able to force it by setting the environment variable

Code: Select all

SDL_AUDIODRIVER=alsa
Yes, SDL_AUDIODRIVER=alsa fixes the issue with sdl backend. allegro-via-sdl still fails to initialize but doesn't crash on shutdown anymore.
Donion
Factorio Staff
Factorio Staff
Posts: 326
Joined: Sun Aug 22, 2021 9:18 am
Contact:

Re: [1.1.74] Crash on program shutdown with SDL audio backend

Post by Donion »

Ok, good, I consider this resolved then. I will keep in mind the apulse usecase and try to check it the next time we're updating SDL.
Post Reply

Return to “Resolved Problems and Bugs”