DISTRHO / Cardinal

Virtual modular synthesizer plugin
https://cardinal.kx.studio/
GNU General Public License v3.0
2.22k stars 153 forks source link

Segmentation fault when closing window with Aida module #546

Closed iv-m closed 1 year ago

iv-m commented 1 year ago

When I add Aida-X module and then close the Cardinal window, I get segmentation fault, both from standalone Cardinal and Cardinal LV2 plugin in Ardour 7.5.

Here is the backtrace from standalone Cardinal:

(gdb) bt
#0  0x0000555555e55518 in rack::window::WindowSetPluginUI (ui=0x0, window=0x55555b022040) at ./src/Cardinal/Window.cpp:465
#1  CardinalDISTRHO::CardinalUI::~CardinalUI (this=<optimized out>, this=<optimized out>) at ./src/Cardinal/CardinalUI.cpp:501
#2  0x0000555555e5a074 in CardinalDISTRHO::CardinalUI::~CardinalUI (this=<optimized out>, this=<optimized out>)
    at /tmp/.private/iv/RPM/BUILD/Cardinal-23.07/src/Cardinal/CardinalUI.cpp:495
#3  CardinalDISTRHO::UIExporter::~UIExporter (this=<optimized out>, this=<optimized out>) at ../../dpf/distrho/src/DistrhoUIInternal.hpp:117
#4  CardinalDISTRHO::PluginJack::~PluginJack (this=<optimized out>, this=<optimized out>) at ../../dpf/distrho/src/DistrhoPluginJACK.cpp:302
#5  0x0000555555d6da1d in main (argc=<optimized out>, argv=<optimized out>) at ../../dpf/distrho/src/DistrhoPluginJACK.cpp:1158
iv-m commented 1 year ago

In the Cardinal output, I noticed the following:

[3.457 warn Window.cpp:890 loadImage] Cannot read file /usr/share/cardinal/Cardinal/res/aida-x-background-p2.png
[3.458 warn Window.cpp:890 loadImage] Cannot read file /usr/share/cardinal/Cardinal/res/aida-x-logo.png

Indeed, for some none of the Aida's PNG resources are installed into the resource folder. Installing them manually fixes the segfault.

falkTX commented 1 year ago

oh no, this might be bad... how come they were not installed? there should be a wildcard on the makefile.

I can confirm the issue at least. time to investigate...

falkTX commented 1 year ago

Fixed in 66a165f239cb6bcef5d03fc5741257c5502944e0

I need to retag 23.07, this and the LTO issue are 2 critical points. sigh...

iv-m commented 1 year ago

Fixed in 66a165f

This fix does not work for me. Probably the glob should be expanded explicitly:

--- a/plugins/Makefile
+++ b/plugins/Makefile
@@ -1405,7 +1405,7 @@ JACK_RESOURCES += $(CURDIR)/surgext/build/surge-data/fx_presets
 JACK_RESOURCES += $(CURDIR)/surgext/build/surge-data/wavetables
 JACK_RESOURCES += $(CURDIR)/surgext/build/surge-data/windows.wt

-RESOURCE_FILES += Cardinal/res/*.png
+RESOURCE_FILES += $(wildcard Cardinal/res/*.png)
 RESOURCE_FILES += Cardinal/res/Miku/Miku.png

 MINIPLUGIN_LIST     = Cardinal

Didn't check that it really helps yet.

falkTX commented 1 year ago

I added that right after, a stupid silly typo on my part

iv-m commented 1 year ago

Oh, now I see. Sorry for the noise.