SDL_mixer crash when loading OGG

Continuing from my previous thread about my game crashing due to SDL_mixer when
loading music…

I changed my code to only use OGGs instead of MIDIs, and also to Mix_HaltMusic()
before freeing it to make sure that wasn’t the issue. I’ve now experienced these
crashes myself, so it’s not just bug reports from players anymore.

Here’s a screenshot of the error/crash message:
http://www.postimage.org/image.php?v=aVd3UJJ

Here’s the relevant code:

PROCEDURE PlayMidi(Const MusicFile : PChar);
BEGIN
IF MusicSetting > 0 THEN BEGIN
Mix_HaltMusic();
IF NOT MusicFreed THEN Mix_FreeMusic(MusicNumber);
MusicNumber := Mix_LoadMUS(MusicFile);
MusicFreed := False;
Mix_PlayMusic(MusicNumber, 1); <— This is line 24
END;
END;

The procedure is called like so:

PlayMidi(‘music/flyingb.ogg’)

The error message makes it clear to me that the game does indeed crash within
the code of SDL_mixer, as the last line from my own game code is line 24 of
PlayMidi (indicated in the code snippet above).

What version/build of SDL are you using? What language? What compiler?

I’m not familiar with the language you’re using, or its SDL
interfaces, but if you can, can you get the debugger symbols for the
SDL DLL you’re using? Or compile your own with debugger symbols? This
will fill in those six blank entries in the call stack.

Come to think of it, it’s a little weird that the debugger you’re
using can tell you what line of your source code it is in, but it
cannot tell you the name of the function $6170B697 given that it is in
the source code, and that your linker must be referencing it by name
somewhere. Perhaps, however, your debugger simply will not cooperate
with you in this capacity.On Sun, Apr 26, 2009 at 5:49 AM, Christian Knudsen wrote:

Continuing from my previous thread about my game crashing due to SDL_mixer when
loading music…

I changed my code to only use OGGs instead of MIDIs, and also to Mix_HaltMusic()
before freeing it to make sure that wasn’t the issue. I’ve now experienced these
crashes myself, so it’s not just bug reports from players anymore.

Here’s a screenshot of the error/crash message:
http://www.postimage.org/image.php?v=aVd3UJJ

Here’s the relevant code:

PROCEDURE PlayMidi(Const MusicFile : PChar);
BEGIN
? IF MusicSetting > 0 THEN BEGIN
? ? ?Mix_HaltMusic();
? ? ?IF NOT MusicFreed THEN Mix_FreeMusic(MusicNumber);
? ? ?MusicNumber := Mix_LoadMUS(MusicFile);
? ? ?MusicFreed := False;
? ? ?Mix_PlayMusic(MusicNumber, 1); ? ? ? ? ? <— This is line 24
? END;
END;

The procedure is called like so:

PlayMidi(‘music/flyingb.ogg’)

The error message makes it clear to me that the game does indeed crash within
the code of SDL_mixer, as the last line from my own game code is line 24 of
PlayMidi (indicated in the code snippet above).


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


http://codebad.com/

What version/build of SDL are you using? What language? What compiler?

I’m not familiar with the language you’re using, or its SDL
interfaces, but if you can, can you get the debugger symbols for the
SDL DLL you’re using? Or compile your own with debugger symbols? This
will fill in those six blank entries in the call stack.

The language is Object Pascal, and he said in a previous post that he’s using
the FPC compiler. That means that he’s using SDL 1.2, since the Object
Pascal bindings for SDL are provided through the JEDI-SDL project, and
the header files for 1.3 haven’t been finished yet (that I’m aware of).

Come to think of it, it’s a little weird that the debugger you’re
using can tell you what line of your source code it is in, but it
cannot tell you the name of the function $6170B697 given that it is in
the source code, and that your linker must be referencing it by name
somewhere. Perhaps, however, your debugger simply will not cooperate
with you in this capacity.

Not really. He’s calling from FPC into some reference in the DLL, through
the DLL’s external interface. The DLL then calls something internal in
SDL, and suddenly the Free Pascal debugger gets completely lost. Best
way to trace something like that is to compile SDL under Visual Studio and
set a breakpoint in its debugger. (This precludes attaching the FPC
debugger to the process, though)>From: Donny Viszneki <donny.viszneki at gmail.com>

Subject: Re: [SDL] SDL_mixer crash when loading OGG