Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suspected buffer overrun in soundfont loader #431

Closed
derselbst opened this issue Sep 18, 2018 · 2 comments
Closed

Suspected buffer overrun in soundfont loader #431

derselbst opened this issue Sep 18, 2018 · 2 comments

Comments

@derselbst
Copy link
Member

FluidSynth version

2.0.0

Current behavior

Starting fluidsynth with the jack audio driver while loading a sf3 results in a segfault. Also reproducible with a sf2 and dynamic-sample-loading activated.

Steps to reproduce

fluidsynth FluidR3Mono_GM.sf3 -a jack -m jack -l

Other information

git bisect says a985c68 is to blame.

gdb output:

Thread 3 "fluidsynth" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffe6a06700 (LWP 19411)]
0x00007ffff5da4222 in Jack::JackLinuxFutex::Connect (this=0x855050, name=name@entry=0x7fffe6a05b54 "system", server_name=server_name@entry=0xa44a40 "default") at ../linux/JackLinuxFutex.cpp:192
192         if (! fPrivate && fFutex->wasInternal)
(gdb) print fFutex
$1 = (Jack::JackLinuxFutex::FutexData *) 0xffffffffffffffff
@derselbst derselbst added the bug label Sep 18, 2018
@derselbst
Copy link
Member Author

Nevermind, that's a bug in jackd: jackaudio/jack2@cc8576a

@mawe42
Copy link
Member

mawe42 commented Sep 18, 2018

Well spotted, thanks! And it seems like the reason why the dynamic-sample-loading triggers this bug is because we allocate smaller chunks of memory. When a sample is below the default memlock limit, that lock succeeds in Fluidsynth but leaves jack with no more room for its fairly small mmap(MAP_LOCKED) calls that trigger the bug.

When starting fluidsynth with synth.lock-memory=0, the crash disappears. This also explains the behaviour in #416 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants