plugdata-team / plugdata

Pure Data as a plugin, with a new GUI
https://plugdata.org
GNU General Public License v3.0
1.54k stars 66 forks source link

Bug: segfault when typing `hv` in object box #1294

Closed dromer closed 11 months ago

dromer commented 11 months ago

Something wrong with recognizing heavy abstractions? Happens both with and without compiled mode on.

Can still select these objects from the dropdown or object browser.

I also see this in the console:

0 Look and feel has changed
Segmentation fault

Quick trace without debugging on (will try a new build with it enabled):

Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Detaching after fork from child process 1947561]
[Detaching after fork from child process 1947568]
[Detaching after fork from child process 1947572]
[New Thread 0x7ffff5d176c0 (LWP 1947576)]
[Thread 0x7ffff5d176c0 (LWP 1947576) exited]
[New Thread 0x7ffff5d176c0 (LWP 1947577)]
[Thread 0x7ffff5d176c0 (LWP 1947577) exited]
[New Thread 0x7ffff5d176c0 (LWP 1947578)]
[New Thread 0x7ffff55166c0 (LWP 1947579)]
[New Thread 0x7ffff4d156c0 (LWP 1947580)]
[New Thread 0x7ffff61096c0 (LWP 1947581)]
[New Thread 0x7ffff44206c0 (LWP 1947582)]
[Thread 0x7ffff44206c0 (LWP 1947582) exited]
[Thread 0x7ffff61096c0 (LWP 1947581) exited]
[New Thread 0x7ffff61096c0 (LWP 1947583)]
[New Thread 0x7ffff44206c0 (LWP 1947584)]
[Thread 0x7ffff44206c0 (LWP 1947584) exited]
[Thread 0x7ffff61096c0 (LWP 1947583) exited]
[New Thread 0x7ffff61096c0 (LWP 1947585)]
[New Thread 0x7ffff44206c0 (LWP 1947586)]
[New Thread 0x7ffff439f6c0 (LWP 1947587)]
[New Thread 0x7ffff431e6c0 (LWP 1947588)]
[New Thread 0x7ffff429d6c0 (LWP 1947589)]
[New Thread 0x7fffeffff6c0 (LWP 1947590)]
[New Thread 0x7fffef7fe6c0 (LWP 1947591)]
0 Look and feel has changed
[New Thread 0x7fffeeffd6c0 (LWP 1947592)]
[New Thread 0x7fffee7fc6c0 (LWP 1947593)]

Thread 1 "plugdata" received signal SIGSEGV, Segmentation fault.
0x000055555587f8ec in void std::__introsort_loop<juce::String*, long, __gnu_cxx::__ops::_Iter_comp_iter<juce::SortFunctionConverter<SuggestionComponent::textEditorTextChanged(juce::TextEditor&)::ObjectSorter> > >(juce::String*, juce::String*, long, __gnu_cxx::__ops::_Iter_comp_iter<juce::SortFunctionConverter<SuggestionComponent::textEditorTextChanged(juce::TextEditor&)::ObjectSorter> >) ()
(gdb) bt
#0  0x000055555587f8ec in void std::__introsort_loop<juce::String*, long, __gnu_cxx::__ops::_Iter_comp_iter<juce::SortFunctionConverter<SuggestionComponent::textEditorTextChanged(juce::TextEditor&)::ObjectSorter> > >(juce::String*, juce::String*, long, __gnu_cxx::__ops::_Iter_comp_iter<juce::SortFunctionConverter<SuggestionComponent::textEditorTextChanged(juce::TextEditor&)::ObjectSorter> >) ()
#1  0x000055555582254a in SuggestionComponent::textEditorTextChanged(juce::TextEditor&) [clone .lto_priv.0] ()
#2  0x0000555555a1c78b in juce::TextEditor::handleCommandMessage(int) ()
#3  0x0000555555ae8b47 in std::_Function_handler<void (int), juce::InternalMessageQueue::InternalMessageQueue()::{lambda(int)#1}>::_M_invoke(std::_Any_data const&, int&&) ()
#4  0x0000555555ae8480 in std::_Function_handler<void (), juce::LinuxEventLoop::registerFdCallback(int, std::function<void (int)>, short)::{lambda()#1}>::_M_invoke(std::_Any_data const&) [clone .lto_priv.0] ()
#5  0x000055555569731c in main ()
dromer commented 11 months ago

Now trace with debugging:

Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
JUCE v7.0.8
[Detaching after fork from child process 1962024]
[Detaching after fork from child process 1962031]
[Detaching after fork from child process 1962035]
[New Thread 0x7ffff5d176c0 (LWP 1962039)]
[Thread 0x7ffff5d176c0 (LWP 1962039) exited]
[New Thread 0x7ffff5d176c0 (LWP 1962040)]
[Thread 0x7ffff5d176c0 (LWP 1962040) exited]
[New Thread 0x7ffff5d176c0 (LWP 1962041)]
[New Thread 0x7ffff55166c0 (LWP 1962042)]
[New Thread 0x7ffff4d156c0 (LWP 1962044)]
[New Thread 0x7ffff61096c0 (LWP 1962045)]
[New Thread 0x7ffff44206c0 (LWP 1962046)]
[Thread 0x7ffff44206c0 (LWP 1962046) exited]
[Thread 0x7ffff61096c0 (LWP 1962045) exited]
[New Thread 0x7ffff61096c0 (LWP 1962047)]
[New Thread 0x7ffff44206c0 (LWP 1962048)]
[Thread 0x7ffff44206c0 (LWP 1962048) exited]
[Thread 0x7ffff61096c0 (LWP 1962047) exited]
[New Thread 0x7ffff61096c0 (LWP 1962049)]
[New Thread 0x7ffff44206c0 (LWP 1962050)]
[New Thread 0x7ffff439f6c0 (LWP 1962051)]
[New Thread 0x7ffff431e6c0 (LWP 1962052)]
[New Thread 0x7ffff429d6c0 (LWP 1962053)]
[New Thread 0x7fffeffff6c0 (LWP 1962054)]
[New Thread 0x7fffef7fe6c0 (LWP 1962055)]
0 Look and feel has changed
[New Thread 0x7fffeeffd6c0 (LWP 1962056)]
[New Thread 0x7fffee7fc6c0 (LWP 1962057)]

Thread 1 "plugdata" received signal SIGSEGV, Segmentation fault.
0x000055555587d509 in std::__atomic_base<int>::operator++ (this=0x447c35270) at /usr/include/c++/12/bits/atomic_base.h:385
385       { return __atomic_add_fetch(&_M_i, 1, int(memory_order_seq_cst)); }
(gdb) bt
#0  0x000055555587d509 in std::__atomic_base<int>::operator++ (this=0x447c35270) at /usr/include/c++/12/bits/atomic_base.h:385
#1  0x000055555614e4aa in juce::StringHolderUtils::retain (text=...) at /home/dreamer/Sources/_audio/_plugins/plugdata/Libraries/JUCE/modules/juce_core/text/juce_String.cpp:157
#2  0x0000555556108b39 in juce::String::String (this=0x7fffffffcf28, other=...) at /home/dreamer/Sources/_audio/_plugins/plugdata/Libraries/JUCE/modules/juce_core/text/juce_String.cpp:245
#3  0x0000555555a4bbd5 in __gnu_cxx::__ops::_Iter_comp_iter<juce::SortFunctionConverter<SuggestionComponent::textEditorTextChanged(juce::TextEditor&)::ObjectSorter> >::operator()<juce::String*, juce::String*>(juce::String*, juce::String*) (this=0x7fffffffcf50, __it1=0x55555c6fc320, __it2=0x55555c6fc280) at /usr/include/c++/12/bits/predefined_ops.h:158
#4  0x0000555555a4c697 in std::__unguarded_partition<juce::String*, __gnu_cxx::__ops::_Iter_comp_iter<juce::SortFunctionConverter<SuggestionComponent::textEditorTextChanged(juce::TextEditor&)::ObjectSorter> > >(juce::String*, juce::String*, juce::String*, __gnu_cxx::__ops::_Iter_comp_iter<juce::SortFunctionConverter<SuggestionComponent::textEditorTextChanged(juce::TextEditor&)::ObjectSorter> >) (__first=0x55555c6fc320, __last=0x55555c6fc320, __pivot=0x55555c6fc280, __comp=...) at /usr/include/c++/12/bits/stl_algo.h:1867
#5  0x0000555555a4ac3e in std::__unguarded_partition_pivot<juce::String*, __gnu_cxx::__ops::_Iter_comp_iter<juce::SortFunctionConverter<SuggestionComponent::textEditorTextChanged(juce::TextEditor&)::ObjectSorter> > >(juce::String*, juce::String*, __gnu_cxx::__ops::_Iter_comp_iter<juce::SortFunctionConverter<SuggestionComponent::textEditorTextChanged(juce::TextEditor&)::ObjectSorter> >) (__first=0x55555c6fc280, __last=0x55555c6fc320, __comp=...) at /usr/include/c++/12/bits/stl_algo.h:1889
#6  0x0000555555a48e54 in std::__introsort_loop<juce::String*, long, __gnu_cxx::__ops::_Iter_comp_iter<juce::SortFunctionConverter<SuggestionComponent::textEditorTextChanged(juce::TextEditor&)::ObjectSorter> > >(juce::String*, juce::String*, long, __gnu_cxx::__ops::_Iter_comp_iter<juce::SortFunctionConverter<SuggestionComponent::textEditorTextChanged(juce::TextEditor&)::ObjectSorter> >) (__first=0x55555c6fc280, __last=0x55555c6fc320, __depth_limit=7, __comp=...) at /usr/include/c++/12/bits/stl_algo.h:1921
#7  0x0000555555a467a5 in std::__sort<juce::String*, __gnu_cxx::__ops::_Iter_comp_iter<juce::SortFunctionConverter<SuggestionComponent::textEditorTextChanged(juce::TextEditor&)::ObjectSorter> > >(juce::String*, juce::String*, __gnu_cxx::__ops::_Iter_comp_iter<juce::SortFunctionConverter<SuggestionComponent::textEditorTextChanged(juce::TextEditor&)::ObjectSorter> >) (
    __first=0x55555c6fc280, __last=0x55555c6fc320, __comp=...) at /usr/include/c++/12/bits/stl_algo.h:1937
#8  0x0000555555a42a5b in std::sort<juce::String*, juce::SortFunctionConverter<SuggestionComponent::textEditorTextChanged(juce::TextEditor&)::ObjectSorter> >(juce::String*, juce::String*, juce::SortFunctionConverter<SuggestionComponent::textEditorTextChanged(juce::TextEditor&)::ObjectSorter>) (__first=0x55555c6fc280, __last=0x55555c6fc320, __comp=...)
    at /usr/include/c++/12/bits/stl_algo.h:4853
#9  0x0000555555a213dd in juce::sortArray<juce::String, SuggestionComponent::textEditorTextChanged(juce::TextEditor&)::ObjectSorter>(ObjectSorter &, juce::String *, int, int, bool) (
    comparator=..., array=0x55555c6fc280, firstElement=0, lastElement=19, retainOrderOfEquivalentItems=false)
    at /home/dreamer/Sources/_audio/_plugins/plugdata/Libraries/JUCE/modules/juce_core/containers/juce_ElementComparator.h:96
#10 0x0000555555a3a211 in juce::Array<juce::String, juce::DummyCriticalSection, 0>::sort<SuggestionComponent::textEditorTextChanged(juce::TextEditor&)::ObjectSorter>(SuggestionComponent::textEditorTextChanged(juce::TextEditor&)::ObjectSorter&, bool) (this=0x7fffffffd450, comparator=..., retainOrderOfEquivalentItems=false)
    at /home/dreamer/Sources/_audio/_plugins/plugdata/Libraries/JUCE/modules/juce_core/containers/juce_Array.h:1157
#11 0x0000555555a32cac in SuggestionComponent::textEditorTextChanged(juce::TextEditor&)::{lambda(juce::String, juce::StringArray)#1}::operator()(juce::String, juce::StringArray) const (
    __closure=0x7fffffffd29f, query=..., suggestions=...) at /home/dreamer/Sources/_audio/_plugins/plugdata/Source/Components/SuggestionComponent.h:574
#12 0x0000555555a34b45 in SuggestionComponent::textEditorTextChanged (this=0x55555bb0bad0, e=...)
    at /home/dreamer/Sources/_audio/_plugins/plugdata/Source/Components/SuggestionComponent.h:714
#13 0x0000555555e6305f in operator() (__closure=0x7fffffffd600, l=...)
    at /home/dreamer/Sources/_audio/_plugins/plugdata/Libraries/JUCE/modules/juce_gui_basics/widgets/juce_TextEditor.cpp:2264
#14 0x0000555555e812ac in juce::ListenerList<juce::TextEditor::Listener, juce::Array<juce::TextEditor::Listener*, juce::DummyCriticalSection, 0> >::callChecked<juce::TextEditor::handleCommandMessage(int)::<lambda(juce::TextEditor::Listener&)>, juce::Component::BailOutChecker>(const juce::Component::BailOutChecker &, struct {...} &&) (this=0x55555c74bbb8, bailOutChecker=..., 
    callback=...) at /home/dreamer/Sources/_audio/_plugins/plugdata/Libraries/JUCE/modules/juce_core/containers/juce_ListenerList.h:182
#15 0x0000555555e63196 in juce::TextEditor::handleCommandMessage (this=0x55555c74b8b0, commandId=268447745)
    at /home/dreamer/Sources/_audio/_plugins/plugdata/Libraries/JUCE/modules/juce_gui_basics/widgets/juce_TextEditor.cpp:2264
#16 0x0000555555de74c9 in operator() (__closure=0x55555c809650) at /home/dreamer/Sources/_audio/_plugins/plugdata/Libraries/JUCE/modules/juce_gui_basics/components/juce_Component.cpp:2025
#17 0x0000555555e8d754 in std::__invoke_impl<void, juce::Component::postCommandMessage(int)::<lambda()>&>(std::__invoke_other, struct {...} &) (__f=...)
    at /usr/include/c++/12/bits/invoke.h:61
--Type <RET> for more, q to quit, c to continue without paging--
#18 0x0000555555e87e62 in std::__invoke_r<void, juce::Component::postCommandMessage(int)::<lambda()>&>(struct {...} &) (__fn=...) at /usr/include/c++/12/bits/invoke.h:111
#19 0x0000555555e82eb9 in std::_Function_handler<void(), juce::Component::postCommandMessage(int)::<lambda()> >::_M_invoke(const std::_Any_data &) (__functor=...)
    at /usr/include/c++/12/bits/std_function.h:290
#20 0x00005555558c8344 in std::function<void ()>::operator()() const (this=0x55555c7883e0) at /usr/include/c++/12/bits/std_function.h:591
#21 0x00005555560c9222 in AsyncCallInvoker::messageCallback (this=0x55555c7883d0)
    at /home/dreamer/Sources/_audio/_plugins/plugdata/Libraries/JUCE/modules/juce_events/messages/juce_MessageManager.cpp:200
#22 0x00005555560d3a36 in juce::InternalMessageQueue::InternalMessageQueue()::{lambda(int)#1}::operator()(int) const (__closure=0x55555b9ecf50, fd=4)
    at /home/dreamer/Sources/_audio/_plugins/plugdata/Libraries/JUCE/modules/juce_events/native/juce_Messaging_linux.cpp:42
#23 0x00005555560e5230 in std::__invoke_impl<void, juce::InternalMessageQueue::InternalMessageQueue()::{lambda(int)#1}&, int>(std::__invoke_other, juce::InternalMessageQueue::InternalMessageQueue()::{lambda(int)#1}&, int&&) (__f=...) at /usr/include/c++/12/bits/invoke.h:61
#24 0x00005555560e1d47 in std::__invoke_r<void, juce::InternalMessageQueue::InternalMessageQueue()::{lambda(int)#1}&, int>(juce::InternalMessageQueue::InternalMessageQueue()::{lambda(int)#1}&, int&&) (__fn=...) at /usr/include/c++/12/bits/invoke.h:111
#25 0x00005555560dce50 in std::_Function_handler<void (int), juce::InternalMessageQueue::InternalMessageQueue()::{lambda(int)#1}>::_M_invoke(std::_Any_data const&, int&&) (__functor=..., 
    __args#0=@0x7fffffffd7d4: 4) at /usr/include/c++/12/bits/std_function.h:290
#26 0x000055555599d7a4 in std::function<void (int)>::operator()(int) const (this=0x55555b9ecf50, __args#0=4) at /usr/include/c++/12/bits/std_function.h:591
#27 0x00005555560ceb0b in operator() (__closure=0x55555b9ecf50) at /home/dreamer/Sources/_audio/_plugins/plugdata/Libraries/JUCE/modules/juce_events/native/juce_Messaging_linux.cpp:360
#28 0x00005555560cf9e6 in std::__invoke_impl<void, juce::LinuxEventLoop::registerFdCallback(int, std::function<void(int)>, short int)::<lambda()>&>(std::__invoke_other, struct {...} &) (
    __f=...) at /usr/include/c++/12/bits/invoke.h:61
#29 0x00005555560cf4a6 in std::__invoke_r<void, juce::LinuxEventLoop::registerFdCallback(int, std::function<void(int)>, short int)::<lambda()>&>(struct {...} &) (__fn=...)
    at /usr/include/c++/12/bits/invoke.h:111
#30 0x00005555560cf183 in std::_Function_handler<void(), juce::LinuxEventLoop::registerFdCallback(int, std::function<void(int)>, short int)::<lambda()> >::_M_invoke(const std::_Any_data &) (
    __functor=...) at /usr/include/c++/12/bits/std_function.h:290
#31 0x00005555558c8344 in std::function<void ()>::operator()() const (this=0x55555b9ef620) at /usr/include/c++/12/bits/std_function.h:591
#32 0x00005555560d428b in juce::InternalRunLoop::dispatchPendingEvents (this=0x55555b9ecea0)
    at /home/dreamer/Sources/_audio/_plugins/plugdata/Libraries/JUCE/modules/juce_events/native/juce_Messaging_linux.cpp:180
#33 0x00005555560ceabe in juce::detail::dispatchNextMessageOnSystemQueue (returnIfNoPendingMessages=false)
    at /home/dreamer/Sources/_audio/_plugins/plugdata/Libraries/JUCE/modules/juce_events/native/juce_Messaging_linux.cpp:342
#34 0x00005555560c8fd5 in juce::MessageManager::runDispatchLoop (this=0x55555b9cd7b0)
    at /home/dreamer/Sources/_audio/_plugins/plugdata/Libraries/JUCE/modules/juce_events/messages/juce_MessageManager.cpp:112
#35 0x00005555560c85c8 in juce::JUCEApplicationBase::main () at /home/dreamer/Sources/_audio/_plugins/plugdata/Libraries/JUCE/modules/juce_events/messages/juce_ApplicationBase.cpp:265
#36 0x00005555560c84d6 in juce::JUCEApplicationBase::main (argc=1, argv=0x7fffffffdaa8)
    at /home/dreamer/Sources/_audio/_plugins/plugdata/Libraries/JUCE/modules/juce_events/messages/juce_ApplicationBase.cpp:243
#37 0x0000555555865174 in main (argc=1, argv=0x7fffffffdaa8) at /home/dreamer/Sources/_audio/_plugins/plugdata/Source/Standalone/PlugDataApp.cpp:281
dromer commented 11 months ago

Happens on the 0.8.1 release builds, so somewhat critical.

dromer commented 11 months ago

After a git bisect round the offending commit is unsurprisingly https://github.com/plugdata-team/plugdata/commit/460e049d98bf9a369e6a85062f6b3ceb41ca19df

It's unclear what it was supposed to "fix", but right now it's definitely much more broken :thinking:

timothyschoen commented 11 months ago

Thanks for finding this, I reverted the change now