rorywalsh / cabbage

Framework for developing audio plugins with the Csound programming language.
http://cabbageaudio.com
GNU General Public License v3.0
503 stars 35 forks source link

Cabbage crashes with gcc11 #121

Closed KottV closed 2 years ago

KottV commented 3 years ago

Hi!

Cabbage compiled with gcc/g++ 11 crashing on startup. It might be difficult to find the bug. Anyway here is the backtrace:

gdb /usr/bin/Cabbage
GNU gdb (GDB; openSUSE Tumbleweed) 10.1
Copyright (C) 2020 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 "x86_64-suse-linux".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://bugs.opensuse.org/>.
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 /usr/bin/Cabbage...
Reading symbols from /usr/lib/debug/usr/bin/Cabbage-2.6.8-1.2.x86_64.debug...
(gdb) run
Starting program: /usr/bin/Cabbage 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[Detaching after fork from child process 18510]
[Detaching after fork from child process 18511]
[New Thread 0x7ffff6413640 (LWP 18514)]
[New Thread 0x7ffff5bf7640 (LWP 18515)]
[Thread 0x7ffff5bf7640 (LWP 18515) exited]
[New Thread 0x7ffff5bf7640 (LWP 18516)]
[Thread 0x7ffff6413640 (LWP 18514) exited]
[New Thread 0x7ffff5038640 (LWP 18551)]
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
[Thread 0x7ffff5038640 (LWP 18551) exited]
[New Thread 0x7ffff6413640 (LWP 18552)]
[New Thread 0x7ffff4fb7640 (LWP 18553)]
[New Thread 0x7fffe7fff640 (LWP 18554)]
[Thread 0x7fffe7fff640 (LWP 18554) exited]
[New Thread 0x7fffe7fff640 (LWP 18555)]

Thread 1 "Cabbage" received signal SIGSEGV, Segmentation fault.
0x0000555555b94008 in juce::RenderingHelpers::SavedStateBase<juce::RenderingHelpers::SoftwareRendererSavedState>::fillRectList(juce::RectangleList<float> const&) ()
(gdb) bt
#0  0x0000555555b94008 in juce::RenderingHelpers::SavedStateBase<juce::RenderingHelpers::SoftwareRendererSavedState>::fillRectList(juce::RectangleList<float> const&) ()
#1  0x0000555555cf1f41 in juce::CodeEditorComponent::paint(juce::Graphics&) ()
#2  0x0000555555c2a0d4 in juce::Component::paintComponentAndChildren(juce::Graphics&) ()
#3  0x0000555555c2a177 in juce::Component::paintComponentAndChildren(juce::Graphics&) ()
#4  0x0000555555c2a177 in juce::Component::paintComponentAndChildren(juce::Graphics&) ()
#5  0x0000555555c2a177 in juce::Component::paintComponentAndChildren(juce::Graphics&) ()
#6  0x0000555555c2bcd3 in juce::ComponentPeer::handlePaint(juce::LowLevelGraphicsContext&) ()
#7  0x0000555555cba3d3 in juce::LinuxComponentPeer::LinuxRepaintManager::performAnyPendingRepaintsNow() ()
#8  0x0000555555aecd79 in juce::Timer::TimerThread::CallTimersMessage::messageCallback() ()
#9  0x0000555555aecbba in std::_Function_handler<void (int), juce::InternalMessageQueue::InternalMessageQueue()::{lambda(int)#1}>::_M_invoke(std::_Any_data const&, int&&) ()
#10 0x0000555555aeb73f in juce::MessageManager::runDispatchLoop() ()
#11 0x000055555577e1bd in juce::JUCEApplicationBase::main() ()
#12 0x00007ffff73d4b35 in __libc_start_main (main=0x5555557785d0 <main>, argc=1, argv=0x7fffffffdb58, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffdb48) at ../csu/libc-start.c:332
#13 0x000055555577fc2e in _start () at ../sysdeps/x86_64/start.S:120
(gdb) 

openSUSE Tumbleweed gcc-g++ 11.1.1

Glad to provide any additional info.

rorywalsh commented 3 years ago

Are you working off the master, or dev branch? It is safe to work from the dev branch.

I have no such issues on my Ubuntu machine. When you run the build script, the makefiles that are generated for the main Cabbage application use -std=c++14. Do you purposely change this back to c++11? The error looks like a rendering painting issue. And unfortunately for us, no Cabbage methods appear in the backtrace. It is possible that this is an issue that has been resolved in newer versions of JUCE. Cabbage uses 5.4.7 which is pretty old at this point. You can try updating to version 6.n and see if that helps?

KottV commented 3 years ago

Are you working off the master, or dev branch?

on dev

I have no such issues on my Ubuntu machine.

What gcc (or clang?) version do you have?

Cabbage uses 5.4.7 which is pretty old at this point.

Highly likely.

You can try updating to version 6.n and see if that helps?

I didn't try, but I will. Is the Cabbage updated to JUCE 6? Many stuff has been changed there.

KottV commented 3 years ago

Oh, I mean gcc version 11 https://gcc.gnu.org/gcc-11/ not the c++-11 standard.

rorywalsh commented 3 years ago

Oh, I mean gcc version 11 https://gcc.gnu.org/gcc-11/ not the c++-11 standard.

Ah, I see. Hmm, I'm still using 7.5.0, because I'm still using 18.04. Even if I update now the standard install for 20 is version 9 I think. I'll be honest, I'm not sure I want to jeopardise the multitude of different builds system I have running here with an update to a newer version of gcc 😬

I didn't try, but I will. Is the Cabbage updated to JUCE 6? Many stuff has been changed there.

I accidentally build with version 6 a few months back and it build Ok from what I remember. But you are right, it may need some tweaking..

KottV commented 2 years ago

not reproducible anymore with JUCE 6