TheWaveWarden/odin2

`Filter::Filter()` symbol clash in LV2 host

Closed this issue · 1 comments

Describe the bug

Error when freeing the plugin when another Filter::Filter() exists in the host's code.

To Reproduce

Steps to reproduce the behavior:

  1. Load plugin in Zrythm
  2. Close Zrythm
  3. See error when plugin is free'd

Expected behavior

No symbol clash (probably needs some build flag)

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. Windows] GNU/Linux (Arch Linux)
  • DAW and version being used [e.g Bitwig 3.2.4] Zrythm 1.0.0-alpha.25.1.22-16-g43688a66d+
  • Odin Version [e.g. 2.2.4] see below
  • Plugin Format [VST3 / AU / LV2]: LV2

Additional context

Version

Screenshot from 2021-10-17 17-23-00

Symbol clash

As you can see Odin2.so calls Filter::~Filter() (this=0x7fff846c7780, this=<optimized out>) at ../ext/qm-dsp/dsp/signalconditioning/Filter.cpp:61, which is inside the host's code. That file contains a class Filter under the namespace Filter so I believe it clashes with some symbol from Odin2.

#0  0x00007ffff5d5ad22 in raise () at /usr/lib/libc.so.6
#1  0x00007ffff5d44862 in abort () at /usr/lib/libc.so.6
#2  0x00007ffff5d9cd28 in __libc_message () at /usr/lib/libc.so.6
#3  0x00007ffff5da492a in  () at /usr/lib/libc.so.6
#4  0x00007ffff5da61b0 in _int_free () at /usr/lib/libc.so.6
#5  0x00007ffff5da99e8 in free () at /usr/lib/libc.so.6
#6  0x0000555556077621 in __gnu_cxx::new_allocator<double>::deallocate(double*, unsigned long) (this=0x7fff846c77d0, __p=0x7fff846c77f0, __t=0) at /usr/include/c++/11.1.0/ext/new_allocator.h:139
#7  0x0000555556076c10 in std::allocator_traits<std::allocator<double> >::deallocate(std::allocator<double>&, double*, unsigned long) (__a=..., __p=0x7fff846c77f0, __n=0) at /usr/include/c++/11.1.0/bits/alloc_traits.h:492
#8  0x0000555556076378 in std::_Vector_base<double, std::allocator<double> >::_M_deallocate(double*, unsigned long) (this=0x7fff846c77d0, __p=0x7fff846c77f0, __n=0) at /usr/include/c++/11.1.0/bits/stl_vector.h:354
#9  0x0000555556075df6 in std::_Vector_base<double, std::allocator<double> >::~_Vector_base() (this=0x7fff846c77d0, this=<optimized out>) at /usr/include/c++/11.1.0/bits/stl_vector.h:335
#10 0x0000555556075e47 in std::vector<double, std::allocator<double> >::~vector() (this=0x7fff846c77d0, this=<optimized out>) at /usr/include/c++/11.1.0/bits/stl_vector.h:683
#11 0x00005555560890b2 in Filter::~Filter() (this=0x7fff846c7780, this=<optimized out>) at ../ext/qm-dsp/dsp/signalconditioning/Filter.cpp:61
#12 0x00007fff84db46e1 in Delay::~Delay() (this=0x7fff840eb640, __in_chrg=<optimized out>) at ../../Source/audio/FX/Delay.cpp:27
#13 0x00007fff849ff70e in OdinAudioProcessor::~OdinAudioProcessor() (this=0x7fff80e9a010, __in_chrg=<optimized out>) at ../../Source/PluginProcessor.cpp:263
#14 0x00007fff849ffeca in OdinAudioProcessor::~OdinAudioProcessor() (this=0x7fff80e9a010, __in_chrg=<optimized out>) at ../../Source/PluginProcessor.cpp:263
#15 0x00007fff849c765d in std::default_delete<juce::AudioProcessor>::operator()(juce::AudioProcessor*) const (__ptr=<optimized out>, this=0x555586cf2910) at /usr/include/c++/10.2.0/bits/unique_ptr.h:79
#16 std::__uniq_ptr_impl<juce::AudioProcessor, std::default_delete<juce::AudioProcessor> >::reset(juce::AudioProcessor*) (__p=0x0, this=0x555586cf2910) at /usr/include/c++/10.2.0/bits/unique_ptr.h:182
#17 std::__uniq_ptr_impl<juce::AudioProcessor, std::default_delete<juce::AudioProcessor> >::operator=(std::__uniq_ptr_impl<juce::AudioProcessor, std::default_delete<juce::AudioProcessor> >&&) (__u=<optimized out>, this=0x555586cf2910)
    at /usr/include/c++/10.2.0/bits/unique_ptr.h:167
#18 std::__uniq_ptr_data<juce::AudioProcessor, std::default_delete<juce::AudioProcessor>, true, true>::operator=(std::__uniq_ptr_data<juce::AudioProcessor, std::default_delete<juce::AudioProcessor>, true, true>&&) (this=0x555586cf2910)
    at /usr/include/c++/10.2.0/bits/unique_ptr.h:212
#19 std::unique_ptr<juce::AudioProcessor, std::default_delete<juce::AudioProcessor> >::operator=(std::unique_ptr<juce::AudioProcessor, std::default_delete<juce::AudioProcessor> >&&) (this=0x555586cf2910)
    at /usr/include/c++/10.2.0/bits/unique_ptr.h:371
#20 StdPtr<juce::AudioProcessor>::operator=(StdPtr<juce::AudioProcessor>&&) (this=0x555586cf2910) at /usr/src/debug/JUCE/modules/juce_audio_plugin_client/LV2/juce_LV2_Wrapper.cpp:105
#21 JuceLv2Wrapper::~JuceLv2Wrapper() (this=0x555586cf2900, __in_chrg=<optimized out>) at /usr/src/debug/JUCE/modules/juce_audio_plugin_client/LV2/juce_LV2_Wrapper.cpp:1308
#22 0x00007fff849c3d71 in JuceLv2Wrapper::~JuceLv2Wrapper() (this=0x555586cf2900, __in_chrg=<optimized out>) at /usr/src/debug/JUCE/modules/juce_audio_plugin_client/LV2/juce_LV2_Wrapper.cpp:1301
#23 juceLV2_Cleanup(LV2_Handle) (handle=0x555586cf2900) at /usr/src/debug/JUCE/modules/juce_audio_plugin_client/LV2/juce_LV2_Wrapper.cpp:2076
#24 0x00007ffff67994e4 in lilv_instance_free () at /usr/lib/liblilv-0.so.0
#25 0x0000555555f4ee5b in lv2_plugin_free(Lv2Plugin*) (self=0x555587a4c8f0) at ../src/plugins/lv2_plugin.c:3835
#26 0x0000555555f56db0 in plugin_free(Plugin*) (self=0x555587a49de0) at ../src/plugins/plugin.c:3193
#27 0x0000555555ebb29a in channel_remove_plugin(Channel*, PluginSlotType, int, _Bool, _Bool, _Bool, _Bool)
    (channel=0x5555878b5200, slot_type=PLUGIN_SLOT_INSTRUMENT, slot=0, moving_plugin=false, deleting_plugin=true, deleting_channel=false, recalc_graph=false) at ../src/audio/channel.c:1528
#28 0x0000555555ebc9f4 in channel_disconnect(Channel*, _Bool) (self=0x5555878b5200, remove_pl=true) at ../src/audio/channel.c:2111
#29 0x0000555555f0ff91 in track_disconnect(Track*, _Bool, _Bool) (self=0x5555835661f0, remove_pl=true, recalc_graph=false) at ../src/audio/track.c:2398
#30 0x0000555555f1aa06 in tracklist_remove_track(Tracklist*, Track*, _Bool, _Bool, _Bool, _Bool) (self=0x5555831ba400, track=0x5555835661f0, rm_pl=true, free_track=true, publish_events=false, recalc_graph=false)
    at ../src/audio/tracklist.c:895
#31 0x0000555555f1d4c3 in tracklist_free(Tracklist*) (self=0x5555831ba400) at ../src/audio/tracklist.c:1977
#32 0x0000555555f83dde in project_free(Project*) (self=0x555583239640) at ../src/project.c:2140
#33 0x0000555555f67d5e in on_main_window_destroy(MainWindowWidget*, gpointer) (self=0x5555829926b0, user_data=0x5555829926b0) at ../src/gui/widgets/main_window.c:102
#34 0x00007ffff71f5d8f in g_closure_invoke () at /usr/lib/libgobject-2.0.so.0
#35 0x00007ffff7211718 in  () at /usr/lib/libgobject-2.0.so.0
#36 0x00007ffff7212dd9 in g_signal_emit_valist () at /usr/lib/libgobject-2.0.so.0
#37 0x00007ffff7213330 in g_signal_emit () at /usr/lib/libgobject-2.0.so.0
#38 0x00007ffff78d1afa in  () at /usr/lib/libgtk-3.so.0
#39 0x00007ffff78dd5bd in  () at /usr/lib/libgtk-3.so.0
#40 0x00007ffff7647b54 in  () at /usr/lib/libgtk-3.so.0
#41 0x00007ffff71f7b8a in g_object_run_dispose () at /usr/lib/libgobject-2.0.so.0
#42 0x00007ffff7779a2b in gtk_main_do_event () at /usr/lib/libgtk-3.so.0
#43 0x00007ffff74e4643 in  () at /usr/lib/libgdk-3.so.0

Hi @alex-tee. Thanks for reporting and sorry for the very late answer.

I've renamed all instances of FIlter to OdinFilterBase for the upcoming 2.3.3 release to solve this issue