openAV-Fabla2 icon indicating copy to clipboard operation
openAV-Fabla2 copied to clipboard

crash in carla and ardour when deleting a sample

Open soweliniko opened this issue 7 years ago • 11 comments

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

soweliniko avatar Sep 24 '17 09:09 soweliniko

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

harryhaaren avatar Sep 24 '17 14:09 harryhaaren

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

soweliniko avatar Sep 24 '17 17:09 soweliniko

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

soweliniko avatar Sep 25 '17 17:09 soweliniko

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?

harryhaaren avatar Sep 25 '17 20:09 harryhaaren

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.

soweliniko avatar Sep 27 '17 06:09 soweliniko

@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:

  • Load sample
  • Trigger sample from "layers" section of UI
  • Trigger sample by clicking Pad it was loaded to
  • Right click, OK -> deletes sample fine, see below output:
void Fabla2::Pad::checkAll() : Starting...
void Fabla2::Pad::checkAll() : Done.

What output do you see?

harryhaaren avatar Sep 27 '17 23:09 harryhaaren

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

soweliniko avatar Sep 28 '17 05:09 soweliniko

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

scrypthekid avatar May 11 '23 10:05 scrypthekid

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.

harryhaaren avatar May 16 '23 18:05 harryhaaren

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

scrypthekid avatar May 17 '23 10:05 scrypthekid

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!

scrypthekid avatar May 17 '23 11:05 scrypthekid