Cabbage Logo
Back to Cabbage Site

VST crash

Hi Rory, and other Csound/Cabbage gurus,

I’m experiencing some obscure and very rare crashing of my VST3 instrument. I think it is likely related to a Csound crash and not Cabbage? However, I’m looking for feedback, advice, guidance on what could go wrong and how I could find out or prevent crashes.

I have used the instrument in question in the past, recorded several hours of playing with it (VST version) in Reaper. Recently I switched to M1 mac, did some minor mods (simplifications) to the instrument and exported VST3. I’ve done some practice sessions with it, maybe 10 hours and had it crash perhaps 5 times, so maybe ones per hour or two of playing. This makes it very difficult to debug. I have 2 different instruments running in Reaper and only the one in question crashes, Reaper handles this well without crashing the hole session. To bring the instrument back to life I had to reload the plugin.

I’m posting a waveform screen-shot from a recording during crash (after about one hour recording without issues), where you can see the numbers escaping out of range. They were caught by the Reaper limiter though.

It seems this might be related to amplitude values getting out of range. I can’t see any obvious mode/behaviour of my instrument that would lead to this. I’m using chnget and chnclear if that matters.

Would you have any suggestions how I could debug this, would such an event be logged anywhere when running VST3 in host, could the issue be exclusive to VST3 and not VST for any reason, would there be a way to handle/catch such issues with Cabbage/Csound so that the plugin wouldn’t crash (even if I’d get pops and dropouts that would still be better than the current crashing terror)?

Any ideas would be appreciated. Great learning from you guys!

It’s a tricky one to debug. There are ways of logging, but as soon as Csound crashes the logging stops. Could it be a division by 0 somewhere? I’d use divv where I can to avoid this kind of issue. Are you doing a lot with the instrument at the times of the crash in terms of updating parameters and interacting with the UI? If so then it might be a Cabbage issue. But if it just crashes out of the blue I think it’s more likely an issue with Csound.Are you reading and writing to disk with Csound? Are you reading/writing to tables?

Thanks Rory!

I was not doing much in terms of MIDI or UI control when it crashed, compared to other times when it did not crash. And I have the GUI closed when playing. Also I was not pushing the instrument particularly much in the sense of having too many notes active or having high frequency of triggering notes. I’m not writing on disk, but I am reading tables quite a bit.

It surely looks like division by zero could cause Inf numbers. Besides tables with frequencies vs note number I have some tables with amplitudes vs frequency. Since I started experiencing crashes, I changed some values in the amplitude vs frequency tables, but also updated computer, Cabbage etc… I suspect something might go on there with the tables. I will check where I could apply the divz (I guess this is what you meant). However, the amplitude tables that I use are very sparse and I rely heavily on interpolation there (linear I believe), so I am wondering if interpolation could crap out so badly and could a solution be to add a limit when reading tables?

I think it might be worth testing limit to see if it fixes the crash. If so, I’d go back and see why these ranges are blowing up.

Exactly. Also check table indices. An out of bounds error could also cause problems.