openAVproductions / openAV-Fabla2

The repository of the Fabla2 sampler by OpenAV. http://openavproductions.com/fabla2
GNU General Public License v2.0
54 stars 13 forks source link

crash in carla and ardour when deleting a sample #69

Open soweliniko opened 6 years ago

soweliniko commented 6 years ago

fabla2 will crash both carla and ardour when deleting a sample/layer.

harryhaaren commented 6 years ago

Hi Luke - thanks for testing.

I know its cumbersome to test in lots of hosts, but I'll still ask if you can test with Jalv (see here for how I run plugins while developing them: http://openavproductions.com/getting-started/)

I don't recall segfaults on deleting a layer - could you describe the exact clicks you're performing? Thanks, -Harry

soweliniko commented 6 years ago

same crash in jalv, when right clicking on a layer -> clicking "OK" in the resulting window.

soweliniko commented 6 years ago

more info: output from jalv when sample is removed, causing segfault:

list: lastClickedItem# 0, string: Cassette808_Cym02.wav
401 184
list: lastClickedItem# 0, string: Cassette808_Cym02.wav
401 184
Voice::stopIfSample() Cassette808_Cym02.wav : KILLED VOICE.
Voice::stopIfSample() Cassette808_Cym02.wav : KILLED VOICE.
[1]    6494 segmentation fault (core dumped)  jalv.gtk http://www.openavproductions.com/fabla2
harryhaaren commented 6 years ago

Cant reproduce here - rightclick -> remove works, no crash. Are you triggering the sample to be playing before deleting the layer? (The KILLED VOICE print shows that F2 is playing the sample as it is removed - which the code does handle - but perhaps incorrectly..) Is it a particularly long sample?

soweliniko commented 6 years ago

Crash only happens if I remove a sample I have played, if I import a sample, don't play it, and then delete it, it works fine.

harryhaaren commented 6 years ago

@luke, would you describe "have played"? Is a a click in the UI, or a MIDI message, or how do you play it? Clicking it works fine here:

void Fabla2::Pad::checkAll() : Starting...
void Fabla2::Pad::checkAll() : Done.

What output do you see?

soweliniko commented 6 years ago

it only happens after being triggered by a MIDI message. the output I get is

Voice::stopIfSample() 07_Kick_02_SP.wav : KILLED VOICE.
[1]    3613 segmentation fault (core dumped)  jalv.gtk http://www.openavproductions.com/fabla2
scrypthekid commented 1 year ago

The bug still prevails in Ardour7. Anyone find any kind of solution for this?

harryhaaren commented 1 year ago

I'm not sure why it happens, but its a typical race condition in C malloc and free usage, causing a segfault. Some debugging of the code to root cause, and then applying a fix will be required to solve properly. I cannot commit to finding time to fix it in the next days/weeks, sorry.

scrypthekid commented 1 year ago

Thanks for the response! Hey, when it's done it's done, no rush :))

scrypthekid commented 1 year ago

I found a temporary solution (Ardour7 in my case) for the problem: -Insert or record sample in Fabla2 -Trigger pad/sample with MIDI -Record something random on the same pad over the existing sample (do not trigger with MIDI at this point) -Right-click & delete the sample

Not great, but better than crashing... Hope this helps someone out!