View Issue Details

IDProjectCategoryView StatusLast Update
0006187ardourbugspublic2020-04-19 20:17
Reporterccaudle Assigned Toccaudle  
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionfixed 
Summary0006187: Assertion `backend' failed on startup
DescriptionBuilt with latest from git
$ git rev-parse master
933e9c2919a93f87291f6090decae712c245ac12

On startup after asking to open an existing session or create a new session, either selection results in this assertion after dialog closes:

ardour-3.5.4561: ../gtk2_ardour/engine_dialog.cc:906: void EngineControl::device_changed(): Assertion `backend' failed.

rgareus thinks that this behavior probably began after this commit:

commit fbdf6a815165e45ed63081cc919a8d8f7e24234b
Author: Ben Loftis <ben@harrisonconsoles.com>
Date: Tue Feb 24 14:29:02 2015 -0600

    recover the most recent audio setup settings from config

I tried removing ardour.rc and instant.xml from ~/.ardour to see if lack of those files would force asking for the backend selection but that was not effective.
Additional Information(gdb) thread apply all bt
Thread 13 (Thread 0x7fffce99b700 (LWP 5359)):
#0 0x0000003d56e0c049 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
0000001 0x0000003d5a28a915 in g_cond_wait_until () from /lib64/libglib-2.0.so.0
#2 0x0000003d5a21f0d1 in g_async_queue_pop_intern_unlocked () from /lib64/libglib-2.0.so.0
#3 0x0000003d5a21f68b in g_async_queue_timeout_pop () from /lib64/libglib-2.0.so.0
0000004 0x0000003d5a26f4d6 in g_thread_pool_thread_proxy () from /lib64/libglib-2.0.so.0
0000005 0x0000003d5a26ea45 in g_thread_proxy () from /lib64/libglib-2.0.so.0
#6 0x0000003d56e07ee5 in start_thread () from /lib64/libpthread.so.0
#7 0x0000003d562f4b8d in clone () from /lib64/libc.so.6

Thread 11 (Thread 0x7fffe4c70700 (LWP 5356)):
#0 0x0000003d562ea71d in poll () from /lib64/libc.so.6
0000001 0x0000003d5a2495b4 in g_main_context_iterate.isra () from /lib64/libglib-2.0.so.0
#2 0x0000003d5a2496dc in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#3 0x0000003d5a249729 in glib_worker_main () from /lib64/libglib-2.0.so.0
0000004 0x0000003d5a26ea45 in g_thread_proxy () from /lib64/libglib-2.0.so.0
0000005 0x0000003d56e07ee5 in start_thread () from /lib64/libpthread.so.0
#6 0x0000003d562f4b8d in clone () from /lib64/libc.so.6

Thread 10 (Thread 0x7fffcfbba700 (LWP 5355)):
#0 0x0000003d562ea71d in poll () from /lib64/libc.so.6
0000001 0x0000003d5a2495b4 in g_main_context_iterate.isra () from /lib64/libglib-2.0.so.0
#2 0x0000003d5a249a3a in g_main_loop_run () from /lib64/libglib-2.0.so.0
#3 0x0000003a73ad0376 in gdbus_shared_thread_func () from /lib64/libgio-2.0.so.0
0000004 0x0000003d5a26ea45 in g_thread_proxy () from /lib64/libglib-2.0.so.0
0000005 0x0000003d56e07ee5 in start_thread () from /lib64/libpthread.so.0
#6 0x0000003d562f4b8d in clone () from /lib64/libc.so.6

Thread 7 (Thread 0x7fffe6165700 (LWP 5349)):
#0 0x0000003d56e0bca0 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
0000001 0x0000003d5a28a817 in g_cond_wait () from /lib64/libglib-2.0.so.0
#2 0x00007ffff7172a4b in ARDOUR::AudioEngine::do_devicelist_update (this=0x1fed0b0) at ../libs/ardour/audioengine.cc:464
#3 0x00007ffff717e987 in boost::_mfi::mf0<void, ARDOUR::AudioEngine>::operator() (this=0x1fed7c0, p=0x1fed0b0)
    at /usr/include/boost/bind/mem_fn_template.hpp:49
0000004 0x00007ffff717e5c8 in boost::_bi::list1<boost::_bi::value<ARDOUR::AudioEngine*> >::operator()<boost::_mfi::mf0<void, ARDOUR::AudioEngine>, boost::_bi::list0> (this=0x1fed7d0, f=..., a=...) at /usr/include/boost/bind/bind.hpp:253
0000005 0x00007ffff717df31 in boost::_bi::bind_t<void, boost::_mfi::mf0<void, ARDOUR::AudioEngine>, boost::_bi::list1<boost::_bi::value<ARDOUR::AudioEngine*> > >::operator() (this=0x1fed7c0) at /usr/include/boost/bind/bind_template.hpp:20
#6 0x00007ffff717d708 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=0x1fed7c0) at /usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:251
#7 0x00007ffff717c928 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=0x1fed790) at /usr/include/sigc++-2.0/sigc++/functors/slot.h:103
0000008 0x0000003d6864605d in call_thread_entry_slot () from /lib64/libglibmm-2.4.so.1
0000009 0x0000003d5a26ea45 in g_thread_proxy () from /lib64/libglib-2.0.so.0
0000010 0x0000003d56e07ee5 in start_thread () from /lib64/libpthread.so.0
0000011 0x0000003d562f4b8d in clone () from /lib64/libc.so.6

Thread 6 (Thread 0x7fffe6966700 (LWP 5348)):
#0 0x0000003d56e0bca0 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
0000001 0x0000003d5a28a817 in g_cond_wait () from /lib64/libglib-2.0.so.0
#2 0x00007ffff7172853 in ARDOUR::AudioEngine::do_reset_backend (this=0x1fed0b0) at ../libs/ardour/audioengine.cc:429
#3 0x00007ffff717e987 in boost::_mfi::mf0<void, ARDOUR::AudioEngine>::operator() (this=0x2019ff0, p=0x1fed0b0)
    at /usr/include/boost/bind/mem_fn_template.hpp:49
0000004 0x00007ffff717e5c8 in boost::_bi::list1<boost::_bi::value<ARDOUR::AudioEngine*> >::operator()<boost::_mfi::mf0<void, ARDOUR::AudioEngine>, boost::_bi::list0> (this=0x201a000, f=..., a=...) at /usr/include/boost/bind/bind.hpp:253
0000005 0x00007ffff717df31 in boost::_bi::bind_t<void, boost::_mfi::mf0<void, ARDOUR::AudioEngine>, boost::_bi::list1<boost::_bi::value<ARDOUR::AudioEngine*> > >::operator() (this=0x2019ff0) at /usr/include/boost/bind/bind_template.hpp:20
#6 0x00007ffff717d708 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=0x2019ff0) at /usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:251
#7 0x00007ffff717c928 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=0x2019fc0) at /usr/include/sigc++-2.0/sigc++/functors/slot.h:103
0000008 0x0000003d6864605d in call_thread_entry_slot () from /lib64/libglibmm-2.4.so.1
0000009 0x0000003d5a26ea45 in g_thread_proxy () from /lib64/libglib-2.0.so.0
0000010 0x0000003d56e07ee5 in start_thread () from /lib64/libpthread.so.0
0000011 0x0000003d562f4b8d in clone () from /lib64/libc.so.6

Thread 5 (Thread 0x7fffe77fe700 (LWP 5347)):
#0 0x0000003d56e0bca0 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
0000001 0x0000003d5a28a817 in g_cond_wait () from /lib64/libglib-2.0.so.0
#2 0x00007ffff7125684 in ARDOUR::Analyser::work () at ../libs/ardour/analyser.cc:81
#3 0x00007ffff7125479 in analyser_work () at ../libs/ardour/analyser.cc:46
0000004 0x000000000155b893 in sigc::pointer_functor0<void>::operator() (this=0x202b798) at /usr/include/sigc++-2.0/sigc++/functors/ptr_fun.h:77
0000005 0x0000000001558d2e in sigc::adaptor_functor<sigc::pointer_functor0<void> >::operator() (this=0x202b790)
    at /usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:251
#6 0x0000000001555a53 in sigc::internal::slot_call0<sigc::pointer_functor0<void>, void>::call_it (rep=0x202b760)
    at /usr/include/sigc++-2.0/sigc++/functors/slot.h:103
#7 0x0000003d6864605d in call_thread_entry_slot () from /lib64/libglibmm-2.4.so.1
0000008 0x0000003d5a26ea45 in g_thread_proxy () from /lib64/libglib-2.0.so.0
0000009 0x0000003d56e07ee5 in start_thread () from /lib64/libpthread.so.0
0000010 0x0000003d562f4b8d in clone () from /lib64/libc.so.6

Thread 4 (Thread 0x7fffe7fff700 (LWP 5346)):
#0 0x0000003d56e0bca0 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
0000001 0x0000003d5a28a817 in g_cond_wait () from /lib64/libglib-2.0.so.0
#2 0x00007ffff7567898 in peak_thread_work () at ../libs/ardour/source_factory.cc:68
#3 0x000000000155b893 in sigc::pointer_functor0<void>::operator() (this=0x202cca8) at /usr/include/sigc++-2.0/sigc++/functors/ptr_fun.h:77
0000004 0x0000000001558d2e in sigc::adaptor_functor<sigc::pointer_functor0<void> >::operator() (this=0x202cca0)
    at /usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:251
0000005 0x0000000001555a53 in sigc::internal::slot_call0<sigc::pointer_functor0<void>, void>::call_it (rep=0x202cc70)
    at /usr/include/sigc++-2.0/sigc++/functors/slot.h:103
#6 0x0000003d6864605d in call_thread_entry_slot () from /lib64/libglibmm-2.4.so.1
#7 0x0000003d5a26ea45 in g_thread_proxy () from /lib64/libglib-2.0.so.0
0000008 0x0000003d56e07ee5 in start_thread () from /lib64/libpthread.so.0
0000009 0x0000003d562f4b8d in clone () from /lib64/libc.so.6

Thread 3 (Thread 0x7fffeca43700 (LWP 5345)):
#0 0x0000003d56e0bca0 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
0000001 0x0000003d5a28a817 in g_cond_wait () from /lib64/libglib-2.0.so.0
#2 0x00007ffff7567898 in peak_thread_work () at ../libs/ardour/source_factory.cc:68
#3 0x000000000155b893 in sigc::pointer_functor0<void>::operator() (this=0x202c778) at /usr/include/sigc++-2.0/sigc++/functors/ptr_fun.h:77
0000004 0x0000000001558d2e in sigc::adaptor_functor<sigc::pointer_functor0<void> >::operator() (this=0x202c770)
    at /usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:251
0000005 0x0000000001555a53 in sigc::internal::slot_call0<sigc::pointer_functor0<void>, void>::call_it (rep=0x202c740)
    at /usr/include/sigc++-2.0/sigc++/functors/slot.h:103
#6 0x0000003d6864605d in call_thread_entry_slot () from /lib64/libglibmm-2.4.so.1
#7 0x0000003d5a26ea45 in g_thread_proxy () from /lib64/libglib-2.0.so.0
0000008 0x0000003d56e07ee5 in start_thread () from /lib64/libpthread.so.0
0000009 0x0000003d562f4b8d in clone () from /lib64/libc.so.6

Thread 2 (Thread 0x7fffed244700 (LWP 5344)):
#0 0x0000003d56e0ef3d in nanosleep () from /lib64/libpthread.so.0
0000001 0x0000003d5a270028 in g_usleep () from /lib64/libglib-2.0.so.0
#2 0x000000000180b3f4 in gui_event_loop (ptr=0x0) at ../gtk2_ardour/linux_vst_gui_support.cc:380
#3 0x0000003d56e07ee5 in start_thread () from /lib64/libpthread.so.0
0000004 0x0000003d562f4b8d in clone () from /lib64/libc.so.6

Thread 1 (Thread 0x7ffff3824a00 (LWP 5322)):
#0 0x0000003d56235877 in raise () from /lib64/libc.so.6
0000001 0x0000003d56236f68 in abort () from /lib64/libc.so.6
#2 0x0000003d5622e7d6 in __assert_fail_base () from /lib64/libc.so.6
#3 0x0000003d5622e882 in __assert_fail () from /lib64/libc.so.6
0000004 0x00000000012515d1 in EngineControl::device_changed (this=0x23cb400) at ../gtk2_ardour/engine_dialog.cc:906
0000005 0x00000000012578fa in EngineControl::set_desired_sample_rate (this=0x23cb400, sr=44100) at ../gtk2_ardour/engine_dialog.cc:1865
#6 0x0000000000f85114 in ARDOUR_UI::do_audio_midi_setup (this=0x2263ab0, desired_sample_rate=44100) at ../gtk2_ardour/ardour_ui.cc:4520
#7 0x0000000000fb3635 in boost::_mfi::mf1<int, ARDOUR_UI, unsigned int>::operator() (this=0x28b5e28, p=0x2263ab0, a1=44100)
    at /usr/include/boost/bind/mem_fn_template.hpp:165
0000008 0x0000000000fab2ac in boost::_bi::list2<boost::_bi::value<ARDOUR_UI*>, boost::arg<1> >::operator()<int, boost::_mfi::mf1<int, ARDOUR_UI, unsigned int>, boost::_bi::list1<unsigned int&> > (this=0x28b5e38, f=..., a=...) at /usr/include/boost/bind/bind.hpp:303
0000009 0x0000000000fa55d8 in boost::_bi::bind_t<int, boost::_mfi::mf1<int, ARDOUR_UI, unsigned int>, boost::_bi::list2<boost::_bi::value<ARDOUR_UI*>, boost::arg<1> > >::operator()<unsigned int> (this=0x28b5e28, a1=@0x7fffffffb224: 44100) at /usr/include/boost/bind/bind_template.hpp:32
0000010 0x0000000000f9f391 in boost::detail::function::function_obj_invoker1<boost::_bi::bind_t<int, boost::_mfi::mf1<int, ARDOUR_UI, unsigned int>, boost::_bi::list2<boost::_bi::value<ARDOUR_UI*>, boost::arg<1> > >, int, unsigned int>::invoke (function_obj_ptr=..., a0=44100)
    at /usr/include/boost/function/function_template.hpp:132
0000011 0x00007ffff7178c42 in boost::function1<int, unsigned int>::operator() (this=0x28b5e20, a0=44100)
    at /usr/include/boost/function/function_template.hpp:767
0000012 0x00007ffff71777fb in PBD::Signal1<int, unsigned int, PBD::OptionalLastValue<int> >::operator() (
    this=0x1f1af00 <ARDOUR::Session::AudioEngineSetupRequired>, a1=44100)
    at /home/chris/Src/Ardour/ardour/build/libs/pbd/pbd/signals_generated.h:483
0000013 0x00007ffff747f1ee in ARDOUR::Session::ensure_engine (this=0x26a6530, desired_sample_rate=44100) at ../libs/ardour/session.cc:378
0000014 0x00007ffff747d2e7 in ARDOUR::Session::Session (this=0x26a6530, eng=...,
   fullpath="/mnt/data/Audio/Projects/HelpisOnTheWayMash/help_is_on_the_way", snapshot_name="help_is_on_the_way", bus_profile=0x0, mix_template="")
    at ../libs/ardour/session.cc:325
#15 0x0000000000f7c437 in ARDOUR_UI::load_session (this=0x2263ab0, path="/mnt/data/Audio/Projects/HelpisOnTheWayMash/help_is_on_the_way",
    snap_name="help_is_on_the_way", mix_template="") at ../gtk2_ardour/ardour_ui.cc:2935
0000016 0x0000000000f7bcba in ARDOUR_UI::get_session_parameters (this=0x2263ab0, quit_on_cancel=false, should_be_new=false, load_template="")
    at ../gtk2_ardour/ardour_ui.cc:2866
#17 0x0000000000f71f71 in ARDOUR_UI::starting (this=0x2263ab0) at ../gtk2_ardour/ardour_ui.cc:866
0000018 0x00007ffff5deb4c0 in Gtkmm2ext::UI::run (this=0x2263ab0, old_receiver=...) at ../libs/gtkmm2ext/gtk_ui.cc:275
0000019 0x000000000135fa7b in main (argc=1, argv=0x7fffffffd398) at ../gtk2_ardour/main.cc:303


TagsNo tags attached.

Relationships

has duplicate 0006191 feedback Ardour crash at startup or in 10 minutes 

Activities

tlat

2015-02-28 17:32

reporter   ~0016374

The config file in "${HOME}.config/ardour3" contains the extra
information about an engine state with

        active="no"

and Ardour doesn't start because in engine_dialog.cc:1444 there is

        for (StateList::const_iterator i = states.begin(); i != states.end(); ++i) {

                if ((*i)->active) {
                        ignore_changes++;
                        backend_combo.set_active_text ((*i)->backend);
                        [...]


If an unique engine state is considered "active", the attached patch
is a possible fix.

2015-02-28 17:32

 

backend.patch (944 bytes)   
diff --git a/gtk2_ardour/engine_dialog.cc b/gtk2_ardour/engine_dialog.cc
index a78b85e..a6b3e51 100644
--- a/gtk2_ardour/engine_dialog.cc
+++ b/gtk2_ardour/engine_dialog.cc
@@ -1248,6 +1248,7 @@ EngineControl::get_state ()
 
 	if (!states.empty()) {
 		XMLNode* state_nodes = new XMLNode ("EngineStates");
+		bool unique_state = (states.size() == 1);
 
 		for (StateList::const_iterator i = states.begin(); i != states.end(); ++i) {
 
@@ -1262,7 +1263,7 @@ EngineControl::get_state ()
 			node->add_property ("output-latency", (*i)->output_latency);
 			node->add_property ("input-channels", (*i)->input_channels);
 			node->add_property ("output-channels", (*i)->output_channels);
-			node->add_property ("active", (*i)->active ? "yes" : "no");
+			node->add_property ("active", (*i)->active || unique_state ? "yes" : "no");
 			node->add_property ("midi-option", (*i)->midi_option);
 
 			XMLNode* midi_devices = new XMLNode ("MIDIDevices");
backend.patch (944 bytes)   

ccaudle

2015-02-28 17:58

reporter   ~0016375

Based on note from tlat I tried just removing ~/.config/ardour3/config which caused Ardour to prompt for the backend and allowed startup to continue.
That work around is very easy and lessens the severity of the problem.

x42

2015-03-01 15:56

administrator   ~0016377

believed to be fixed in 3.5-4583-g411c3ee

I was not able to reproduce this in the first place, so please verify. Thanks.

x42

2015-03-01 15:57

administrator   ~0016378

@tlat, note that there can be multiple states, all inactive (e.g. disconnect from jack).

Checking for a unique state does not solve this issue.

tlat

2015-03-01 17:56

reporter   ~0016379

@x42, I have tested the last git b11a18d without success.

So we have `set_state' that doesn't set a backend if there
are inactive states. I'm thinking about the follow change
(it works but dunno if it is complete).

diff --git a/gtk2_ardour/engine_dialog.cc b/gtk2_ardour/engine_dialog.cc
index a78b85e..e62d2ae 100644
--- a/gtk2_ardour/engine_dialog.cc
+++ b/gtk2_ardour/engine_dialog.cc
@@ -278,10 +278,10 @@ EngineControl::EngineControl ()
        ARDOUR::AudioEngine::instance()->Stopped.connect (stopped_connection, MISSING_INVALIDATOR, boost::bind (&EngineControl::engine_stopped, this), gui_context());
        ARDOUR::AudioEngine::instance()->Halted.connect (stopped_connection, MISSING_INVALIDATOR, boost::bind (&EngineControl::engine_stopped, this), gui_context());
 
+ backend_combo.set_active_text (strings.front());
+
        if (audio_setup) {
                set_state (*audio_setup);
- } else {
- backend_combo.set_active_text (strings.front());
        }
 
        {

tlat

2015-03-01 18:25

reporter   ~0016380

errata corrige for my prior note: test failed with git 03229f4
(b11a18d is oldest)

ccaudle

2015-03-01 19:46

reporter   ~0016381

Corrected the problem for my system with build from 60388f9.

x42

2015-03-01 20:11

administrator   ~0016382

@tlat: That's exactly what we had before fbdf6a81

The whole thing started because we don't want to set a text first.
On systems where the devices can change dynamically (OSX, Windows), the device list is not fixed, the backend needs to be instantiated first. If a text is already set, there is no change.. backend_changed does not catch it. The device list is empty and set_state() cannot set the last used device.

This is not an issue on GNU/Linux where a separate libardouralsautil handles device listing.

This whole design is messy, but until someone rewrites the waves backend and engine_dialog we'll have to hack around.

tlat

2015-03-01 20:23

reporter   ~0016383

thanks x42, now all is clear

system

2020-04-19 20:17

developer   ~0023410

Issue has been closed automatically, by Trigger Close Plugin.
Feel free to re-open with additional information if you think the issue is not resolved.

Issue History

Date Modified Username Field Change
2015-02-27 22:15 ccaudle New Issue
2015-02-28 17:32 tlat Note Added: 0016374
2015-02-28 17:32 tlat File Added: backend.patch
2015-02-28 17:58 ccaudle Note Added: 0016375
2015-03-01 15:56 x42 Note Added: 0016377
2015-03-01 15:56 x42 Status new => feedback
2015-03-01 15:57 x42 Note Added: 0016378
2015-03-01 17:56 tlat Note Added: 0016379
2015-03-01 18:25 tlat Note Added: 0016380
2015-03-01 19:46 ccaudle Note Added: 0016381
2015-03-01 20:11 x42 Note Added: 0016382
2015-03-01 20:23 tlat Note Added: 0016383
2015-03-03 17:51 ccaudle Status feedback => resolved
2015-03-03 17:51 ccaudle Resolution open => fixed
2015-03-03 17:51 ccaudle Assigned To => ccaudle
2015-03-21 02:19 x42 Relationship added has duplicate 0006191
2020-04-19 20:17 system Note Added: 0023410
2020-04-19 20:17 system Status resolved => closed