when closing Ardour, sometimes my plugin crashes with a Segmentation fault. In my understanding, the backtrace of gdb seems to be rather unrelated to my code:
#0 0x00007f5b72912fa6 in juce::ContainerDeletePolicy<juce::ImagePixelData>::destroy(juce::ImagePixelData*) (object=0x7f5b1400c100) at …/…/…/…/modules/juce_core/memory/juce_ContainerDeletePolicy.h:52
#1 0x00007f5b7290c45a in juce::ReferenceCountedObjectPtr<juce::ImagePixelData>::decIfNotNull(juce::ImagePixelData*) (o=0x7f5b1400c100) at …/…/…/…/modules/juce_core/memory/juce_ReferenceCountedObject.h:372
#2 0x00007f5b72901f77 in juce::ReferenceCountedObjectPtr<juce::ImagePixelData>::~ReferenceCountedObjectPtr() (this=0x7f5b14053ea0, __in_chrg=) at …/…/…/…/modules/juce_core/memory/juce_ReferenceCountedObject.h:333
#3 0x00007f5b72889daa in juce::Image::~Image() (this=Python Exception <class ‘RecursionError’> maximum recursion depth exceeded while getting the str of an object:
0x7f5b14053ea0, __in_chrg=<optimized out>) at …/…/…/…/modules/juce_graphics/images/juce_Image.cpp:261
#4 0x00007f5b728f4dea in juce::ImageCache::Pimpl::Item::~Item() (this=Python Exception <class ‘RecursionError’> maximum recursion depth exceeded while getting the str of an object:
0x7f5b14053ea0, __in_chrg=<optimized out>) at …/…/…/…/modules/juce_graphics/images/juce_ImageCache.cpp:100
#5 0x00007f5b7290d2de in juce::Array<juce::ImageCache::Pimpl::Item, juce::DummyCriticalSection, 0>::deleteAllElements() (this=0x7f5b1400b138) at …/…/…/…/modules/juce_core/containers/juce_Array.h:1268
#6 0x00007f5b72902f64 in juce::Array<juce::ImageCache::Pimpl::Item, juce::DummyCriticalSection, 0>::~Array() (this=0x7f5b1400b138, __in_chrg=<optimized out>) at …/…/…/…/modules/juce_core/containers/juce_Array.h:147
#7 0x00007f5b728f4c05 in juce::ImageCache::Pimpl::~Pimpl() (this=0x7f5b1400b110, __in_chrg=<optimized out>) at …/…/…/…/modules/juce_graphics/images/juce_ImageCache.cpp:34
#8 0x00007f5b728f4c46 in juce::ImageCache::Pimpl::~Pimpl() (this=0x7f5b1400b110, __in_chrg=<optimized out>) at …/…/…/…/modules/juce_graphics/images/juce_ImageCache.cpp:34
#9 0x00007f5b7286017f in juce::DeletedAtShutdown::deleteAll() () at …/…/…/…/modules/juce_events/messages/juce_DeletedAtShutdown.cpp:78
#10 0x00007f5b72861362 in juce::shutdownJuce_GUI() () at …/…/…/…/modules/juce_events/messages/juce_MessageManager.cpp:442
#11 0x00007f5b7272d060 in JuceVSTWrapper::~JuceVSTWrapper() (this=0x563b66a05d80, __in_chrg=<optimized out>) at …/…/…/…/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp:350
#12 0x00007f5b7272d1b0 in JuceVSTWrapper::~JuceVSTWrapper() (this=0x563b66a05d80, __in_chrg=<optimized out>) at …/…/…/…/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp:357
#13 0x00007f5b7272f528 in JuceVSTWrapper::dispatcherCB(VstEffectInterface*, int, int, long long, void*, float) (vstInterface=0x563b66a05de8, opCode=0x1, index=0x0, value=0x0, ptr=0x0, opt=0) at …/…/…/…/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp:1165
#14 0x00007f5ba09b8ef1 in vstfx_close(_VSTState*) () at /usr/lib/ardour5/libardour.so.3
This crash is somewhat random and hard to reproduce reliably, but it tends to happen more often (or only) when more instances of the plugin are loaded and the plugin GUI has once been opened in the session.
I couldn’t reproduce this behaviour with another DAW both on Linux and Windows yet.
I’m kind of lost here, but I guess maximum recursion depth exceeded while getting the str of an object'
of ~Image()
might give a hint on this issue. The plugin uses two background images for the GUI (using the Projucer only, no manual code by me), and without those images, the crash doesn’t occur so far (but another weird one does).
Does anyone have any idea about this or a hint where to look?