Xenoveritas/abuse

SDL_mixer 2.0 with FluidSynth support causes game to segfault on start

Closed this issue · 5 comments

chewi commented

With FluidSynth support enabled in SDL_mixer, the game segfaults when you actually start the game. Strangely the intro music does play though. The game runs if I give -nosound but says:

Sound: ERROR - Unrecognized audio format while loading /usr/share/games/abuse/music/abuse00.hmi

I'm not sure if that's a clue. I'm surprised it mentions the file at all when -nosound is given.

You won't hit this if FluidSynth can't find any soundfonts. If it does, you can work around the issue by setting SDL_SOUNDFONTS to the empty string, forcing SDL_mixer to fall back to Timidity, assuming support for that is enabled.

This may be a bug in SDL_mixer but I'm not sure yet. I'm especially curious because I wrote SDL_mixer's FluidSynth support! This could affect a lot of users as I know Debian enables FluidSynth.

chewi commented

I tried replacing abuse00.hmi with intro.hmi and it still crashes. I then deleted intro.hmi and the game starts. I therefore think this is to do with playing more than one file, rather than a bad file or a bad conversion.

chewi commented

I got a backtrace through gdb but I've noticed that CorsixTH segfaults in the same way when you quit the game. I wonder if it happens when you call Mix_FreeMusic before stopping the music. I would have noticed this before though so perhaps something changed in FluidSynth.

chewi commented

Got it! It was FluidSynth/fluidsynth@57f40ea. Reverting this against master makes it work. I'll follow this up with FluidSynth.

chewi commented

Aha, it was already fixed in SDL_mixer but no release since. I've now added a patch to Gentoo's package.