Linking against SDL_sound and SDL_mixer crashes Mix_CloseAudio()

When linking against SDL_sound and SDL_mixer at the same time, even when
not using anything from SDL_sound (nothing at all, just liking against
it), will result in a segmentation fault when calling Mix_CloseAudio().

Is this a known issue? Any workarounds?

I’m on Linux with ALSA (no PulseAudio or anything.) SDL 1.2.14,
SDL_mixer 1.2.11, SDL_sound 1.0.3.

I found out that this happens only when SDL_sound has been configured
and built with “–enable-midi”. Which is how it’s configured in all
Linux distros I think :-/

Will I have to bundle SDL_sound or could there be some hacky macro
trickery to fix this?On 10/01/2010 11:17 AM, Nikos Chantziaras wrote:

When linking against SDL_sound and SDL_mixer at the same time, even when
not using anything from SDL_sound (nothing at all, just liking against
it), will result in a segmentation fault when calling Mix_CloseAudio().

Is this a known issue? Any workarounds?

I’m on Linux with ALSA (no PulseAudio or anything.) SDL 1.2.14,
SDL_mixer 1.2.11, SDL_sound 1.0.3.

I found out that this happens only when SDL_sound has been configured and
built with “–enable-midi”. Which is how it’s configured in all Linux
distros I think :-/

Will I have to bundle SDL_sound or could there be some hacky macro trickery
to fix this?

Not that I can offer an immediate solution to the problem, can ya post a
small source file that replicates the bug ? I’m kinda curious myself …

-WillOn Fri, Oct 1, 2010 at 9:36 PM, Nikos Chantziaras wrote:

I found out that this happens only when SDL_sound has been
configured and built with "--enable-midi".  Which is how it's
configured in all Linux distros I think :-/

Will I have to bundle SDL_sound or could there be some hacky macro
trickery to fix this?

Not that I can offer an immediate solution to the problem, can ya post a
small source file that replicates the bug ? I’m kinda curious myself …

Even a simple example source that simply calls all *_Init() function and
then and all *_Quit() ones does it.

However, I found the cause purely by accident. If “-lSDL_sound” appears
before “-lSDL_mixer” in the link flags, then Mix_CloseAudio() segfaults.
Putting “-lSDL_sound” after “-lSDL_mixer” fixes it. Meaning I had
to move the output of “pkg-config --libs SDL_mixer” before “-lSDL_sound”
(SDL_sound lacks a pkg-config file.)

At least I’m glad I found the cause. I’ve been pulling my hair out for
several hours :-/On 10/02/2010 06:01 AM, Will Langford wrote:

On Fri, Oct 1, 2010 at 9:36 PM, Nikos Chantziaras <realnc at arcor.de <mailto:realnc at arcor.de>> wrote: