Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std::bad_alloc with Ardour and play-loop #1

Closed
thorwil opened this issue Feb 11, 2016 · 22 comments
Closed

std::bad_alloc with Ardour and play-loop #1

thorwil opened this issue Feb 11, 2016 · 22 comments

Comments

@thorwil
Copy link

thorwil commented Feb 11, 2016

After no response on IRC, I tried to report this on Sourceforge, but creating a ticket there failed with 405, method not allowed.

Segfault of Ardour (current git) with terminate called after throwing an instance of 'std::bad_alloc', when the end of the loop range is reached during play-loop and a LV2 instance of synthv1 is enabled. No crash if the plugin is disabled.

The Ardour/play-loop/synthv1 combination used to work, so either a recent Ardour update triggered the issue, or there must be another ingredient. I now have an Ardour session that will crash everytime if one just starts play-loop after loading. No such issue with other synth plugins.

Backtrace:

terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
Aborted (core dumped)
/media/hd/src/ardour_git/gtk2_ardour: ./ardbg
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Copyright (C) 2014 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-linux-gnu".
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 ./../build/gtk2_ardour/ardour-4.6.262...done.
(gdb) core-file core
[New LWP 10797]
[New LWP 10799]
[New LWP 10802]
[New LWP 10800]
[New LWP 10803]
[New LWP 10801]
[New LWP 10804]
[New LWP 10810]
[New LWP 10777]
[New LWP 10778]
[New LWP 10779]
[New LWP 10798]
[New LWP 10805]
[New LWP 10771]
[New LWP 10809]
[New LWP 10772]
[New LWP 10773]
[New LWP 10774]
[New LWP 10775]
[New LWP 10776]
[New LWP 10795]
[New LWP 10796]
[New LWP 10768]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Traceback (most recent call last):
  File "/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19-gdb.py", line 63, in <module>
    from libstdcxx.v6.printers import register_libstdcxx_printers
ImportError: No module named 'libstdcxx'
Core was generated by `./../build/gtk2_ardour/ardour-4.6.262 /media/hd/audio/cramned'.
Program terminated with signal SIGABRT, Aborted.
#0  0x00007f6733ea8cc9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56  ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) thread apply all bt

Thread 23 (Thread 0x7f673b87ba00 (LWP 10768)):
#0  0x00007f6733f5f12d in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007f6738173fe4 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f673817430a in g_main_loop_run () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f6737c19447 in gtk_main () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#4  0x00007f673ae733d6 in Gtkmm2ext::UI::run (this=0x35492d0, old_receiver=...) at ../libs/gtkmm2ext/gtk_ui.cc:284
#5  0x0000000000a41eca in main (argc=2, argv=0x7ffeed4064b8) at ../gtk2_ardour/main.cc:396

Thread 22 (Thread 0x7f6705bc6700 (LWP 10796)):
#0  0x00007f67355213bd in read () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007f6716bd404e in Jack::JackClientSocket::Read(void*, int) () from /usr/lib/libjack.so.0
#2  0x00007f6716bd7525 in Jack::JackClientNotification::Read(Jack::detail::JackChannelTransactionInterface*) () from /usr/lib/libjack.so.0
#3  0x00007f6716bd723a in Jack::JackSocketClientChannel::Execute() () from /usr/lib/libjack.so.0
#4  0x00007f6716bd1c1a in Jack::JackPosixThread::ThreadHandler(void*) () from /usr/lib/libjack.so.0
#5  0x00007f673551a182 in start_thread (arg=0x7f6705bc6700) at pthread_create.c:312
#6  0x00007f6733f6c47d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 21 (Thread 0x7f6705c47700 (LWP 10795)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f6716bd30dc in Jack::JackPosixProcessSync::Wait() () from /usr/lib/libjack.so.0
#2  0x00007f6716bcbdab in Jack::JackMessageBuffer::Execute() () from /usr/lib/libjack.so.0
#3  0x00007f6716bd1c1a in Jack::JackPosixThread::ThreadHandler(void*) () from /usr/lib/libjack.so.0
#4  0x00007f673551a182 in start_thread (arg=0x7f6705c47700) at pthread_create.c:312
#5  0x00007f6733f6c47d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 20 (Thread 0x7f67177fe700 (LWP 10776)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f67381b5bf7 in g_cond_wait () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f673a14aef0 in ARDOUR::AudioEngine::do_devicelist_update (this=0x357cda0) at ../libs/ardour/audioengine.cc:559
#3  0x00007f673a156ee5 in boost::_mfi::mf0<void, ARDOUR::AudioEngine>::operator() (this=0x362cce0, p=0x357cda0)
    at /usr/include/boost/bind/mem_fn_template.hpp:49
#4  0x00007f673a156b26 in boost::_bi::list1<boost::_bi::value<ARDOUR::AudioEngine*> >::operator()<boost::_mfi::mf0<void, ARDOUR::AudioEngine>, boost::_bi::list0> (this=0x362ccf0, f=..., a=...) at /usr/include/boost/bind/bind.hpp:253
#5  0x00007f673a15648f in boost::_bi::bind_t<void, boost::_mfi::mf0<void, ARDOUR::AudioEngine>, boost::_bi::list1<boost::_bi::value<ARDOUR::AudioEngine*> > >::operator() (this=0x362cce0) at /usr/include/boost/bind/bind_template.hpp:20
#6  0x00007f673a155c66 in sigc::adaptor_functor<boost::_bi::bind_t<void, boost::_mfi::mf0<void, ARDOUR::AudioEngine>, boost::_bi::list1<boost::_bi::value<ARDOUR::AudioEngine*> > > >::operator() (this=0x362cce0) at /usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:251
#7  0x00007f673a154e78 in sigc::internal::slot_call0<boost::_bi::bind_t<void, boost::_mfi::mf0<void, ARDOUR::AudioEngine>, boost::_bi::list1<boost::_bi::value<ARDOUR::AudioEngine*> > >, void>::call_it (rep=0x362ccb0) at /usr/include/sigc++-2.0/sigc++/functors/slot.h:103
---Type <return> to continue, or q <return> to quit---
#8  0x00007f67388cb11d in ?? () from /usr/lib/x86_64-linux-gnu/libglibmm-2.4.so.1
#9  0x00007f6738198f05 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#10 0x00007f673551a182 in start_thread (arg=0x7f67177fe700) at pthread_create.c:312
#11 0x00007f6733f6c47d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 19 (Thread 0x7f6717fff700 (LWP 10775)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f67381b5bf7 in g_cond_wait () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f673a14accf in ARDOUR::AudioEngine::do_reset_backend (this=0x357cda0) at ../libs/ardour/audioengine.cc:524
#3  0x00007f673a156ee5 in boost::_mfi::mf0<void, ARDOUR::AudioEngine>::operator() (this=0x362c2d0, p=0x357cda0)
    at /usr/include/boost/bind/mem_fn_template.hpp:49
#4  0x00007f673a156b26 in boost::_bi::list1<boost::_bi::value<ARDOUR::AudioEngine*> >::operator()<boost::_mfi::mf0<void, ARDOUR::AudioEngine>, boost::_bi::list0> (this=0x362c2e0, f=..., a=...) at /usr/include/boost/bind/bind.hpp:253
#5  0x00007f673a15648f in boost::_bi::bind_t<void, boost::_mfi::mf0<void, ARDOUR::AudioEngine>, boost::_bi::list1<boost::_bi::value<ARDOUR::AudioEngine*> > >::operator() (this=0x362c2d0) at /usr/include/boost/bind/bind_template.hpp:20
#6  0x00007f673a155c66 in sigc::adaptor_functor<boost::_bi::bind_t<void, boost::_mfi::mf0<void, ARDOUR::AudioEngine>, boost::_bi::list1<boost::_bi::value<ARDOUR::AudioEngine*> > > >::operator() (this=0x362c2d0) at /usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:251
#7  0x00007f673a154e78 in sigc::internal::slot_call0<boost::_bi::bind_t<void, boost::_mfi::mf0<void, ARDOUR::AudioEngine>, boost::_bi::list1<boost::_bi::value<ARDOUR::AudioEngine*> > >, void>::call_it (rep=0x362c2a0) at /usr/include/sigc++-2.0/sigc++/functors/slot.h:103
#8  0x00007f67388cb11d in ?? () from /usr/lib/x86_64-linux-gnu/libglibmm-2.4.so.1
#9  0x00007f6738198f05 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#10 0x00007f673551a182 in start_thread (arg=0x7f6717fff700) at pthread_create.c:312
#11 0x00007f6733f6c47d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 18 (Thread 0x7f672626b700 (LWP 10774)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f67381b5bf7 in g_cond_wait () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f673a0fbe98 in ARDOUR::Analyser::work () at ../libs/ardour/analyser.cc:86
#3  0x00007f673a0fbc8d in analyser_work () at ../libs/ardour/analyser.cc:51
#4  0x0000000000c561e9 in sigc::pointer_functor0<void>::operator() (this=0x36373a8) at /usr/include/sigc++-2.0/sigc++/functors/ptr_fun.h:77
#5  0x0000000000c535a8 in sigc::adaptor_functor<sigc::pointer_functor0<void> >::operator() (this=0x36373a0)
    at /usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:251
#6  0x0000000000c4feaf in sigc::internal::slot_call0<sigc::pointer_functor0<void>, void>::call_it (rep=0x3637370)
    at /usr/include/sigc++-2.0/sigc++/functors/slot.h:103
#7  0x00007f67388cb11d in ?? () from /usr/lib/x86_64-linux-gnu/libglibmm-2.4.so.1
#8  0x00007f6738198f05 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#9  0x00007f673551a182 in start_thread (arg=0x7f672626b700) at pthread_create.c:312
#10 0x00007f6733f6c47d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 17 (Thread 0x7f6726a6c700 (LWP 10773)):
---Type <return> to continue, or q <return> to quit---
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f67381b5bf7 in g_cond_wait () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f673a569288 in peak_thread_work () at ../libs/ardour/source_factory.cc:71
#3  0x0000000000c561e9 in sigc::pointer_functor0<void>::operator() (this=0x3538198) at /usr/include/sigc++-2.0/sigc++/functors/ptr_fun.h:77
#4  0x0000000000c535a8 in sigc::adaptor_functor<sigc::pointer_functor0<void> >::operator() (this=0x3538190)
    at /usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:251
#5  0x0000000000c4feaf in sigc::internal::slot_call0<sigc::pointer_functor0<void>, void>::call_it (rep=0x3538160)
    at /usr/include/sigc++-2.0/sigc++/functors/slot.h:103
#6  0x00007f67388cb11d in ?? () from /usr/lib/x86_64-linux-gnu/libglibmm-2.4.so.1
#7  0x00007f6738198f05 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#8  0x00007f673551a182 in start_thread (arg=0x7f6726a6c700) at pthread_create.c:312
#9  0x00007f6733f6c47d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 16 (Thread 0x7f672726d700 (LWP 10772)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f67381b5bf7 in g_cond_wait () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f673a569288 in peak_thread_work () at ../libs/ardour/source_factory.cc:71
#3  0x0000000000c561e9 in sigc::pointer_functor0<void>::operator() (this=0x36377a8) at /usr/include/sigc++-2.0/sigc++/functors/ptr_fun.h:77
#4  0x0000000000c535a8 in sigc::adaptor_functor<sigc::pointer_functor0<void> >::operator() (this=0x36377a0)
    at /usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:251
#5  0x0000000000c4feaf in sigc::internal::slot_call0<sigc::pointer_functor0<void>, void>::call_it (rep=0x3637770)
    at /usr/include/sigc++-2.0/sigc++/functors/slot.h:103
#6  0x00007f67388cb11d in ?? () from /usr/lib/x86_64-linux-gnu/libglibmm-2.4.so.1
#7  0x00007f6738198f05 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#8  0x00007f673551a182 in start_thread (arg=0x7f672726d700) at pthread_create.c:312
#9  0x00007f6733f6c47d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 15 (Thread 0x7f66c7ae9700 (LWP 10809)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f67381b5bf7 in g_cond_wait () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f673b218abf in ArdourCanvas::WaveView::drawing_thread () at ../libs/canvas/wave_view.cc:1543
#3  0x0000000000c561e9 in sigc::pointer_functor0<void>::operator() (this=0x15e73708) at /usr/include/sigc++-2.0/sigc++/functors/ptr_fun.h:77
#4  0x0000000000c535a8 in sigc::adaptor_functor<sigc::pointer_functor0<void> >::operator() (this=0x15e73700)
    at /usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:251
#5  0x0000000000c4feaf in sigc::internal::slot_call0<sigc::pointer_functor0<void>, void>::call_it (rep=0x15e736d0)
    at /usr/include/sigc++-2.0/sigc++/functors/slot.h:103
#6  0x00007f67388cb11d in ?? () from /usr/lib/x86_64-linux-gnu/libglibmm-2.4.so.1
#7  0x00007f6738198f05 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#8  0x00007f673551a182 in start_thread (arg=0x7f66c7ae9700) at pthread_create.c:312
#9  0x00007f6733f6c47d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
---Type <return> to continue, or q <return> to quit---

Thread 14 (Thread 0x7f6727a6e700 (LWP 10771)):
#0  0x00007f6735521b9d in nanosleep () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007f673819a498 in g_usleep () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x0000000000f26e02 in gui_event_loop (ptr=0x0) at ../gtk2_ardour/linux_vst_gui_support.cc:475
#3  0x00007f673551a182 in start_thread (arg=0x7f6727a6e700) at pthread_create.c:312
#4  0x00007f6733f6c47d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 13 (Thread 0x7f66c82ea700 (LWP 10805)):
#0  0x00007f6735521b9d in nanosleep () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007f673819a498 in g_usleep () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f673a19bbca in ARDOUR::AutomationWatch::thread (this=0x1814eb80) at ../libs/ardour/automation_watch.cc:153
#3  0x00007f673a19ef03 in boost::_mfi::mf0<void, ARDOUR::AutomationWatch>::operator() (this=0x89fb420, p=0x1814eb80)
    at /usr/include/boost/bind/mem_fn_template.hpp:49
#4  0x00007f673a19eb70 in boost::_bi::list1<boost::_bi::value<ARDOUR::AutomationWatch*> >::operator()<boost::_mfi::mf0<void, ARDOUR::AutomationWatch>, boost::_bi::list0> (this=0x89fb430, f=..., a=...) at /usr/include/boost/bind/bind.hpp:253
#5  0x00007f673a19e70b in boost::_bi::bind_t<void, boost::_mfi::mf0<void, ARDOUR::AutomationWatch>, boost::_bi::list1<boost::_bi::value<ARDOUR::AutomationWatch*> > >::operator() (this=0x89fb420) at /usr/include/boost/bind/bind_template.hpp:20
#6  0x00007f673a19e6a0 in sigc::adaptor_functor<boost::_bi::bind_t<void, boost::_mfi::mf0<void, ARDOUR::AutomationWatch>, boost::_bi::list1<boost::_bi::value<ARDOUR::AutomationWatch*> > > >::operator() (this=0x89fb420) at /usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:251
#7  0x00007f673a19e208 in sigc::internal::slot_call0<boost::_bi::bind_t<void, boost::_mfi::mf0<void, ARDOUR::AutomationWatch>, boost::_bi::list1<boost::_bi::value<ARDOUR::AutomationWatch*> > >, void>::call_it (rep=0x89fb3f0) at /usr/include/sigc++-2.0/sigc++/functors/slot.h:103
#8  0x00007f67388cb11d in ?? () from /usr/lib/x86_64-linux-gnu/libglibmm-2.4.so.1
#9  0x00007f6738198f05 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#10 0x00007f673551a182 in start_thread (arg=0x7f66c82ea700) at pthread_create.c:312
#11 0x00007f6733f6c47d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 12 (Thread 0x7f6705ac3800 (LWP 10798)):
#0  0x00007f6733f5f12d in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007f6738ffd37c in CrossThreadChannel::poll_for_request (this=0x4630db0) at ../libs/pbd/crossthread.posix.cc:80
#2  0x00007f6738ffd3e5 in CrossThreadChannel::receive (this=0x4630db0, msg=@0x7f6705ac2c00: 0 '\000', wait=true)
    at ../libs/pbd/crossthread.posix.cc:101
#3  0x00007f673a1af244 in ARDOUR::Butler::thread_work (this=0x4630d20) at ../libs/ardour/butler.cc:175
#4  0x00007f673a1af025 in ARDOUR::Butler::_thread_work (arg=0x4630d20) at ../libs/ardour/butler.cc:156
#5  0x00007f67390177c0 in fake_thread_start (arg=0xbbfa440) at ../libs/pbd/pthread_utils.cc:101
#6  0x00007f673551a182 in start_thread (arg=0x7f6705ac3800) at pthread_create.c:312
#7  0x00007f6733f6c47d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 11 (Thread 0x7f6706c9b700 (LWP 10779)):
#0  0x00007f6733f5f12d in poll () at ../sysdeps/unix/syscall-template.S:81
---Type <return> to continue, or q <return> to quit---
#1  0x00007f6738173fe4 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f67381740ec in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f6738174129 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007f6738198f05 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007f673551a182 in start_thread (arg=0x7f6706c9b700) at pthread_create.c:312
#6  0x00007f6733f6c47d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 10 (Thread 0x7f6714a04700 (LWP 10778)):
#0  0x00007f6733f5f12d in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007f6738173fe4 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f673817430a in g_main_loop_run () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f673114a336 in ?? () from /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#4  0x00007f6738198f05 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007f673551a182 in start_thread (arg=0x7f6714a04700) at pthread_create.c:312
#6  0x00007f6733f6c47d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 9 (Thread 0x7f6715205700 (LWP 10777)):
#0  0x00007f6733f5f12d in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007f6738173fe4 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f67381740ec in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f671520d1ad in ?? () from /usr/lib/x86_64-linux-gnu/gio/modules/libdconfsettings.so
#4  0x00007f6738198f05 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007f673551a182 in start_thread (arg=0x7f6715205700) at pthread_create.c:312
#6  0x00007f6733f6c47d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 8 (Thread 0x7f66c6ae7700 (LWP 10810)):
#0  pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:238
#1  0x00007f67381b5ce5 in g_cond_wait_until () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f673814a1c1 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f673814a74b in g_async_queue_timeout_pop () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007f6738199956 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007f6738198f05 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#6  0x00007f673551a182 in start_thread (arg=0x7f66c6ae7700) at pthread_create.c:312
#7  0x00007f6733f6c47d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 7 (Thread 0x7f66e52be700 (LWP 10804)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f673a50200c in ARDOUR::Session::emit_thread_run (this=0x4d926b0) at ../libs/ardour/session_process.cc:1313
#2  0x00007f673a501fb6 in ARDOUR::Session::emit_thread (arg=0x4d926b0) at ../libs/ardour/session_process.cc:1302
#3  0x00007f673551a182 in start_thread (arg=0x7f66e52be700) at pthread_create.c:312
---Type <return> to continue, or q <return> to quit---
#4  0x00007f6733f6c47d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 6 (Thread 0x7f66e62c0700 (LWP 10801)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007f66cf3f67fa in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#2  0x00007f66cfc68733 in synthv1_sched_thread::run() () from /usr/local/lib/lv2/synthv1.lv2/synthv1.so
#3  0x00007f66cf3f6233 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x00007f673551a182 in start_thread (arg=0x7f66e62c0700) at pthread_create.c:312
#5  0x00007f6733f6c47d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 5 (Thread 0x7f66c8cf0700 (LWP 10803)):
#0  0x00007f6733f5f12d in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007f6738173fe4 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f673817430a in g_main_loop_run () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f6738fe7d8b in BaseUI::main_thread (this=0x85740c8) at ../libs/pbd/base_ui.cc:86
#4  0x00007f6738feb9c6 in sigc::bound_mem_functor0<void, BaseUI>::operator() (this=0xa135788)
    at /usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:1787
#5  0x00007f6738feb71a in sigc::adaptor_functor<sigc::bound_mem_functor0<void, BaseUI> >::operator() (this=0xa135780)
    at /usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:251
#6  0x00007f6738feb245 in sigc::internal::slot_call0<sigc::bound_mem_functor0<void, BaseUI>, void>::call_it (rep=0xa135750)
    at /usr/include/sigc++-2.0/sigc++/functors/slot.h:103
#7  0x00007f67388cb11d in ?? () from /usr/lib/x86_64-linux-gnu/libglibmm-2.4.so.1
#8  0x00007f6738198f05 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#9  0x00007f673551a182 in start_thread (arg=0x7f66c8cf0700) at pthread_create.c:312
#10 0x00007f6733f6c47d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 4 (Thread 0x7f66e6ac1700 (LWP 10800)):
#0  0x00007f6733f63da3 in select () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007f66d0d057dd in ?? () from /usr/local/lib/lv2/Obxd.lv2/Obxd.so
#2  0x00007f66d0d05b4f in ?? () from /usr/local/lib/lv2/Obxd.lv2/Obxd.so
#3  0x00007f66d0ccde87 in ?? () from /usr/local/lib/lv2/Obxd.lv2/Obxd.so
#4  0x00007f66d0cfbc24 in ?? () from /usr/local/lib/lv2/Obxd.lv2/Obxd.so
#5  0x00007f66d0cfbe59 in ?? () from /usr/local/lib/lv2/Obxd.lv2/Obxd.so
#6  0x00007f673551a182 in start_thread (arg=0x7f66e6ac1700) at pthread_create.c:312
#7  0x00007f6733f6c47d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 3 (Thread 0x7f66e5abf700 (LWP 10802)):
#0  0x00007f6733f63da3 in select () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007f66ca9de65d in juce::MessageManager::dispatchNextMessageOnSystemQueue(bool) () from /usr/local/lib/lv2/helm.lv2/helm.so
#2  0x00007f66ca9de877 in juce::MessageManager::runDispatchLoop() () from /usr/local/lib/lv2/helm.lv2/helm.so
---Type <return> to continue, or q <return> to quit---
#3  0x00007f66cab73d97 in SharedMessageThread::run() () from /usr/local/lib/lv2/helm.lv2/helm.so
#4  0x00007f66ca99143a in juce::Thread::threadEntryPoint() () from /usr/local/lib/lv2/helm.lv2/helm.so
#5  0x00007f66ca9915c9 in threadEntryProc () from /usr/local/lib/lv2/helm.lv2/helm.so
#6  0x00007f673551a182 in start_thread (arg=0x7f66e5abf700) at pthread_create.c:312
#7  0x00007f6733f6c47d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 2 (Thread 0x7f670649a700 (LWP 10799)):
#0  0x00007f6733f5f12d in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007f6738173fe4 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f673817430a in g_main_loop_run () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f6738fe7d8b in BaseUI::main_thread (this=0xbbfa630) at ../libs/pbd/base_ui.cc:86
#4  0x00007f6738feb9c6 in sigc::bound_mem_functor0<void, BaseUI>::operator() (this=0xbbfaf58)
    at /usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:1787
#5  0x00007f6738feb71a in sigc::adaptor_functor<sigc::bound_mem_functor0<void, BaseUI> >::operator() (this=0xbbfaf50)
    at /usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:251
#6  0x00007f6738feb245 in sigc::internal::slot_call0<sigc::bound_mem_functor0<void, BaseUI>, void>::call_it (rep=0xbbfaf20)
    at /usr/include/sigc++-2.0/sigc++/functors/slot.h:103
#7  0x00007f67388cb11d in ?? () from /usr/lib/x86_64-linux-gnu/libglibmm-2.4.so.1
#8  0x00007f6738198f05 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#9  0x00007f673551a182 in start_thread (arg=0x7f670649a700) at pthread_create.c:312
#10 0x00007f6733f6c47d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thread 1 (Thread 0x7f6705b45700 (LWP 10797)):
#0  0x00007f6733ea8cc9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007f6733eac0d8 in __GI_abort () at abort.c:89
#2  0x00007f67347b3535 in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007f67347b16d6 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4  0x00007f67347b1703 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5  0x00007f67347b1922 in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6  0x00007f67347b1e0d in operator new(unsigned long) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#7  0x00007f67347b1ea9 in operator new[](unsigned long) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#8  0x00007f66cfc53210 in synthv1_impl::alloc_sfxs(unsigned int) () from /usr/local/lib/lv2/synthv1.lv2/synthv1.so
#9  0x00007f66cfc5db88 in synthv1_impl::process(float**, float**, unsigned int) () from /usr/local/lib/lv2/synthv1.lv2/synthv1.so
#10 0x00007f66cfc61074 in synthv1_lv2::run(unsigned int) () from /usr/local/lib/lv2/synthv1.lv2/synthv1.so
#11 0x00007f673a5a1746 in lilv_instance_run (instance=0x1bcbe3c0, sample_count=64) at /usr/local/include/lilv-0/lilv/lilv.h:1662
#12 0x00007f673a5adadf in ARDOUR::LV2Plugin::run (this=0x1bce9e00, nframes=64) at ../libs/ardour/lv2_plugin.cc:2397
#13 0x00007f673a5acd30 in ARDOUR::LV2Plugin::connect_and_run (this=0x1bce9e00, bufs=..., in_map=..., out_map=..., nframes=64, offset=0)
    at ../libs/ardour/lv2_plugin.cc:2216
#14 0x00007f673a3b9899 in ARDOUR::PluginInsert::connect_and_run (this=0x1bc876a0, bufs=..., nframes=64, offset=0, with_auto=true, now=8127936)
    at ../libs/ardour/plugin_insert.cc:442
---Type <return> to continue, or q <return> to quit---
#15 0x00007f673a3ba353 in ARDOUR::PluginInsert::automation_run (this=0x1bc876a0, bufs=..., start=8127936, nframes=64)
    at ../libs/ardour/plugin_insert.cc:566
#16 0x00007f673a3ba05a in ARDOUR::PluginInsert::run (this=0x1bc876a0, bufs=..., start_frame=8127936, nframes=64)
    at ../libs/ardour/plugin_insert.cc:506
#17 0x00007f673a429946 in ARDOUR::Route::process_output_buffers (this=0x1af462f0, bufs=..., start_frame=8127936, end_frame=8128000, nframes=64, 
    declick=-1, gain_automation_ok=true) at ../libs/ardour/route.cc:632
#18 0x00007f673a34f28f in ARDOUR::MidiTrack::roll (this=0x1af462f0, nframes=64, start_frame=8127936, end_frame=8128000, declick=-1, 
    need_butler=@0x7f6705b449e0: false) at ../libs/ardour/midi_track.cc:454
#19 0x00007f673a4fdd96 in ARDOUR::Session::process_routes (this=0x4d926b0, nframes=64, need_butler=@0x7f6705b44a3a: true)
    at ../libs/ardour/session_process.cc:203
#20 0x00007f673a4feab1 in ARDOUR::Session::process_with_events (this=0x4d926b0, nframes=64) at ../libs/ardour/session_process.cc:432
#21 0x00007f673a4fd3f1 in ARDOUR::Session::process (this=0x4d926b0, nframes=1024) at ../libs/ardour/session_process.cc:76
#22 0x00007f673a14a6b7 in ARDOUR::AudioEngine::process_callback (this=0x357cda0, nframes=1024) at ../libs/ardour/audioengine.cc:374
#23 0x00007f672417e648 in ARDOUR::JACKAudioBackend::process_thread (this=0x37bbf80) at ../libs/backends/jack/jack_audiobackend.cc:967
#24 0x00007f672417e5d0 in ARDOUR::JACKAudioBackend::_process_thread (arg=0x37bbf80) at ../libs/backends/jack/jack_audiobackend.cc:944
#25 0x00007f6716bb27cb in Jack::JackClient::Execute() () from /usr/lib/libjack.so.0
#26 0x00007f6716bd1c1a in Jack::JackPosixThread::ThreadHandler(void*) () from /usr/lib/libjack.so.0
#27 0x00007f673551a182 in start_thread (arg=0x7f6705b45700) at pthread_create.c:312
#28 0x00007f6733f6c47d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
(gdb)
@rncbc
Copy link
Owner

rncbc commented Feb 11, 2016

On 02/11/2016 08:55 AM, Thorsten Wilms wrote:

     Thread 1 (Thread 0x7f6705b45700 (LWP 10797)):
     #0 0x00007f6733ea8cc9 in __GI_raise > (sig=sig@entry=6)      at 
../nptl/sysdeps/unix/sysv/linux/raise.c:56
     #1 0x00007f6733eac0d8 in __GI_abort () at abort.c:89
     #2 0x00007f67347b3535 in __gnu_cxx::__verbose_terminate_handler() () 
from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
     #3 0x00007f67347b16d6 in ?? () from 
/usr/lib/x86_64-linux-gnu/libstdc++.so.6
     #4 0x00007f67347b1703 in std::terminate() () from 
/usr/lib/x86_64-linux-gnu/libstdc++.so.6
     #5 0x00007f67347b1922 in __cxa_throw () from 
/usr/lib/x86_64-linux-gnu/libstdc++.so.6
     #6 0x00007f67347b1e0d in operator new(unsigned long) () from 
/usr/lib/x86_64-linux-gnu/libstdc++.so.6
     #7 0x00007f67347b1ea9 in operator new[](unsigned long) () from 
/usr/lib/x86_64-linux-gnu/libstdc++.so.6
     #8 0x00007f66cfc53210 in synthv1_impl::alloc_sfxs(unsigned int) () 
from /usr/local/lib/lv2/synthv1.lv2/synthv1.so
     #9 0x00007f66cfc5db88 in synthv1_impl::process(float**, float**, 
unsigned int) () from /usr/local/lib/lv2/synthv1.lv2/synthv1.so
     #10 0x00007f66cfc61074 in synthv1_lv2::run(unsigned int) () from 
/usr/local/lib/lv2/synthv1.lv2/synthv1.so

hmm. looks like a specific ardour condition, probably due to strict
run-time checks or assertions, dunno but it seems like it throws a
std::bad_alloc when operator new() is invoked in real-time thread context.

yes synthv1::alloc_sfxs() is called to reallocate/extend the fx-send
buffers whenever the period size (nframes) grows.

does it crash/aborts with std::bad_alloc exception only when looping?
could it be that ardour is increasing the process period size (nframes
per lv2::run() dynamically as if doing look-aheads of some sort? is
there any relation with loop-start/end points and loop-length with the
probability to crash?

seeya

rncbc aka. Rui Nuno Capela

@thorwil
Copy link
Author

thorwil commented Feb 11, 2016

I haven't seen std::bad_alloc in any other case, lately. Loop marker positions do play a role, it seems the crash only happens if the end marker comes before bar 129 (in this particular session).

rgareus just told me: ardour can change the process period size any time (split cycle, automation, analysis). It can be any value between 1 and 8192 and every cycle can be different (though usually it's mainly the same). Plugins can request a specific period size via http://lv2plug.in/ns/ext/buf-size/ (in which case ardour won't load them).

@rncbc
Copy link
Owner

rncbc commented Feb 11, 2016

On 02/11/2016 01:51 PM, Thorsten Wilms wrote:

I haven't seen std::bad_alloc in any other case, lately. Loop marker
positions do play a role, it seems the crash only happens if the end
marker comes before bar 129 (in this particular session).

are you willing to test the thing, meaning synthv1-lv2 et al. as i
believe they all might suffer from the same ardour real-time
safeness/strictness for that matter?

willing to play some tests from synthv1 git pull's every now soon and then?

i'd really appreciate (my ardour4.6+ builds are crashing on me at every
startup, so i can't play even nor compete alone, sorry:)).

cheers

rncbc aka. Rui Nuno Capela

@rncbc
Copy link
Owner

rncbc commented Feb 11, 2016

today's git head master has some tentative mitigation
dd7ecfd
aka. synthv1-0.7.2.3git.dd7ecf

please test && tell

rncbc aka. Rui Nuno Capela

@rncbc
Copy link
Owner

rncbc commented Feb 11, 2016

rgareus just told me: ardour can change the process period size any time (split cycle, automation, analysis). It can be any value between 1 and 8192 and every cycle can be different (though usually it's mainly the same). Plugins can request a specific period size via http://lv2plug.in/ns/ext/buf-size/ (in which case ardour won't load them).

that's simply awful. synthv1-lv2 asks the host for LV2_BUF_SIZE__maxBlockLength option on instantiation.

why oh why doesn't ardour give it the 8K buffer-size value for x sake???

@falkTX
Copy link

falkTX commented Feb 11, 2016

nominalBlockLength is what you want to use in the plugin then.
ardour has defined that maxBlockLength is the driver/engine maximum possible value, and there was a big discussion about this a few months ago.
so errrm.., welcome :)

the plugin should prefer nominalBlockLength if available, otherwise use max.
the host can give those in any order, so some small checks are needed.

@thorwil
Copy link
Author

thorwil commented Feb 11, 2016

Still throws an instance of 'std::bad_alloc' with synthv1 current git.

@x42
Copy link

x42 commented Feb 11, 2016

that's simply awful. synthv1-lv2 asks the host for LV2_BUF_SIZE__maxBlockLength option on instantiation.

why oh why doesn't ardour give it the 8K buffer-size value for x sake???

Ardour does tell plugins 8192 for LV2_BUF_SIZE__maxBlockLength and 1 for LV2_BUF_SIZE__minBlockLength as instantiation parameters. Works just fine.

Why oh why does your plugin not understand it :)

@rncbc
Copy link
Owner

rncbc commented Feb 11, 2016

On 02/11/2016 05:59 PM, Robin Gareus wrote:
Why oh why does your plugin not understand it :)

because it's failing on parsing the LV2_Options_Option array?

oops. my oh my mistake... ok. please try this again:
6ddb0b4

thanks

rncbc aka. Rui Nuno Capela

@thorwil
Copy link
Author

thorwil commented Feb 11, 2016

Still 'std::bad_alloc'.

@rncbc
Copy link
Owner

rncbc commented Feb 11, 2016

On 02/11/2016 08:55 PM, Thorsten Wilms wrote:

Still 'std::bad_alloc'.

and is it on the same spot? at synthv1::alloc_sfxs()?

that can only mean that ardour is probably going over its own reported
LV2_BUF_SIZE__maxBlockLength (8192 frames) at some time after plugin
instantiation.

would you be kind and edit the line
https://github.com/rncbc/synthv1/blob/master/src/synthv1_lv2.cpp#L85
and change the buffer_size value from 1024 to 8192 ?

tia.

rncbc aka. Rui Nuno Capela

@rncbc
Copy link
Owner

rncbc commented Feb 12, 2016

On 2016-02-11 17:43, Filipe Coelho wrote:

the plugin should prefer nominalBlockLength if available, otherwise
use max. the host can give those in any order, so some small checks are
needed.

all of the buffer-size options are being acquainted for:
LV2_BUF_SIZE__minBlockLength, LV2_BUF_SIZE__maxBlockLength and
LV2_BUF_SIZE__nominalBlockLength (#ifdef'd), the greater of which
applies to initial buffer allocation (on instantiation).

byee

rncbc aka. Rui Nuno Capela

@falkTX
Copy link

falkTX commented Feb 12, 2016

yes, I misread the code there, sorry.

@thorwil
Copy link
Author

thorwil commented Feb 12, 2016

Still at synthv1::alloc_sfxs(). No improvement after the change to 8192.

Wondering if I made a mistake, on a second attempt, I went through make clean, make, sudo make install and checked the timestamps of the installed files and that there is only /usr/local/lib/lv2, no /usr/lib/lv2 at all. Same result.

@rncbc
Copy link
Owner

rncbc commented Feb 12, 2016

On 2016-02-12 12:32, Thorsten Wilms wrote:

Still at synthv1::alloc_sfxs(). No improvement after the change to
8192.

Wondering if I made a mistake, on a second attempt, I went through
make clean, make, sudo make install and checked the timestamps of the
installed files and that there is only /usr/local/lib/lv2, no
/usr/lib/lv2 at all. Same result.

i then suspect that the plugin (.so) that are being loaded onto your
ardour session might not be the ones you are just building from git and
thus still testing the dang original one.

please search all under /usr/lib_/lv2/, /usr/local/lib_/lv2/ and
nevertheless .lv2/, for any occurrence of the synthv1.lv2 bundle
dir--get rid of any and them all! then do a plain build from scratch, by
doing ./configure --prefix=$HOME && make && make install ... that way
the testing bundle will hit ~/.lv2/ for sure).

seeya

rncbc aka. Rui Nuno Capela

@thorwil
Copy link
Author

thorwil commented Feb 12, 2016

I removed the sole instance of a synthv1.lv2 bundle, tripple-checked the change in the code, did a fresh build ... still the same result. Backtrace looks like the first.

@rncbc
Copy link
Owner

rncbc commented Feb 12, 2016

On 02/12/2016 08:06 PM, Thorsten Wilms wrote:

I removed the sole instance of a synthv1.lv2 bundle, did a fresh build
... still the same result. Backtrace looks like the first.

does alloc_sfx() call follows right on synthv1_lv2::run() ? if on
initialization (instantiation) the plugin gets the 8K buffer size
whatever ardour might ever tops, why does it request a larger period
size ever? :)

i've tested on a fresh build on today's ardour git head and actually
confirmed that synthv1_lv2 gets the 8K buffer size alright at
initialization.... tried a bunch of loop ranges and nothing strange
happened...

i think i'm loosing on you here... anyway, it was already strange why
ardour throwns a std::bad_alloc in the first place anyhow

as said synthv1::process(nframes) only calls synthv1::alloc_sfxs() on
buffer reallocation when its given period size is greater than expected
ie. nframes > buffer_size (for which ardour should say it's 8K)

kinda puzzled now :/

seeya

rncbc aka. Rui Nuno Capela

@falkTX
Copy link

falkTX commented Feb 12, 2016

why not adding a test print in there?
that way you know for sure what value is being used.

my guess would be that a miscalculation somewhere is leading to negative values.
trying to allocate huge a amount of data - like say, (unsigned)-1, could be the trigger here.

@thorwil
Copy link
Author

thorwil commented Feb 13, 2016

IRC is nice, but if anyone needs to make sense of this later on:
fprintf(stderr, "DEBUG> synthv1_impl::alloc_sfxs(%u)\n", nsize); in void synthv1_impl::alloc_sfxs ( uint32_t nsize ), synthv1.cpp line 980 results in:
DEBUG> synthv1_impl::alloc_sfxs(4294966400) right before terminate called after throwing an instance of 'std::bad_alloc'

@thorwil
Copy link
Author

thorwil commented Feb 13, 2016

synthv1_lv2.cpp, added #include <stdio.h>, line 170 changed to if (event->body.type == m_urids.midi_MidiEvent && event->time.frames >= ndelta) { followed by printf("TESTING %u %u\n", nframes, ndelta);

Calling configure on mod_matrix:9,4
Set buffering params to 262144|131072|10|10
Skip explicit buffer seconds, preset in use
Skip explicit buffer seconds, preset in use
drop flushed event on the floor, time 0 too early for 0 + 240 90 2d b
drop flushed event on the floor, time 0 too early for 0 + 240 90 40 57
drop flushed event on the floor, time 0 too early for 0 + 240 90 39 57
drop flushed event on the floor, time 1 too early for 0 + 240 90 3d 57
TESTING 1024 0
TESTING 1024 799
TESTING 1024 799
TESTING 1024 800
TESTING 1024 0
TESTING 1024 752
TESTING 1024 0
TESTING 1024 608
TESTING 1024 0
TESTING 1024 560
TESTING 1024 0
TESTING 1024 416
TESTING 1024 0
TESTING 1024 223
TESTING 1024 223
TESTING 1024 224
TESTING 1024 0
TESTING 1024 31
TESTING 1024 31
TESTING 1024 32
TESTING 1024 0
TESTING 1024 1008
TESTING 1024 0
TESTING 1024 864
TESTING 1024 0
TESTING 1024 671
TESTING 1024 671
TESTING 1024 672
TESTING 1024 0
TESTING 1024 624
TESTING 1024 0
TESTING 1024 480
TESTING 1024 0
TESTING 1024 432
TESTING 1024 0
TESTING 1024 288
TESTING 1024 0
TESTING 1024 95
TESTING 1024 95
TESTING 1024 96
TESTING 1024 0
TESTING 1024 927
TESTING 1024 927
TESTING 1024 928
TESTING 1024 0
TESTING 1024 880
TESTING 1024 0
TESTING 1024 736
TESTING 1024 0
TESTING 1024 543
TESTING 1024 543
TESTING 1024 544
TESTING 1024 0
TESTING 1024 496
TESTING 1024 496
TESTING 1024 0
TESTING 1024 447
TESTING 1024 0
TESTING 1024 399
TESTING 1024 0
TESTING 1024 351
TESTING 1024 352
TESTING 1024 0
TESTING 1024 304
TESTING 1024 0
TESTING 1024 160
TESTING 1024 0
TESTING 1024 983
TESTING 1024 983
TESTING 1024 984
TESTING 1024 0
TESTING 1024 791
TESTING 1024 791
TESTING 1024 792
TESTING 1024 0
TESTING 1024 744
TESTING 1024 0
TESTING 1024 600
TESTING 1024 0
TESTING 1024 552
TESTING 1024 0
TESTING 1024 408
TESTING 1024 0
TESTING 1024 215
TESTING 1024 215
TESTING 1024 216
TESTING 1024 0
TESTING 1024 23
TESTING 1024 23
TESTING 1024 24
TESTING 1024 0
TESTING 1024 1000
TESTING 1024 0
TESTING 1024 856
TESTING 1024 0
TESTING 1024 663
TESTING 1024 663
TESTING 1024 664
TESTING 1024 0
TESTING 1024 616
TESTING 1024 0
TESTING 1024 472
0x7f7d6ac2d560 note 64/0 was already on, now at 2
TESTING 1024 0
TESTING 1024 424
TESTING 1024 0
TESTING 1024 280
TESTING 1024 0
TESTING 1024 87
TESTING 1024 87
TESTING 1024 88
TESTING 1024 0
TESTING 1024 919
TESTING 1024 919
TESTING 1024 920
TESTING 1024 0
TESTING 1024 872
TESTING 1024 0
TESTING 1024 728
TESTING 1024 0
TESTING 1024 535
TESTING 1024 535
TESTING 1024 536
TESTING 1024 0
TESTING 1024 488
TESTING 1024 488
TESTING 1024 0
TESTING 1024 439
TESTING 1024 0
TESTING 1024 391
TESTING 1024 0
TESTING 1024 343
TESTING 1024 344
0x1c9bd868 note 64/0 was already on, now at 2
0x1ca10eca note 64/0 was already on, now at 2
TESTING 1024 0
TESTING 1024 296
TESTING 1024 0
TESTING 1024 152
TESTING 1024 0
TESTING 1024 975
TESTING 1024 975
TESTING 1024 976
TESTING 1024 0
TESTING 1024 783
TESTING 1024 783
TESTING 1024 784
TESTING 1024 0
TESTING 1024 736
TESTING 1024 0
TESTING 1024 592
0x7f7d6ac2d560 note 57/0 was already on, now at 2
TESTING 1024 0
TESTING 1024 544
TESTING 1024 0
TESTING 1024 400
TESTING 1024 0
TESTING 1024 207
TESTING 1024 207
TESTING 1024 208
TESTING 1024 0
TESTING 1024 15
TESTING 1024 15
TESTING 1024 16
TESTING 1024 0
TESTING 1024 992
TESTING 1024 0
TESTING 1024 848
TESTING 1024 0
TESTING 1024 655
TESTING 1024 655
TESTING 1024 656
TESTING 1024 0
TESTING 1024 608
TESTING 1024 0
TESTING 1024 464
0x1c9bd868 note 57/0 was already on, now at 2
0x1ca10eca note 57/0 was already on, now at 2
TESTING 1024 0
TESTING 1024 416
TESTING 1024 0
TESTING 1024 272
TESTING 1024 0
TESTING 1024 79
TESTING 1024 79
TESTING 1024 80
TESTING 1024 0
TESTING 1024 911
TESTING 1024 911
TESTING 1024 912
TESTING 1024 0
TESTING 1024 864
TESTING 1024 0
TESTING 1024 720
TESTING 1024 0
TESTING 1024 527
TESTING 1024 527
TESTING 1024 528
TESTING 1024 0
TESTING 1024 480
TESTING 1024 480
TESTING 1024 0
TESTING 1024 431
TESTING 1024 0
TESTING 1024 383
TESTING 1024 0
TESTING 1024 335
TESTING 1024 336
TESTING 1024 0
TESTING 1024 288
TESTING 1024 0
TESTING 1024 144
TESTING 1024 0
TESTING 1024 967
TESTING 1024 967
TESTING 1024 968
TESTING 1024 0
TESTING 1024 775
TESTING 1024 775
TESTING 1024 776
TESTING 1024 0
TESTING 1024 728
TESTING 1024 0
TESTING 1024 584
TESTING 1024 0
TESTING 1024 536
TESTING 1024 0
TESTING 1024 392
TESTING 1024 0
TESTING 1024 199
TESTING 1024 199
TESTING 1024 200
TESTING 1024 0
TESTING 1024 7
TESTING 1024 7
TESTING 1024 8
TESTING 1024 0
TESTING 1024 984
TESTING 1024 0
TESTING 1024 840
TESTING 1024 0
TESTING 1024 647
TESTING 1024 647
TESTING 1024 648
TESTING 1024 0
TESTING 1024 600
TESTING 1024 0
TESTING 1024 456
0x7f7d6ac2d560 note 62/0 was already on, now at 2
TESTING 1024 0
TESTING 1024 408
TESTING 1024 0
TESTING 1024 264
TESTING 1024 0
TESTING 1024 71
TESTING 1024 71
TESTING 1024 72
0x7f7d6ac2d560 note 57/0 was already on, now at 2
TESTING 1024 0
TESTING 1024 903
TESTING 1024 903
TESTING 1024 904
TESTING 1024 0
TESTING 1024 856
TESTING 1024 0
TESTING 1024 712
TESTING 1024 0
TESTING 1024 519
TESTING 1024 519
TESTING 1024 520
TESTING 1024 0
TESTING 1024 472
TESTING 1024 472
TESTING 1024 0
TESTING 1024 423
TESTING 1024 0
TESTING 1024 375
TESTING 1024 0
TESTING 1024 327
TESTING 1024 328
0x1c9bd868 note 62/0 was already on, now at 2
0x1ca10eca note 62/0 was already on, now at 2
TESTING 1024 0
TESTING 1024 280
TESTING 1024 0
TESTING 1024 136
TESTING 960 0
TESTING 960 959
TESTING 64 0
TESTING 64 960
DEBUG> synthv1_impl::alloc_sfxs(4294966400)
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc

Aborted (core dumped)

@thorwil
Copy link
Author

thorwil commented Feb 13, 2016

With the >= inif (event->body.type == m_urids.midi_MidiEvent && event->time.frames >= ndelta) {changed to>```:

<snip>
Calling configure on mod_matrix:9,4
SO-666 v.1.0 by 50m30n3 2009
DEBUG> synthv1_impl::alloc_sfxs(8192)
Calling configure on mod_matrix:0,0
<snip>
Calling configure on mod_matrix:9,2
Calling configure on mod_matrix:9,3
Calling configure on mod_matrix:9,4
Set buffering params to 262144|131072|10|10
Skip explicit buffer seconds, preset in use
Skip explicit buffer seconds, preset in use
drop flushed event on the floor, time 0 too early for 0 + 240 90 2d b
drop flushed event on the floor, time 0 too early for 0 + 240 90 40 57
drop flushed event on the floor, time 0 too early for 0 + 240 90 39 57
drop flushed event on the floor, time 1 too early for 0 + 240 90 3d 57
TESTING 1024 0
TESTING 1024 799
TESTING 1024 0
TESTING 1024 0
TESTING 1024 0
TESTING 1024 0
TESTING 1024 0
TESTING 1024 223
TESTING 1024 0
TESTING 1024 31
TESTING 1024 0
TESTING 1024 0
TESTING 1024 0
TESTING 1024 671
TESTING 1024 0
TESTING 1024 0
TESTING 1024 0
TESTING 1024 0
TESTING 1024 0
TESTING 1024 95
TESTING 1024 0
TESTING 1024 927
TESTING 1024 0
TESTING 1024 0
TESTING 1024 0
TESTING 1024 543
TESTING 1024 0
TESTING 1024 0
TESTING 1024 447
TESTING 1024 0
TESTING 1024 399
TESTING 1024 0
TESTING 1024 351
TESTING 1024 0
TESTING 1024 0
TESTING 1024 0
TESTING 1024 983
TESTING 1024 0
TESTING 1024 791
TESTING 1024 0
TESTING 1024 0
TESTING 1024 0
TESTING 1024 0
TESTING 1024 0
TESTING 1024 215
TESTING 1024 0
TESTING 1024 23
TESTING 1024 0
TESTING 1024 0
TESTING 1024 0
TESTING 1024 663
TESTING 1024 0
TESTING 1024 0
0x7f8a4ec2d760 note 64/0 was already on, now at 2
TESTING 1024 0
TESTING 1024 0
TESTING 1024 0
TESTING 1024 87
TESTING 1024 0
TESTING 1024 919
TESTING 1024 0
TESTING 1024 0
TESTING 1024 0
TESTING 1024 535
TESTING 1024 0
TESTING 1024 0
TESTING 1024 439
TESTING 1024 0
TESTING 1024 391
TESTING 1024 0
TESTING 1024 343
0x1d50ff28 note 64/0 was already on, now at 2
0x1d56359a note 64/0 was already on, now at 2
TESTING 1024 0
TESTING 1024 0
TESTING 1024 0
TESTING 1024 975
TESTING 1024 0
TESTING 1024 783
TESTING 1024 0
TESTING 1024 0
0x7f8a4ec2d760 note 57/0 was already on, now at 2
TESTING 1024 0
TESTING 1024 0
TESTING 1024 0
TESTING 1024 207
TESTING 1024 0
TESTING 1024 15
TESTING 1024 0
TESTING 1024 0
TESTING 1024 0
TESTING 1024 655
TESTING 1024 0
TESTING 1024 0
0x1d50ff28 note 57/0 was already on, now at 2
0x1d56359a note 57/0 was already on, now at 2
TESTING 1024 0
TESTING 1024 0
TESTING 1024 0
TESTING 1024 79
TESTING 1024 0
TESTING 1024 911
TESTING 1024 0
TESTING 1024 0
TESTING 1024 0
TESTING 1024 527
TESTING 1024 0
TESTING 1024 0
TESTING 1024 431
TESTING 1024 0
TESTING 1024 383
TESTING 1024 0
TESTING 1024 335
TESTING 1024 0
TESTING 1024 0
TESTING 1024 0
TESTING 1024 967
TESTING 1024 0
TESTING 1024 775
TESTING 1024 0
TESTING 1024 0
TESTING 1024 0
TESTING 1024 0
TESTING 1024 0
TESTING 1024 199
TESTING 1024 0
TESTING 1024 7
TESTING 1024 0
TESTING 1024 0
TESTING 1024 0
TESTING 1024 647
TESTING 1024 0
TESTING 1024 0
0x7f8a4ec2d760 note 62/0 was already on, now at 2
TESTING 1024 0
TESTING 1024 0
TESTING 1024 0
TESTING 1024 71
0x7f8a4ec2d760 note 57/0 was already on, now at 2
TESTING 1024 0
TESTING 1024 903
TESTING 1024 0
TESTING 1024 0
TESTING 1024 0
TESTING 1024 519
TESTING 1024 0
TESTING 1024 0
TESTING 1024 423
TESTING 1024 0
TESTING 1024 375
TESTING 1024 0
TESTING 1024 327
0x1d50ff28 note 62/0 was already on, now at 2
0x1d56359a note 62/0 was already on, now at 2
TESTING 1024 0
TESTING 1024 0
TESTING 960 0
TESTING 64 0
DEBUG> synthv1_impl::alloc_sfxs(4294966400)
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
Aborted (core dumped)

@thorwil
Copy link
Author

thorwil commented Feb 13, 2016

With if (event->body.type == m_urids.midi_MidiEvent && event->time.frames < nframes) { the crash doesn't happen anymore.

Same with line 170 back to original if (event->body.type == m_urids.midi_MidiEvent) line 229 changed from synthv1::process(ins, outs, nframes - ndelta); to if (nframes > ndelta) synthv1::process(ins, outs, nframes - ndelta);.

@thorwil thorwil closed this as completed Feb 13, 2016
pauldavisthefirst pushed a commit to Ardour/ardour that referenced this issue Feb 16, 2016
(n_samples = 64 but Ardour sends midi-buffer with an event at 960)

some guesses as to why:
 - split cycle for looping (nominal: 1024, cycle split:64)
 - plugin uses _session.transport_frame() directly :(
   (not latency compensated offset or looped position)
 - "offset" is not taken into account for midi buffers
 - tempo/metric change (metric iterator is wrong after loop)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants