We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1360 - fluidsynth backend segfaults sdl-mixer
Summary: fluidsynth backend segfaults sdl-mixer
Status: RESOLVED FIXED
Alias: None
Product: SDL_mixer
Classification: Unclassified
Component: misc (show other bugs)
Version: unspecified
Hardware: x86 Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-03 14:14 UTC by Rafał Mużyło
Modified: 2012-01-03 22:43 UTC (History)
0 users

See Also:


Attachments
a diff with the change (552 bytes, patch)
2012-01-03 14:14 UTC, Rafał Mużyło
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rafał Mużyło 2012-01-03 14:14:05 UTC
Created attachment 761 [details]
a diff with the change

First, a usual rant:
I tend to dislike registering to a forum/bugzilla/etc. for a sake of a single bug.
Also, "CC me on replies" wasn't in the mail by mistake.
/rant

Now, lets get on topic.

As I said in my mail, I've pulled a long list of fixes from the mercurial, up to http://hg.libsdl.org/SDL_mixer/rev/675a11e697c6 (I've skipped a few that were not needed by me (and plain ignored the next commit - call me a purist, but...)).
While I was mostly interested in modplug backed, I've decided to test fluidsynth backend too.

I've used playmus in the tests.
Upon setting SDL_SOUNDFONTS, playmus segfaulted.
A bit of testing and debugging led to following conclusion:
> adding 'Mix_InitFluidSynth();' in fluidsynth_loadsong_common at the
> start of 'if (SDL_BuildAudioCVT...' block fixes the crash
cause the crash was due to fluidsynth.new_fluid_settings==NULL at this point.
It seems that 
if ( fluidsynth.loaded == 0 ) Mix_InitFluidSynth();
at that point might even be a proper fix for this bug.

I'm unsure (as I haven't tested it), but it may matter that I've configured with '--disable-music-fluidsynth-shared', so the lib gets linked, instead of being dlopen.

I hope that the planned release will happen soon, it's been quite awhile since the last one.
Comment 1 Sam Lantinga 2012-01-03 22:43:37 UTC
/agreerant
Sorry, I missed the section of your e-mail where you asked to be CC'd.  I try to honor that, since I know it's a pain to join a mailing list or create accounts just to submit a bug.

Anyway, nice catch, thanks!
I commited a fix here:
http://hg.libsdl.org/SDL_mixer/rev/32e5ed415a34

You may want to get the other fixes I've done this year, since there are some good ones in there.

Cheers!