SDL_Mixer crash in Timidity

We have a problem with SDL_mixer-1.2.7-1. It crashes all the time when
we close and reopen audio.

To reproduce, take the demo package here:
http://jcatki.no-ip.org/SDL_mixer/

And replace the LEFT key binding to look like this:

case SDLK_LEFT:
Mix_HaltMusic();
Mix_HaltChannel(-1);
Mix_CloseAudio();
Mix_OpenAudio(44100,MIX_DEFAULT_FORMAT,2,audio_buffers);
//Mix_RewindMusic();
break;

Here is the 100% reproductible crash.

0xb7dec203 in open_file () from /usr/lib/libSDL_mixer-1.2.so.0
(gdb) bt
#0 0xb7dec203 in open_file () from /usr/lib/libSDL_mixer-1.2.so.0
#1 0xb7df6dde in Timidity_Error () from /usr/lib/libSDL_mixer-1.2.so.0
#2 0xb7df79e4 in Timidity_Init () from /usr/lib/libSDL_mixer-1.2.so.0
#3 0xb7dd24b6 in open_music () from /usr/lib/libSDL_mixer-1.2.so.0
#4 0xb7dd11a7 in Mix_OpenAudio () from /usr/lib/libSDL_mixer-1.2.so.0
#5 0x0804924a in main (argc=Cannot access memory at address 0xffffffff
) at sdlwav.c:163

Attached is patch.

User on which their distro did not compiled in the timidity support
don’t see the problem. That make it very hard to support because some
user see the problem, some don’t. In the GCompris case, I don’t see a
workaround. Do you plan to make a new release?–
Bruno Coudoin
http://gcompris.net Free educational software for kids
http://ofset.org Free educational software for all
http://toulibre.org Logiciel Libre ? Toulouse
-------------- next part --------------
A non-text attachment was scrubbed…
Name: sdl_mixer_timidity.patch
Type: text/x-patch
Size: 576 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20061121/c2e3fda0/attachment.bin

Hello Bruno,

Tuesday, November 21, 2006, 1:08:42 AM, you wrote:

We have a problem with SDL_mixer-1.2.7-1. It crashes all the time when
we close and reopen audio.

To reproduce, take the demo package here:
http://jcatki.no-ip.org/SDL_mixer/

And replace the LEFT key binding to look like this:

case SDLK_LEFT:
Mix_HaltMusic();
Mix_HaltChannel(-1);
Mix_CloseAudio();
Mix_OpenAudio(44100,MIX_DEFAULT_FORMAT,2,audio_buffers);
//Mix_RewindMusic();
break;

Here is the 100% reproductible crash.

0xb7dec203 in open_file () from /usr/lib/libSDL_mixer-1.2.so.0
(gdb) bt
#0 0xb7dec203 in open_file () from /usr/lib/libSDL_mixer-1.2.so.0
#1 0xb7df6dde in Timidity_Error () from /usr/lib/libSDL_mixer-1.2.so.0
#2 0xb7df79e4 in Timidity_Init () from /usr/lib/libSDL_mixer-1.2.so.0
#3 0xb7dd24b6 in open_music () from /usr/lib/libSDL_mixer-1.2.so.0
#4 0xb7dd11a7 in Mix_OpenAudio () from /usr/lib/libSDL_mixer-1.2.so.0
#5 0x0804924a in main (argc=Cannot access memory at address 0xffffffff
) at sdlwav.c:163

I’ve had this crash happen on first-open - or rather, people playing
my Runesoft linux game ports have. Another issue (might be fixed by
now) was SDL_mixer.so causing a file called “music.raw” to be created
in the same place as the executable. If the user didn’t have
permission to write there, SDL_mixer would crash with a floating point
exception.–
Best regards,
Peter mailto:@Peter_Mulholland

Le mardi 21 novembre 2006 ? 01:38 +0000, Peter Mulholland a ?crit :

Hello Bruno,

I’ve had this crash happen on first-open - or rather, people playing
my Runesoft linux game ports have.

My fix won’t work on first open. In fact, It just resets to first time
condition on re-open.

Another issue (might be fixed by
now) was SDL_mixer.so causing a file called “music.raw” to be created
in the same place as the executable. If the user didn’t have
permission to write there, SDL_mixer would crash with a floating point
exception.

I saw this problem but it don’t happen anymore it’s probably fixed.–
Bruno Coudoin
http://gcompris.net Free educational software for kids
http://ofset.org Free educational software for all
http://toulibre.org Logiciel Libre ? Toulouse