Crash on MidiRecordDemo

Hi,

if I have open a Vst3 PluginWindow in the MidiRecordigDemo and delete the track, I get a crash:

Segmentation fault (core dumped)

If I have that Window opened and close the Application I get:

 *** Leaked objects detected: 1 instance(s) of class AttributeList
 JUCE Assertion failure in juce_LeakedObjectDetector.h:92
 *** Leaked objects detected: 1 instance(s) of class VST3HostContext
 JUCE Assertion failure in juce_LeakedObjectDetector.h:92

Is there anything I can do?

What’s the stack trace from the crash?

At a guess I’d say that the plugin window is holding a reference to the Plugin, when you delete the track, the Plugin is deleted and the window still has a reference to it so it’s trying to use some deallocated memory.


The other bit is an assertion stating some juce objects were leaked.
If you press continue, it should bubble up the stack leading to an object either you created or is in the demo code.

You probably want to close the window when the app it quit to avoid the leak.

I’m on Ubuntu 18.04. Juce and tracktion_engine is on develop branch. After building:

gdb MidiRecordingDemo

I load Zebralette.vst3 and open the Plugin window. Close it and open it again. Crash:

Thread 1 "MidiRecordingDe" received signal SIGSEGV, Segmentation fault.
0x00007fff693d140d in ?? () from /home/BaraMGB/.vst3/u-he/Zebra2.vst3/Contents/x86_64-linux/Zebra2.so
(gdb) bt
#0  0x00007fff693d140d in ?? () from /home/BaraMGB/.vst3/u-he/Zebra2.vst3/Contents/x86_64-linux/Zebra2.so
#1  0x00005555557bffd9 in juce::VST3PluginWindow::attachPluginWindow (this=0x5555570734a0)
    at ../../../juceDev/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp:1491
#2  0x00005555557bfb58 in juce::VST3PluginWindow::componentVisibilityChanged (this=0x5555570734a0)
    at ../../../juceDev/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp:1403
#3  0x0000555555ab644f in juce::ComponentMovementWatcher::componentVisibilityChanged (this=0x5555570735d8)
    at ../../../juceDev/modules/juce_gui_basics/layout/juce_ComponentMovementWatcher.cpp:120
#4  0x0000555555a8c765 in juce::Component::<lambda(juce::ComponentListener&)>::operator()(juce::ComponentListener &) const (
    __closure=0x7fffffffce50, l=...) at ../../../juceDev/modules/juce_gui_basics/components/juce_Component.cpp:582
#5  0x0000555555b3a3b1 in juce::ListenerList<juce::ComponentListener, juce::Array<juce::ComponentListener*, juce::DummyCriticalSection, 0> >::callChecked<juce::Component::sendVisibilityChangeMessage()::<lambda(juce::ComponentListener&)>, juce::Component::BailOutChecker>(const juce::Component::BailOutChecker &, juce::Component::<lambda(juce::ComponentListener&)> &&) (this=0x555556e5c6d8, bailOutChecker=..., callback=...)
    at ../../../juceDev/modules/juce_core/containers/juce_ListenerList.h:153
#6  0x0000555555a8c7e7 in juce::Component::sendVisibilityChangeMessage (this=0x555556e5c650)
    at ../../../juceDev/modules/juce_gui_basics/components/juce_Component.cpp:582
#7  0x0000555555a8c66d in juce::Component::setVisible (this=0x555556e5c650, shouldBeVisible=true)
    at ../../../juceDev/modules/juce_gui_basics/components/juce_Component.cpp:560
#8  0x0000555555640428 in PluginWindow::show (this=0x555556e5c650)
    at /home/BaraMGB/Projects/debugMRD/tracktionDev/examples/common/PluginWindow.h:143
#9  0x00005555556407d1 in PluginWindow::create (plugin=...) at /home/BaraMGB/Projects/debugMRD/tracktionDev/examples/common/PluginWindow.h:198
#10 0x000055555564f13e in ExtendedUIBehaviour::createPluginWindow (this=0x555556a61e10, pws=...)
    at /home/BaraMGB/Projects/debugMRD/tracktionDev/examples/common/PluginWindow.h:243
#11 0x0000555555fffd8a in tracktion_engine::PluginWindowState::showWindow (this=0x555556b68ee0)
    at ../../../tracktionDev/modules/tracktion_engine/plugins/tracktion_PluginWindowState.cpp:107
#12 0x0000555555fff901 in tracktion_engine::PluginWindowState::showWindowExplicitly (this=0x555556b68ee0)
    at ../../../tracktionDev/modules/tracktion_engine/plugins/tracktion_PluginWindowState.cpp:45
#13 0x0000555555ffb320 in tracktion_engine::Plugin::showWindowExplicitly (this=0x555556b69fd0)
    at ../../../tracktionDev/modules/tracktion_engine/plugins/tracktion_Plugin.cpp:1176
#14 0x000055555563d29b in PluginComponent::clicked (this=0x555556b85d30, modifiers=...)
    at /home/BaraMGB/Projects/debugMRD/tracktionDev/examples/common/Components.cpp:788
#15 0x0000555555a9f5e1 in juce::Button::sendClickMessage (this=0x555556b85d30, modifiers=...)
    at ../../../juceDev/modules/juce_gui_basics/buttons/juce_Button.cpp:396
#16 0x0000555555a9f3c8 in juce::Button::internalClickCallback (this=0x555556b85d30, modifiers=...)
    at ../../../juceDev/modules/juce_gui_basics/buttons/juce_Button.cpp:350
#17 0x0000555555a9fa6c in juce::Button::mouseUp (this=0x555556b85d30, e=...)
---Type <return> to continue, or q <return> to quit---
    at ../../../juceDev/modules/juce_gui_basics/buttons/juce_Button.cpp:470
#18 0x0000555555a93789 in juce::Component::internalMouseUp (this=0x555556b85d30, source=..., relativePos=..., time=..., oldModifiers=..., 
    pressure=0, orientation=0, rotation=0, tiltX=0, tiltY=0) at ../../../juceDev/modules/juce_gui_basics/components/juce_Component.cpp:2452
#19 0x0000555555b4f828 in juce::MouseInputSourceInternal::sendMouseUp (this=0x555556ac8d80, comp=..., screenPos=..., time=..., oldMods=...)
    at ../../../juceDev/modules/juce_gui_basics/mouse/juce_MouseInputSource.cpp:154
#20 0x0000555555b4fb6b in juce::MouseInputSourceInternal::setButtons (this=0x555556ac8d80, screenPos=..., time=..., newButtonState=...)
    at ../../../juceDev/modules/juce_gui_basics/mouse/juce_MouseInputSource.cpp:196
#21 0x0000555555b50306 in juce::MouseInputSourceInternal::handleEvent (this=0x555556ac8d80, newPeer=..., positionWithinPeer=..., time=..., 
    newMods=..., newPressure=0, newOrientation=0, pen=...) at ../../../juceDev/modules/juce_gui_basics/mouse/juce_MouseInputSource.cpp:333
#22 0x0000555555a96514 in juce::MouseInputSource::handleEvent (this=0x7fffffffd600, peer=..., pos=..., time=1603807583609, mods=..., pressure=0, 
    orientation=0, penDetails=...) at ../../../juceDev/modules/juce_gui_basics/mouse/juce_MouseInputSource.cpp:633
#23 0x0000555555b1cc41 in juce::ComponentPeer::handleMouseEvent (this=0x555556b89020, type=juce::MouseInputSource::mouse, pos=..., newMods=..., 
    newPressure=0, newOrientation=0, time=1603807583609, pen=..., touchIndex=0)
    at ../../../juceDev/modules/juce_gui_basics/windows/juce_ComponentPeer.cpp:87
#24 0x0000555555b38f49 in juce::XWindowSystem::handleButtonReleaseEvent (this=0x555556b13f60, peer=0x555556b89020, buttonRelEvent=...)
    at ../../../juceDev/modules/juce_gui_basics/native/x11/juce_linux_XWindowSystem.cpp:3126
#25 0x0000555555b38163 in juce::XWindowSystem::handleWindowMessage (this=0x555556b13f60, peer=0x555556b89020, event=...)
    at ../../../juceDev/modules/juce_gui_basics/native/x11/juce_linux_XWindowSystem.cpp:2860
#26 0x0000555555b39f01 in juce::WindowingHelpers::windowMessageReceive (event=...)
    at ../../../juceDev/modules/juce_gui_basics/native/x11/juce_linux_XWindowSystem.cpp:3380
#27 0x0000555555b37924 in juce::XWindowSystem::<lambda(int)>::operator()(int) const (__closure=0x555556ac57f0)
    at ../../../juceDev/modules/juce_gui_basics/native/x11/juce_linux_XWindowSystem.cpp:2789
#28 0x0000555555b3f9f0 in std::_Function_handler<void(int), juce::XWindowSystem::initialiseXDisplay()::<lambda(int)> >::_M_invoke(const std::_Any_data &, int &&) (__functor=..., __args#0=@0x7fffffffd874: 5) at /usr/include/c++/7/bits/std_function.h:316
#29 0x0000555555999eaa in std::function<void (int)>::operator()(int) const (this=0x555556ac57f0, __args#0=5)
    at /usr/include/c++/7/bits/std_function.h:706
#30 0x00005555559957a3 in juce::InternalRunLoop::dispatchPendingEvents (this=0x555556ac5740)
    at ../../../juceDev/modules/juce_events/native/juce_linux_Messaging.cpp:186
#31 0x00005555559905b9 in juce::MessageManager::dispatchNextMessageOnSystemQueue (returnIfNoPendingMessages=false)
    at ../../../juceDev/modules/juce_events/native/juce_linux_Messaging.cpp:300
#32 0x000055555598add7 in juce::MessageManager::runDispatchLoop (this=0x555556ac56d0)
    at ../../../juceDev/modules/juce_events/messages/juce_MessageManager.cpp:128
#33 0x000055555598a238 in juce::JUCEApplicationBase::main () at ../../../juceDev/modules/juce_events/messages/juce_ApplicationBase.cpp:262
#34 0x000055555598a0ff in juce::JUCEApplicationBase::main (argc=1, argv=0x7fffffffdb28)
    at ../../../juceDev/modules/juce_events/messages/juce_ApplicationBase.cpp:240
---Type <return> to continue, or q <return> to quit---
#35 0x0000555555640cb4 in main (argc=1, argv=0x7fffffffdb28) at ../../Source/Main.cpp:68

Are you sure this is an issue with Tracktion Engine and not Zebra2 or the JUCE Linux plugin hosting?
Have you tried this plugin in the JUCE audio plugin host?

Seems to be a juce problem. I had at least one crash with the Audiopluginhost,too. I have to investigate further. I want to try a Wayland Linux. Also, I need to test another non-juce vst3.

Thank you for your help.