coelckers / prboom-plus

This is a cleaned up copy of the PrBoom+ SVN repository as a courtesy for those interested in forking that port
295 stars 117 forks source link

2.6.1um in Linux crashes on starting a demo or a game #425

Closed Mrhnhrm closed 2 years ago

Mrhnhrm commented 2 years ago

Hi, and thanks for taking a look.

Trying to run 2.6.1um in Linux here. If I try to start a new game, or wait for a demo to start, the whole thing segfaults. I have no config file in ~/.prboom-plus, so I assume that Prboom+ starts with default parameters. The console log:

$ prboom-plus -iwad DOOM.WAD
M_LoadDefaults: Load system defaults.
 default file: /home/mrhn/.prboom-plus/prboom-plus.cfg
 found /usr/share/prboom-plus-2.6.1/prboom-plus.wad

PrBoom-Plus v2.6.1um (https://github.com/coelckers/prboom-plus)
I_SetAffinityMask: manual affinity mask is 1
 found /home/mrhn/Games/doom/iwads/DOOM.WAD
IWAD found: /home/mrhn/Games/doom/iwads/DOOM.WAD
PrBoom-Plus (built Nov 15 2021 00:27:15), playing: The Ultimate DOOM
PrBoom-Plus is released under the GNU General Public license v2.0.
You are welcome to redistribute it under certain conditions.
It comes with ABSOLUTELY NO WARRANTY. See the file COPYING for details.
V_Init: allocate screens.
V_InitMode: using 8 bit video mode
I_CalculateRes: trying to optimize screen pitch
 test case for pitch=640 is processed 184342 times for 100 msec
 test case for pitch=672 is processed 186410 times for 100 msec
 optimized screen pitch is 672
I_InitScreenResolution: Using resolution 640x480
 found /usr/share/prboom-plus-2.6.1/prboom-plus.wad
D_InitNetGame: Checking for network game.
W_Init: Init WADfiles.
 adding /home/mrhn/Games/doom/iwads/DOOM.WAD
 adding /usr/share/prboom-plus-2.6.1/prboom-plus.wad
W_InitCache

M_Init: Init miscellaneous info.
SetRatio: width/height parameters 640x480
SetRatio: storage aspect ratio 4:3
SetRatio: assuming square pixels
SetRatio: display aspect ratio 4:3
SetRatio: gl_ratio 1.600000
SetRatio: multiplier 1/1
R_Init: Init DOOM refresh daemon - 
R_LoadTrigTables: Endianness...ok.
R_InitData: Textures Flats Sprites 
R_Init: R_InitPlanes R_InitLightTables R_InitSkyMap R_InitTranslationsTables R_InitPatches 
P_Init: Init Playloop state.
I_Init: Setting up machine state.
I_InitSound:  configured audio device with 2048 samples/slice
I_InitSound: sound module ready
S_Init: Setting up sound.
S_Init: default sfx volume 8
HU_Init: Setting up heads up display.
I_InitGraphics: 640x480
I_UpdateVideoMode: 0x20, SDL buffer, direct access
SetRatio: width/height parameters 640x480
SetRatio: storage aspect ratio 4:3
SetRatio: assuming square pixels
SetRatio: display aspect ratio 4:3
SetRatio: gl_ratio 1.600000
SetRatio: multiplier 1/1
ST_Init: Init status bar.
I_SignalHandler: Exiting on signal: Segmentation fault
Segmentation fault

Some command line parameters I tried (and that made no difference)

My system is 64-bit Gentoo Linux. Prboom+ is built locally using GCC 10.3.0 with the following USE flags:

Is there other hopefully useful information that I can provide?

fabiangreffrath commented 2 years ago

A backtrace would be nice. Load the game in gdb, e.g. gdb --args prboom-plus -iwad DOOM.WAD, and when it crashes type bt and post the results here.

Mrhnhrm commented 2 years ago

Okey-dokey, down below is the backtrace with every obsessive detail I could press out of it. The problem is related to sdl2-mixer. Interestingly enough, I could hear music in the game menu via sdl before the crash. When I reinstalled prboom+ without sdl2-mixer support, there is no crash and I finally could get to the options screen and set fluidsynth as the midi source directly. Two observations related to that:

I guess separate issue(s) should be filed for that?

The aforementioned backtrace:

#0  fluid_hashtable_lookup_node (hash_return=0x0, key=0x7fffffffcea0, hashtable=0x55555616d570)
    at /var/tmp/portage/media-sound/fluidsynth-2.2.3/work/fluidsynth-2.2.3/src/utils/fluid_hash.c:169
#1  fluid_hashtable_lookup (hashtable=hashtable@entry=0x55555616d570, key=0x7fffffffcea0)
    at /var/tmp/portage/media-sound/fluidsynth-2.2.3/work/fluidsynth-2.2.3/src/utils/fluid_hash.c:740
#2  0x00007ffff7cebf3c in fluid_settings_get (settings=settings@entry=0x55555616d570, 
    name=name@entry=0x7ffff7d2f2cc "synth.gain", value=value@entry=0x7fffffffcfe0)
    at /var/tmp/portage/media-sound/fluidsynth-2.2.3/work/fluidsynth-2.2.3/src/utils/fluid_settings.c:402
#3  0x00007ffff7cec931 in fluid_settings_callback_num (settings=0x55555616d570, 
    name=name@entry=0x7ffff7d2f2cc "synth.gain", callback=callback@entry=0x0, data=data@entry=0x0)
    at /var/tmp/portage/media-sound/fluidsynth-2.2.3/work/fluidsynth-2.2.3/src/utils/fluid_settings.c:746
#4  0x00007ffff7d00c60 in delete_fluid_synth (synth=0x5555562d4fc0)
    at /var/tmp/portage/media-sound/fluidsynth-2.2.3/work/fluidsynth-2.2.3/src/synth/fluid_synth.c:1033
#5  delete_fluid_synth (synth=0x5555562d4fc0)
    at /var/tmp/portage/media-sound/fluidsynth-2.2.3/work/fluidsynth-2.2.3/src/synth/fluid_synth.c:1019
#6  0x00007ffff7dfd423 in FLUIDSYNTH_Delete (context=0x5555561360c0)
    at /var/tmp/portage/media-libs/sdl2-mixer-2.0.4/work/SDL2_mixer-2.0.4/music_fluidsynth.c:278
#7  0x00007ffff7dfb97a in Mix_FreeMusic (music=0x555556511f50)
    at /var/tmp/portage/media-libs/sdl2-mixer-2.0.4/work/SDL2_mixer-2.0.4/music.c:647
#8  0x00005555556542d9 in I_UnRegisterSong (handle=0)
    at /var/tmp/portage/games-fps/prboom-plus-2.6.1/work/prboom-plus-2.6.1um/prboom2/src/SDL/i_sound.c:1026
#9  0x0000555555646105 in S_StopMusic ()
    at /var/tmp/portage/games-fps/prboom-plus-2.6.1/work/prboom-plus-2.6.1um/prboom2/src/s_sound.c:672
#10 S_StopMusic ()
    at /var/tmp/portage/games-fps/prboom-plus-2.6.1/work/prboom-plus-2.6.1um/prboom2/src/s_sound.c:660
#11 0x00005555556461c3 in S_ChangeMusic (musicnum=5, looping=1)
    at /var/tmp/portage/games-fps/prboom-plus-2.6.1/work/prboom-plus-2.6.1um/prboom2/src/s_sound.c:556
#12 0x00005555555e84a2 in P_SetupLevel (episode=1, map=5, playermask=playermask@entry=0, 
    skill=<optimized out>)
    at /var/tmp/portage/games-fps/prboom-plus-2.6.1/work/prboom-plus-2.6.1um/prboom2/src/p_setup.c:2628
#13 0x00005555555b7815 in G_DoLoadLevel ()
    at /var/tmp/portage/games-fps/prboom-plus-2.6.1/work/prboom-plus-2.6.1um/prboom2/src/g_game.c:903
#14 0x00005555555b92d2 in G_InitNew (skill=skill@entry=sk_hard, episode=<optimized out>, episode@entry=1, 
--Type <RET> for more, q to quit, c to continue without paging--c
    map=<optimized out>, map@entry=5) at /var/tmp/portage/games-fps/prboom-plus-2.6.1/work/prboom-plus-2.6.1um/prboom2/src/g_game.c:2984
#15 0x00005555555ba6cf in G_ReadDemoHeaderEx (demo_p=0x7fff9742fbb9 <incomplete sequence \330>, size=6854, params=params@entry=1) at /var/tmp/portage/games-fps/prboom-plus-2.6.1/work/prboom-plus-2.6.1um/prboom2/src/g_game.c:4176
#16 0x00005555555bae21 in G_DoPlayDemo () at /var/tmp/portage/games-fps/prboom-plus-2.6.1/work/prboom-plus-2.6.1um/prboom2/src/g_game.c:4226
#17 G_DoPlayDemo () at /var/tmp/portage/games-fps/prboom-plus-2.6.1/work/prboom-plus-2.6.1um/prboom2/src/g_game.c:4222
#18 0x00005555555bc6c5 in G_Ticker () at /var/tmp/portage/games-fps/prboom-plus-2.6.1/work/prboom-plus-2.6.1um/prboom2/src/g_game.c:1133
#19 0x0000555555650f1f in TryRunTics () at /var/tmp/portage/games-fps/prboom-plus-2.6.1/work/prboom-plus-2.6.1um/prboom2/src/d_client.c:527
#20 0x00005555555b05c5 in D_DoomLoop () at /var/tmp/portage/games-fps/prboom-plus-2.6.1/work/prboom-plus-2.6.1um/prboom2/src/d_main.c:485
#21 D_DoomMain () at /var/tmp/portage/games-fps/prboom-plus-2.6.1/work/prboom-plus-2.6.1um/prboom2/src/d_main.c:2259
#22 0x00005555555a3c23 in main (argc=<optimized out>, argv=0x7fffffffd748) at /var/tmp/portage/games-fps/prboom-plus-2.6.1/work/prboom-plus-2.6.1um/prboom2/src/SDL/i_main.c:607
fabiangreffrath commented 2 years ago

Seems to be this one: https://www.fluidsynth.org/news/2021/01/23/sdl2-mixer-bug/

Please ask the Gentoo SDL maintainers to patch their SDL2_Mixer package.

Mrhnhrm commented 2 years ago

Actually, there already is a revised version in which the only change is this exact patch. But it won't install by default because it is not marked as stable in the repository (the irony is so sharp that I now need some disinfectant... preferably strong alcohol).

All right then, after installing the patched sdl2-mixer, everything is working. Thanks for the help.