JUCE
JUCE copied to clipboard
[Bug]: Standalone plugin crashes on headless embedded system (RPi4)
Detailed steps on how to reproduce the bug
The steps are:
- Connect to RPi4 with X11 forwarding disabled:
ssh -x pi@WHATEVER_IP_ADRESS - Clone JUCE
- Build the AudioPluginExample_Standalone
- Run it and see it crash
Here is the bash code for the steps above:
# clone JUCE and cd into it
git clone https://github.com/juce-framework/JUCE
cd JUCE
# checkout the develop
git checkout develop
# prepare build system
cmake . -B cmake-build -DJUCE_BUILD_EXAMPLES=ON -DJUCE_BUILD_EXTRAS=ON
# build the AudioPluginExample_Standalone
make -C cmake-build AudioPluginExample_Standalone -j 3
# run it
cmake-build/examples/CMake/AudioPlugin/AudioPluginExample_artefacts/Standalone/Audio\ Plugin\ Example
Important:
You need to connect via SSH with X11 forwarding disabled! If you enable X11 forwarding via ssh -X pi@WHATEVER_IP_ADRESS the AudioPluginExample will run fine.
What is the expected behaviour?
A segmentation fault.
Here is the stack trace for the segfault, detected via gdb cmake-build/examples/CMake/AudioPlugin/AudioPluginExample_artefacts/Standalone/Audio\ Plugin\ Example -> run -> bt 10:
pi@raspberrypi:~/JUCE $ gdb cmake-build/examples/CMake/AudioPlugin/AudioPluginExample_artefacts/Standalone/Audio\ Plugin\ Example
GNU gdb (Raspbian 8.2.1-2) 8.2.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from cmake-build/examples/CMake/AudioPlugin/AudioPluginExample_artefacts/Standalone/Audio Plugin Example...run(no debugging symbols found)...done.
(gdb) run
Starting program: /home/pi/JUCE/cmake-build/examples/CMake/AudioPlugin/AudioPluginExample_artefacts/Standalone/Audio Plugin Example
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
[Detaching after fork from child process 10856]
[New Thread 0xb2197440 (LWP 10861)]
[New Thread 0xb2197440 (LWP 10862)]
[Thread 0xb2197440 (LWP 10861) exited]
[New Thread 0xb2197440 (LWP 10863)]
[Thread 0xb2197440 (LWP 10862) exited]
[Thread 0xb2197440 (LWP 10863) exited]
[New Thread 0xb2197440 (LWP 10864)]
[Thread 0xb2197440 (LWP 10864) exited]
[New Thread 0xb2197440 (LWP 10865)]
[New Thread 0xa17ff440 (LWP 10866)]
[New Thread 0x94dff440 (LWP 10867)]
Thread 1 "Audio Plugin Ex" received signal SIGSEGV, Segmentation fault.
0x0001ce08 in juce::StandaloneFilterWindow::StandaloneFilterWindow(juce::String const&, juce::Colour, juce::PropertySet*, bool, juce::String const&, juce::AudioDeviceManager::AudioDeviceSetup const*, juce::Array<juce::StandalonePluginHolder::PluginInOuts, juce::DummyCriticalSection, 0> const&, bool)::{lambda()#1}::operator()() const ()
(gdb) bt 10
#0 0x0001ce08 in juce::StandaloneFilterWindow::StandaloneFilterWindow(juce::String const&, juce::Colour, juce::PropertySet*, bool, juce::String const&, juce::AudioDeviceManager::AudioDeviceSetup const*, juce::Array<juce::StandalonePluginHolder::PluginInOuts, juce::DummyCriticalSection, 0> const&, bool)::{lambda()#1}::operator()() const ()
#1 0x0001d138 in juce::StandaloneFilterWindow::StandaloneFilterWindow(juce::String const&, juce::Colour, juce::PropertySet*, bool, juce::String const&, juce::AudioDeviceManager::AudioDeviceSetup const*, juce::Array<juce::StandalonePluginHolder::PluginInOuts, juce::DummyCriticalSection, 0> const&, bool) ()
#2 0x0001f344 in juce::StandaloneFilterApp::createWindow() ()
#3 0x0001f3f0 in juce::StandaloneFilterApp::initialise(juce::String const&) ()
#4 0x0042d81c in juce::JUCEApplicationBase::initialiseApp() ()
#5 0x0018bfe0 in juce::JUCEApplication::initialiseApp() ()
#6 0x0042d6d0 in juce::JUCEApplicationBase::main() ()
#7 0x0042d654 in juce::JUCEApplicationBase::main(int, char const**) ()
#8 0x00017a74 in main ()
Again, this segfault only appears if you connect with the X11 forwarding disabled. If you SSH with X11 forwarding enabled everything will be fine.
Operating systems
Linux
What versions of the operating systems?
I am using Raspberry Pi OS. Here is the output of uname -a:
Linux raspberrypi 5.4.79-v7l+ #1373 SMP Mon Nov 23 13:27:40 GMT 2020 armv7l GNU/Linux
Also, I'm using gcc version 8.3.0 (Raspbian 8.3.0-6+rpi1) and GNU gdb (Raspbian 8.2.1-2) 8.2.1.
Architectures
ARM
Stacktrace
(gdb) bt 10
#0 0x0001ce08 in juce::StandaloneFilterWindow::StandaloneFilterWindow(juce::String const&, juce::Colour, juce::PropertySet*, bool, juce::String const&, juce::AudioDeviceManager::AudioDeviceSetup const*, juce::Array<juce::StandalonePluginHolder::PluginInOuts, juce::DummyCriticalSection, 0> const&, bool)::{lambda()#1}::operator()() const ()
#1 0x0001d138 in juce::StandaloneFilterWindow::StandaloneFilterWindow(juce::String const&, juce::Colour, juce::PropertySet*, bool, juce::String const&, juce::AudioDeviceManager::AudioDeviceSetup const*, juce::Array<juce::StandalonePluginHolder::PluginInOuts, juce::DummyCriticalSection, 0> const&, bool) ()
#2 0x0001f344 in juce::StandaloneFilterApp::createWindow() ()
#3 0x0001f3f0 in juce::StandaloneFilterApp::initialise(juce::String const&) ()
#4 0x0042d81c in juce::JUCEApplicationBase::initialiseApp() ()
#5 0x0018bfe0 in juce::JUCEApplication::initialiseApp() ()
#6 0x0042d6d0 in juce::JUCEApplicationBase::main() ()
#7 0x0042d654 in juce::JUCEApplicationBase::main(int, char const**) ()
#8 0x00017a74 in main ()
Plug-in formats (if applicable)
Standalone
Plug-in host applications (DAWs) (if applicable)
No response
Testing on the develop branch
The bug is present on the develop branch
Code of Conduct
- [X] I agree to follow the Code of Conduct
Some time ago I already opened an issue in the JUCE forum for this: https://forum.juce.com/t/segmentation-fault-on-linux-for-headless-run-on-rpi4/43524/4
There was a fix for the underlying issue in this commit. This fix did not work for me though.