-
Notifications
You must be signed in to change notification settings - Fork 246
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
RunTime Error: "Create Jack audio port. Failed to create the audio driver. free(): double free detected in tcache 2. #613
Comments
Could you please provide a stack trace? Ideally by compiling fluidsynth with
(requires UndefinedBehaviorSanitizer and AddressSanitizer to be installed). |
When running the new binary I get:
|
Note: I installed the libubsan0 & libasan4 packages. |
OK! Got it!
|
Great, thanks for the log, that's very helpful! The following happens: For some reason, fluidsynth is unable to open an audio port at your jack server (i.e. Anyway, the audio driver handles this case by cleaning up the jack client. Unfortunately, this jack client is also being used by the jack midi driver which has been created earlier as well. And when that midi driver frees its resources, it wants to free the client again. This is not trivial to fix. I need some time to think about this. @jofemodo Pls, could you confirm that you have absolutely no issues with 2.0.9? So it processes all MIDI events and produces sound without any issues? |
Yes, AFAIK, It works perfectly fine with 2.0.9 Thanks! |
@jofemodo I've just pushed a fix to master. It fixes the double free for me locally. Feel free to test. Not sure why 2.1.0 is unable to connect to the port(s) though. Our jack driver hasn't really changed. And Jack should at least print an error. You could try to start fluidsynth without the |
@jofemodo Any news on this? |
I'm considering this to be fixed by 5070fe8. Thanks for the report. |
Hi @derselbst ! Sorry for the radio silence ... finally i got some time for checking the latest versions of fluidsynth, but the error is still there on 2.1.0, and also on 2.1.3. Same error. So we keep running 2.0.9 on zynthian... Thanks! |
There was a NULL dereference. I fixed it. Pls try again. If it crashes, pls provide me the same detailed log as above. As I still have no clue, why fluidsynth is unable to create a jack port, you might try starting If you don't have time to test it, just let me know, as I'm planning to release 2.1.4 soon. |
It still fails:
Compiled with asan, but not address error dumped. Regards, |
Thank you for testing. Good to see that it doesn't crash anymore. Unfortunately, I have no clue why fluidsynth fails to create the audio port. I would expect jack to write an error message, when a call to $ git diff v2.0.9 v2.1.0
diff --git a/src/drivers/fluid_jack.c b/src/drivers/fluid_jack.c
index 60503e2f..31706ae8 100644
--- a/src/drivers/fluid_jack.c
+++ b/src/drivers/fluid_jack.c
@@ -263,7 +263,7 @@ new_fluid_jack_client(fluid_settings_t *settings, int isaudio, void *driver)
}
/* tell the lash server our client name */
-#ifdef LASH_ENABLED
+#ifdef HAVE_LASH
{
int enable_lash = 0;
fluid_settings_getint(settings, "lash.enable", &enable_lash);
@@ -273,7 +273,7 @@ new_fluid_jack_client(fluid_settings_t *settings, int isaudio, void *driver)
fluid_lash_jack_client_name(fluid_lash_client, name);
}
}
-#endif /* LASH_ENABLED */
+#endif /* HAVE_LASH */
client_ref->server = server; /* !! takes over allocation */
server = NULL; /* Set to NULL so it doesn't get freed below */
@@ -328,7 +328,7 @@ fluid_jack_client_register_ports(void *driver, int isaudio, jack_client_t *clien
char name[64];
int multi;
int i;
- int jack_srate;
+ unsigned long jack_srate;
double sample_rate;
if(!isaudio)
@@ -491,10 +491,10 @@ fluid_jack_client_register_ports(void *driver, int isaudio, jack_client_t *clien
fluid_settings_getnum(settings, "synth.sample-rate", &sample_rate);
- if((int)sample_rate != jack_srate)
+ if((unsigned long)sample_rate != jack_srate)
{
FLUID_LOG(FLUID_INFO, "Jack sample rate mismatch, adjusting."
- " (synth.sample-rate=%lu, jackd=%lu)", (int)sample_rate, jack_srate);
+ " (synth.sample-rate=%lu, jackd=%lu)", (unsigned long)sample_rate, jack_srate);
fluid_settings_setnum(settings, "synth.sample-rate", jack_srate);
} So, since I see no evidence for fluidsynth's failure, I'm closing this ticket. |
I can see the code ... yes ... but ...
These are facts too. Same machine, same build environment, same run-time environment, nothing changes except fluidsynth version. Anyway, we can stay on 2.0.9 and let's see if future versions solves the problem Thanks! |
I understand that this situation is not satisfying, but if
|
Hello ; I found the same error on a Raspberry Pi zero using fluidsynth 2.1.5-2 in Arch :
fluidsynth still runs, but the audio connection is not made (the midi autoconnection seems to work fine). If I connect it manually with I'm using the following commands :
I also don't get this error when using alsa sequencer (leaving I will try your other tests when I get the time to ! Please ask if you need some other log. Here is my JACK2 (version 1.9.14-1) log :
|
The original bug was about a double free. This has been fixed, as you confirm "fluidsynth still runs". That the audio port connection fails is a different problem. Thus I would appreciate if you open a new issue and share your findings there. Perhaps we'll need a joint investigation with the guys from Jack, which will be easier in a new, dedicated issue. |
OK ! Yes I can see I rushed into this issue a bit quickly. |
FluidSynth version
Version: v2.1.0 or latest from master (working fine on 2.0.9)
Describe the bug
When starting fluidsynth with:
/usr/local/bin/fluidsynth -p fluidsynth -a jack -m jack -g 1 -j -o synth.midi-bank-select=mma -o synth.cpu-cores=3 -o synth.polyphony=64
I get:
Expected behavior
Get fluidsynth prompt. No error.
Steps to reproduce
The error is quite random. Not 100% reproducible.
But it's easy to reproduce on fresh boot.
Additional context
Platform: Raspberry Pi, running custom Raspbian (ZynthianOS)
The text was updated successfully, but these errors were encountered: