juce-framework / JUCE

JUCE is an open-source cross-platform C++ application framework for desktop and mobile applications, including VST, VST3, AU, AUv3, LV2 and AAX audio plug-ins.
https://juce.com
Other
6.59k stars 1.74k forks source link

VST2 is partially broken under Linux/X11 since 6.1.0 #959

Closed KottV closed 3 years ago

KottV commented 3 years ago

Please include:

1) Get JUCE sources => 6.1.0 compile Plugin with VST2 enabled. I've tested with https://github.com/reales/OB-Xd and https://github.com/blackboxdsp/rotor and AudioPluginDemo Load it in the Host. 2) Plugin should be loaded. 3) Linux openSUSE TW 4) x86_64 5) It may crash with:

X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  20 (X_GetProperty)
  Resource id in failed request:  0x0
  Serial number of failed request:  54
  Current serial number in output stream:  54
[LWP 11083 exited]

or

Thread 1 "AudioPluginHost" received signal SIGTRAP, Trace/breakpoint trap.
__futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0xa60ba8) at futex-internal.c:57
57          return INTERNAL_SYSCALL_CANCEL (futex_time64, futex_word, op, expected,
(gdb) bt
#0  __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0xa60ba8) at futex-internal.c:57
#1  __futex_abstimed_wait_common (futex_word=futex_word@entry=0xa60ba8, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0, cancel=cancel@entry=true) at futex-internal.c:87
#2  0x00007ffff78077ff in __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0xa60ba8, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at futex-internal.c:139
#3  0x00007ffff7809f10 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0xa60b58, cond=0xa60b80) at pthread_cond_wait.c:504
#4  ___pthread_cond_wait (cond=0xa60b80, mutex=0xa60b58) at pthread_cond_wait.c:619
#5  0x00007ffff7b590d0 in __gthread_cond_wait (__mutex=<optimized out>, __cond=<optimized out>) at /usr/src/debug/gcc11-11.2.1+git610-1.12.x86_64/obj-x86_64-suse-linux/x86_64-suse-linux/libstdc++-v3/include/x86_64-suse-linux/bits/gthr-default.h:865
#6  std::__condvar::wait (__m=..., this=<optimized out>) at /usr/src/debug/gcc11-11.2.1+git610-1.12.x86_64/obj-x86_64-suse-linux/x86_64-suse-linux/libstdc++-v3/include/bits/std_mutex.h:155
#7  std::condition_variable::wait (this=<optimized out>, __lock=...) at ../../../../../libstdc++-v3/src/c++11/condition_variable.cc:41
#8  0x00007fffe782a4a9 in std::condition_variable::wait<juce::WaitableEvent::wait(int) const::<lambda()> >(std::unique_lock<std::mutex> &, struct {...}) (this=0xa60b80, __lock=..., __p=...) at /usr/include/c++/11/condition_variable:103
#9  0x00007fffe7824028 in juce::WaitableEvent::wait (this=0xa60b50, timeOutMilliseconds=-1) at /home/kv/src/audio/JUCE6/modules/juce_core/threads/juce_WaitableEvent.cpp:39
#10 0x00007fffe76e4658 in juce::MessageThread::start (this=0xa60b50) at /home/kv/src/audio/JUCE6/modules/juce_audio_plugin_client/VST/../utility/juce_LinuxMessageThread.h:78
#11 0x00007fffe76e4477 in juce::MessageThread::MessageThread (this=0xa60b50) at /home/kv/src/audio/JUCE6/modules/juce_audio_plugin_client/VST/../utility/juce_LinuxMessageThread.h:42
#12 0x00007fffe76f0360 in juce::SharedResourcePointer<juce::MessageThread>::initialise (this=0x7fffffffd600) at /home/kv/src/audio/JUCE6/modules/juce_core/memory/juce_SharedResourcePointer.h:150
#13 0x00007fffe76ec333 in juce::SharedResourcePointer<juce::MessageThread>::SharedResourcePointer (this=0x7fffffffd600) at /home/kv/src/audio/JUCE6/modules/juce_core/memory/juce_SharedResourcePointer.h:92
#14 0x00007fffe76dee3b in (anonymous namespace)::pluginEntryPoint (audioMaster=0x4e11a9 <juce::audioMaster(Vst2::AEffect*, int, int, long long, void*, float)>) at /home/kv/src/audio/JUCE6/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp:2111
#15 0x00007fffe76df0f6 in VSTPluginMain (audioMaster=0x4e11a9 <juce::audioMaster(Vst2::AEffect*, int, int, long long, void*, float)>) at /home/kv/src/audio/JUCE6/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp:2181
#16 0x00000000004bfef2 in juce::VSTPluginInstance::constructEffect(juce::ReferenceCountedObjectPtr<juce::ModuleHandle> const&) ()
#17 0x00000000004e021e in juce::VSTPluginInstance::create(juce::ReferenceCountedObjectPtr<juce::ModuleHandle> const&, double, int) ()
#18 0x00000000004bb506 in juce::VSTPluginFormat::createPluginInstance(juce::PluginDescription const&, double, int, std::function<void (std::unique_ptr<juce::AudioPluginInstance, std::default_delete<juce::AudioPluginInstance> >, juce::String const&)>) ()
#19 0x000000000049e135 in juce::AudioPluginFormat::handleMessage(juce::Message const&) ()
#20 0x00000000005607c4 in juce::InternalMessageQueue::InternalMessageQueue()::{lambda(int)#1}::operator()(int) const ()
#21 0x000000000055f0e5 in juce::InternalRunLoop::dispatchPendingEvents() ()
#22 0x000000000055c984 in juce::dispatchNextMessageOnSystemQueue(bool) ()
#23 0x000000000055c9be in juce::MessageManager::runDispatchLoop() ()
#24 0x000000000041a177 in juce::JUCEApplicationBase::main() ()
#25 0x00007ffff77aa540 in __libc_start_call_main (main=main@entry=0x41705e <main>, argc=argc@entry=1, argv=argv@entry=0x7fffffffd9f8) at ../sysdeps/nptl/libc_start_call_main.h:58
#26 0x00007ffff77aa5ec in __libc_start_main_impl (main=0x41705e <main>, argc=1, argv=0x7fffffffd9f8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffd9e8) at ../csu/libc-start.c:409
#27 0x000000000041c1d5 in _start () at ../sysdeps/x86_64/start.S:116

or

Thread 1 "AudioPluginScan" received signal SIGSEGV, Segmentation fault.
JuceVSTWrapper::JuceVSTWrapper (this=0x937750, cb=0x4a9720 <juce::audioMaster(Vst2::AEffect*, int, int, long long, void*, float)>, af=...) at ../../JuceLibraryCode/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp:278
278             vstEffect.numPrograms = jmax (1, af->getNumPrograms());
(gdb) bt
#0  JuceVSTWrapper::JuceVSTWrapper (this=0x937750, cb=0x4a9720 <juce::audioMaster(Vst2::AEffect*, int, int, long long, void*, float)>, af=...) at ../../JuceLibraryCode/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp:278
#1  0x00007ffff70fc4e4 in (anonymous namespace)::pluginEntryPoint (audioMaster=0x4a9720 <juce::audioMaster(Vst2::AEffect*, int, int, long long, void*, float)>) at ../../JuceLibraryCode/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp:2117
#2  0x00007ffff70fc6d6 in VSTPluginMain (audioMaster=0x4a9720 <juce::audioMaster(Vst2::AEffect*, int, int, long long, void*, float)>) at ../../JuceLibraryCode/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp:2174
#3  0x00000000004a734f in juce::VSTPluginInstance::create(juce::ReferenceCountedObjectPtr<juce::ModuleHandle> const&, double, int) ()
#4  0x0000000000466e76 in juce::VSTPluginFormat::createPluginInstance(juce::PluginDescription const&, double, int, std::function<void (std::unique_ptr<juce::AudioPluginInstance, std::default_delete<juce::AudioPluginInstance> >, juce::String const&)>) ()
#5  0x0000000000433197 in juce::AudioPluginFormat::createInstanceFromDescription(juce::PluginDescription const&, double, int, juce::String&) ()
#6  0x000000000043335c in juce::createAndUpdateDesc(juce::VSTPluginFormat&, juce::PluginDescription&) ()
#7  0x000000000044cc23 in juce::VSTPluginFormat::findAllTypesForFile(juce::OwnedArray<juce::PluginDescription, juce::DummyCriticalSection>&, juce::String const&) ()
#8  0x0000000000423e2b in scanFile(juce::AudioPluginFormatManager&, juce::File&, juce::File&) ()
#9  0x0000000000424205 in scan(juce::ArgumentList const&) ()
#10 0x00000000007387ef in juce::ConsoleApplication::findAndRunCommand(juce::ArgumentList const&, bool) const ()
#11 0x000000000073e10f in juce::ConsoleApplication::findAndRunCommand(int, char**) const ()
#12 0x00000000004201dc in main ()

6) VST2 7) Carla, AudioPluginHost https://github.com/ffAudio/AudioPluginScanner

I'll be glad to provide more information if you ask.

ed95 commented 3 years ago

I don't have an installation of openSUSE on hand to test with, but I've tested the JUCE AudioPluginDemo VST2 in both Ubuntu 18.04 an 20.04 LTS in the AudioPluginHost, Carla, and the AudioPluginScanner and I am not seeing any crashes. Are you only seeing the crash when using openSUSE?

Unfortunately the stack traces don't give much useful information, but it may be that you can catch the X11 BadWindow error by putting a breakpoint in X11ErrorHandling::errorHandler() and examining the stack when it breaks.

KottV commented 3 years ago

Thanks for checking. I can say for sure that problem doesn't exist in 6.0.8 I'll test in Ubuntu and do debug with breakpoints.

KottV commented 3 years ago

My apologize for the noise. I screwed my JUCE sources and did build plugins with the global modules path.

All is good.