canonical / multipass

Multipass orchestrates virtual Ubuntu instances
https://multipass.run
GNU General Public License v3.0
7.54k stars 634 forks source link

multipassd SIGSEGV on clean while launching #585

Closed Saviq closed 5 years ago

Saviq commented 5 years ago
$ multipass launch
# ... wait for the image to download
^C
$ multipass delete -p --all
[2019-02-01T10:45:03.062] [error] [snapcraft-multipass] process error occurred Crashed

delete failed: cannot connect to the multipass socket
Please ensure multipassd is running and '/run/multipass_socket' is accessible

Backtrace:

#0  0x00007ffff73e7254 in QProcess::state() const () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#1  0x0000555555be7a67 in multipass::QemuVirtualMachine::ensure_vm_is_running (this=0x555556526320) at /home/michal/dev/canonical/multipass/multipass/src/platform/backends/qemu/qemu_virtual_machine.cpp:385
#2  0x0000555555be7b17 in multipass::QemuVirtualMachine::<lambda()>::operator()(void) const (__closure=0x7fffffffd240) at /home/michal/dev/canonical/multipass/multipass/src/platform/backends/qemu/qemu_virtual_machine.cpp:394
#3  0x0000555555be84ed in multipass::utils::try_action_for<multipass::QemuVirtualMachine::ssh_hostname()::<lambda()>&, multipass::QemuVirtualMachine::ssh_hostname()::<lambda()>&>(multipass::QemuVirtualMachine::<lambda()> &, std::chrono::milliseconds, multipass::QemuVirtualMachine::<lambda()> &) (on_timeout=..., timeout=..., try_action=...) at /home/michal/dev/canonical/multipass/multipass/include/multipass/utils.h:88
#4  0x0000555555be7c44 in multipass::QemuVirtualMachine::ssh_hostname[abi:cxx11]() (this=0x555556526320) at /home/michal/dev/canonical/multipass/multipass/src/platform/backends/qemu/qemu_virtual_machine.cpp:407
#5  0x0000555555c00316 in multipass::utils::<lambda()>::operator()(void) const (__closure=0x7fffffffd390) at /home/michal/dev/canonical/multipass/multipass/src/utils/utils.cpp:152
#6  0x0000555555c01596 in multipass::utils::try_action_for<multipass::utils::wait_until_ssh_up(multipass::VirtualMachine*, std::chrono::milliseconds, const std::function<void()>&)::<lambda()>&, multipass::utils::wait_until_ssh_up(multipass::VirtualMachine*, std::chrono::milliseconds, const std::function<void()>&)::<lambda()>&>(multipass::utils::<lambda()> &, std::chrono::milliseconds, multipass::utils::<lambda()> &) (on_timeout=..., timeout=..., try_action=...)
    at /home/michal/dev/canonical/multipass/multipass/include/multipass/utils.h:88
#7  0x0000555555c00528 in multipass::utils::wait_until_ssh_up(multipass::VirtualMachine*, std::chrono::duration<long, std::ratio<1l, 1000l> >, std::function<void ()> const&) (virtual_machine=0x555556526320, timeout=..., 
    process_vm_events=...) at /home/michal/dev/canonical/multipass/multipass/src/utils/utils.cpp:168
#8  0x0000555555be7e68 in multipass::QemuVirtualMachine::wait_until_ssh_up (this=0x555556526320, timeout=...) at /home/michal/dev/canonical/multipass/multipass/src/platform/backends/qemu/qemu_virtual_machine.cpp:441
#9  0x0000555555b472e0 in multipass::Daemon::launch (this=0x7fffffffe000, context=0x7fffdd7f9780, request=0x7fffdd7f94b0, server=0x7fffdd7f9470) at /home/michal/dev/canonical/multipass/multipass/src/daemon/daemon.cpp:754
#10 0x0000555555b7992a in QtPrivate::FunctorCall<QtPrivate::IndexesList<0, 1, 2>, QtPrivate::List<grpc::ServerContext*, multipass::LaunchRequest const*, grpc::ServerWriter<multipass::LaunchReply>*>, grpc::Status, grpc::Status (multipass::Daemon::*)(grpc::ServerContext*, multipass::LaunchRequest const*, grpc::ServerWriter<multipass::LaunchReply>*)>::call (f=&virtual table offset 144, o=0x7fffffffe000, arg=0x7fffdd7f90f0)
    at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:134
#11 0x0000555555b74166 in QtPrivate::FunctionPointer<grpc::Status (multipass::Daemon::*)(grpc::ServerContext*, multipass::LaunchRequest const*, grpc::ServerWriter<multipass::LaunchReply>*)>::call<QtPrivate::List<grpc::ServerContext*, multipass::LaunchRequest const*, grpc::ServerWriter<multipass::LaunchReply>*>, grpc::Status> (f=&virtual table offset 144, o=0x7fffffffe000, arg=0x7fffdd7f90f0) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:167
#12 0x0000555555b6dc88 in QtPrivate::QSlotObject<grpc::Status (multipass::Daemon::*)(grpc::ServerContext*, multipass::LaunchRequest const*, grpc::ServerWriter<multipass::LaunchReply>*), QtPrivate::List<grpc::ServerContext*, multipass::LaunchRequest const*, grpc::ServerWriter<multipass::LaunchReply>*>, grpc::Status>::impl (which=1, this_=0x555556469270, r=0x7fffffffe000, a=0x7fffdd7f90f0, ret=0x0) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:396
#13 0x00007ffff747bf92 in QObject::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#14 0x00007ffff7452476 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#15 0x00007ffff745548b in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#16 0x00007ffff74a4b23 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#17 0x00007ffff4284c3e in g_main_context_dispatch () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#18 0x00007ffff4284ed8 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#19 0x00007ffff4284f6c in g_main_context_iteration () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#20 0x00007ffff74a4143 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#21 0x00007ffff745116b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#22 0x00007ffff74592e2 in QCoreApplication::exec() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#23 0x0000555555b1eb2a in main (argc=5, argv=0x7fffffffe3e8) at /home/michal/dev/canonical/multipass/multipass/src/daemon/daemon_main.cpp:123
#0  0x00007ffff73e7254 in QProcess::state() const () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
No symbol table info available.
#1  0x0000555555be7a67 in multipass::QemuVirtualMachine::ensure_vm_is_running (this=0x555556526320) at /home/michal/dev/canonical/multipass/multipass/src/platform/backends/qemu/qemu_virtual_machine.cpp:385
No locals.
#2  0x0000555555be7b17 in multipass::QemuVirtualMachine::<lambda()>::operator()(void) const (__closure=0x7fffffffd240) at /home/michal/dev/canonical/multipass/multipass/src/platform/backends/qemu/qemu_virtual_machine.cpp:394
        result = std::experimental::optional<multipass::IPAddress> [no contained value]
        this = 0x555556526320
#3  0x0000555555be84ed in multipass::utils::try_action_for<multipass::QemuVirtualMachine::ssh_hostname()::<lambda()>&, multipass::QemuVirtualMachine::ssh_hostname()::<lambda()>&>(multipass::QemuVirtualMachine::<lambda()> &, std::chrono::milliseconds, multipass::QemuVirtualMachine::<lambda()> &) (on_timeout=..., timeout=..., try_action=...) at /home/michal/dev/canonical/multipass/multipass/include/multipass/utils.h:88
        deadline = {__d = {__r = 9743235335871}}
#4  0x0000555555be7c44 in multipass::QemuVirtualMachine::ssh_hostname[abi:cxx11]() (this=0x555556526320) at /home/michal/dev/canonical/multipass/multipass/src/platform/backends/qemu/qemu_virtual_machine.cpp:407
        action = {__this = 0x555556526320}
        on_timeout = {<No data fields>}
#5  0x0000555555c00316 in multipass::utils::<lambda()>::operator()(void) const (__closure=0x7fffffffd390) at /home/michal/dev/canonical/multipass/multipass/src/utils/utils.cpp:152
        session = {session = std::unique_ptr<ssh_session_struct> = {get() = 0x555556526320}}
        process_vm_events = @0x7fffffffd400: {<std::_Maybe_unary_or_binary_function<void>> = {<No data fields>}, <std::_Function_base> = {static _M_max_size = 16, static _M_max_align = 8, _M_functor = {_M_unused = {
                _M_object = 0x555556526320, _M_const_object = 0x555556526320, _M_function_pointer = 0x555556526320, 
                _M_member_pointer = (void (std::_Undefined_class::*)(std::_Undefined_class * const)) 0x555556526320, this adjustment 140737488344112}, _M_pod_data = " cRVUU\000\000\060\324\377\377\377\177\000"}, 
            _M_manager = 0x555555be8c93 <std::_Function_base::_Base_manager<multipass::QemuVirtualMachine::wait_until_ssh_up(std::chrono::milliseconds)::<lambda()> >::_M_manager(std::_Any_data &, const std::_Any_data &, std::_Manager_operation)>}, _M_invoker = 0x555555be8c70 <std::_Function_handler<void(), multipass::QemuVirtualMachine::wait_until_ssh_up(std::chrono::milliseconds)::<lambda()> >::_M_invoke(const std::_Any_data &)>}
        virtual_machine = 0x555556526320
#6  0x0000555555c01596 in multipass::utils::try_action_for<multipass::utils::wait_until_ssh_up(multipass::VirtualMachine*, std::chrono::milliseconds, const std::function<void()>&)::<lambda()>&, multipass::utils::wait_until_ssh_up(multipass::VirtualMachine*, std::chrono::milliseconds, const std::function<void()>&)::<lambda()>&>(multipass::utils::<lambda()> &, std::chrono::milliseconds, multipass::utils::<lambda()> &) (on_timeout=..., timeout=..., try_action=...)
    at /home/michal/dev/canonical/multipass/multipass/include/multipass/utils.h:88
        deadline = {__d = {__r = 9923235294526}}
#7  0x0000555555c00528 in multipass::utils::wait_until_ssh_up(multipass::VirtualMachine*, std::chrono::duration<long, std::ratio<1l, 1000l> >, std::function<void ()> const&) (virtual_machine=0x555556526320, timeout=..., 
    process_vm_events=...) at /home/michal/dev/canonical/multipass/multipass/src/utils/utils.cpp:168
        action = {__virtual_machine = 0x555556526320, __process_vm_events = @0x7fffffffd400}
        on_timeout = {__virtual_machine = 0x555556526320}
#8  0x0000555555be7e68 in multipass::QemuVirtualMachine::wait_until_ssh_up (this=0x555556526320, timeout=...) at /home/michal/dev/canonical/multipass/multipass/src/platform/backends/qemu/qemu_virtual_machine.cpp:441
        process_vm_events = {__this = 0x555556526320}
#9  0x0000555555b472e0 in multipass::Daemon::launch (this=0x7fffffffe000, context=0x7fffdd7f9780, request=0x7fffdd7f94b0, server=0x7fffdd7f9470) at /home/michal/dev/canonical/multipass/multipass/src/daemon/daemon.cpp:754
        logger = {<multipass::logging::Logger> = {_vptr.Logger = 0x5555563c8b20 <vtable for multipass::logging::ClientLogger<multipass::LaunchReply>+16>}, logging_level = multipass::logging::Level::error, server = 0x7fffdd7f9470, 
          mpx_logger = @0x55555643f190}
        option_errors = {<google::protobuf::Message> = {<google::protobuf::MessageLite> = {_vptr.MessageLite = 0x5555563d2fb0 <vtable for multipass::LaunchError+16>}, <No data fields>}, static kIndexInFileMessages = 2, 
          static OK = multipass::LaunchError_ErrorCodes_OK, static INSTANCE_EXISTS = multipass::LaunchError_ErrorCodes_INSTANCE_EXISTS, static INVALID_MEM_SIZE = multipass::LaunchError_ErrorCodes_INVALID_MEM_SIZE, 
          static INVALID_DISK_SIZE = multipass::LaunchError_ErrorCodes_INVALID_DISK_SIZE, static INVALID_HOSTNAME = multipass::LaunchError_ErrorCodes_INVALID_HOSTNAME, static ErrorCodes_MIN = multipass::LaunchError_ErrorCodes_OK, 
          static ErrorCodes_MAX = multipass::LaunchError_ErrorCodes_INVALID_HOSTNAME, static ErrorCodes_ARRAYSIZE = 5, static kErrorCodesFieldNumber = 1, 
          _internal_metadata_ = {<google::protobuf::internal::InternalMetadataWithArenaBase<google::protobuf::UnknownFieldSet, google::protobuf::internal::InternalMetadataWithArena>> = {ptr_ = 0x0, static kPtrTagMask = 1, 
              static kPtrValueMask = -2}, <No data fields>}, error_codes_ = {static kInitialSize = <optimized out>, current_size_ = 0, total_size_ = 0, static kRepHeaderSize = 8, ptr_ = {arena = 0x0, rep = 0x0}}, 
          _error_codes_cached_byte_size_ = 1447076376, _cached_size_ = {size_ = {<std::__atomic_base<int>> = {static _S_alignment = 4, _M_i = 0}, <No data fields>}}}
        progress_monitor = {__server = 0x7fffdd7f9470}
        vendor_data_cloud_init_config = {m_isValid = true, m_pMemory = std::shared_ptr<YAML::detail::memory_holder> (use count 1, weak count 0) = {get() = 0x555556481a10}, m_pNode = 0x555556482440}
        vm_desc = {num_cores = 1, mem_size = "1G", disk_space = "5G", vm_name = "grand-guanaco", mac_addr = "52:54:00:bd:35:7f", ssh_username = "multipass", image = {image_path = {static null = {<No data fields>}, d = 0x55555647ac10}, 
            kernel_path = {static null = {<No data fields>}, d = 0x7ffff7553660 <QArrayData::shared_null>}, initrd_path = {static null = {<No data fields>}, d = 0x7ffff7553660 <QArrayData::shared_null>}, 
            id = "56e742b3e6895f1fc79eacbe5a214254b55c61928080bf6132e5908981f3740d", original_release = "Snapcraft builder for Core 18", current_release = "", release_date = "", aliases = std::vector of length 0, capacity 0}, 
          cloud_init_iso = {static null = {<No data fields>}, d = 0x55555652daf0}, key_provider = @0x555556417340}
        reply = {<google::protobuf::Message> = {<google::protobuf::MessageLite> = {_vptr.MessageLite = 0x5555563d2b78 <vtable for multipass::LaunchReply+16>}, <No data fields>}, static kIndexInFileMessages = 7, 
          static kLogLineFieldNumber = 6, static kMetricsShowInfoFieldNumber = 5, static kMetricsPendingFieldNumber = 4, static kVmInstanceNameFieldNumber = 1, static kLaunchProgressFieldNumber = 2, static kCreateMessageFieldNumber = 3, 
          _internal_metadata_ = {<google::protobuf::internal::InternalMetadataWithArenaBase<google::protobuf::UnknownFieldSet, google::protobuf::internal::InternalMetadataWithArena>> = {ptr_ = 0x0, static kPtrTagMask = 1, 
              static kPtrValueMask = -2}, <No data fields>}, log_line_ = {ptr_ = 0x555556400b80 <google::protobuf::internal::fixed_address_empty_string[abi:cxx11]>}, metrics_show_info_ = 0x0, metrics_pending_ = false, create_oneof_ = {
            vm_instance_name_ = {ptr_ = 0x555556474440}, launch_progress_ = 0x555556474440, create_message_ = {ptr_ = 0x555556474440}}, _cached_size_ = {size_ = {<std::__atomic_base<int>> = {static _S_alignment = 4, 
                _M_i = 24}, <No data fields>}}, _oneof_case_ = {3}}
        user_data_cloud_init_config = {m_isValid = true, m_pMemory = std::shared_ptr<YAML::detail::memory_holder> (use count 1, weak count 0) = {get() = 0x55555644ca20}, m_pNode = 0x55555652f350}
        mac_addr = "52:54:00:bd:35:7f"
        prepare_action = {__this = 0x7fffffffe000, __server = 0x7fffdd7f9470, __name = "grand-guanaco"}
        name = "grand-guanaco"
        query = {name = "grand-guanaco", release = "core18", persistent = false, remote_name = "snapcraft", query_type = multipass::Query::Alias}
        fetch_type = multipass::FetchType::ImageOnly
        vm_image = {image_path = {static null = {<No data fields>}, d = 0x55555647ac10}, kernel_path = {static null = {<No data fields>}, d = 0x7ffff7553660 <QArrayData::shared_null>}, initrd_path = {static null = {<No data fields>}, 
            d = 0x7ffff7553660 <QArrayData::shared_null>}, id = "56e742b3e6895f1fc79eacbe5a214254b55c61928080bf6132e5908981f3740d", original_release = "Snapcraft builder for Core 18", current_release = "", release_date = "", 
          aliases = std::vector of length 0, capacity 0}
        meta_data_cloud_init_config = {m_isValid = true, m_pMemory = std::shared_ptr<YAML::detail::memory_holder> (use count 1, weak count 0) = {get() = 0x555556415d20}, m_pNode = 0x55555652ec80}
        vm = std::unique_ptr<multipass::VirtualMachine> = {get() = 0x0}
#10 0x0000555555b7992a in QtPrivate::FunctorCall<QtPrivate::IndexesList<0, 1, 2>, QtPrivate::List<grpc::ServerContext*, multipass::LaunchRequest const*, grpc::ServerWriter<multipass::LaunchReply>*>, grpc::Status, grpc::Status (multipass::Daemon::*)(grpc::ServerContext*, multipass::LaunchRequest const*, grpc::ServerWriter<multipass::LaunchReply>*)>::call (f=&virtual table offset 144, o=0x7fffffffe000, arg=0x7fffdd7f90f0)
    at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:134
No locals.
#11 0x0000555555b74166 in QtPrivate::FunctionPointer<grpc::Status (multipass::Daemon::*)(grpc::ServerContext*, multipass::LaunchRequest const*, grpc::ServerWriter<multipass::LaunchReply>*)>::call<QtPrivate::List<grpc::ServerContext*, multipass::LaunchRequest const*, grpc::ServerWriter<multipass::LaunchReply>*>, grpc::Status> (f=&virtual table offset 144, o=0x7fffffffe000, arg=0x7fffdd7f90f0) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:167
No locals.
#12 0x0000555555b6dc88 in QtPrivate::QSlotObject<grpc::Status (multipass::Daemon::*)(grpc::ServerContext*, multipass::LaunchRequest const*, grpc::ServerWriter<multipass::LaunchReply>*), QtPrivate::List<grpc::ServerContext*, multipass::LaunchRequest const*, grpc::ServerWriter<multipass::LaunchReply>*>, grpc::Status>::impl (which=1, this_=0x555556469270, r=0x7fffffffe000, a=0x7fffdd7f90f0, ret=0x0) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qobjectdefs_impl.h:396
No locals.
#13 0x00007ffff747bf92 in QObject::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
No symbol table info available.
#14 0x00007ffff7452476 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
No symbol table info available.
#15 0x00007ffff745548b in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
No symbol table info available.
#16 0x00007ffff74a4b23 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
No symbol table info available.
#17 0x00007ffff4284c3e in g_main_context_dispatch () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#18 0x00007ffff4284ed8 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#19 0x00007ffff4284f6c in g_main_context_iteration () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
No symbol table info available.
#20 0x00007ffff74a4143 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
No symbol table info available.
#21 0x00007ffff745116b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
No symbol table info available.
#22 0x00007ffff74592e2 in QCoreApplication::exec() () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
No symbol table info available.
#23 0x0000555555b1eb2a in main (argc=5, argv=0x7fffffffe3e8) at /home/michal/dev/canonical/multipass/multipass/src/daemon/daemon_main.cpp:123
        app = <incomplete type>
        builder = {url_downloader = std::unique_ptr<multipass::URLDownloader> = {get() = 0x0}, factory = std::unique_ptr<multipass::VirtualMachineFactory> = {get() = 0x0}, image_hosts = std::vector of length 0, capacity 0, 
          vault = std::unique_ptr<multipass::VMImageVault> = {get() = 0x0}, name_generator = std::unique_ptr<multipass::NameGenerator> = {get() = 0x0}, ssh_key_provider = std::unique_ptr<multipass::SSHKeyProvider> = {get() = 0x0}, 
          cert_provider = std::unique_ptr<multipass::CertProvider> = {get() = 0x0}, client_cert_store = std::unique_ptr<multipass::CertStore> = {get() = 0x0}, logger = std::unique_ptr<multipass::logging::Logger> = {get() = 0x0}, 
          cache_directory = {static null = {<No data fields>}, d = 0x555556446700}, data_directory = {static null = {<No data fields>}, d = 0x555556446760}, server_address = "unix:/run/multipass_socket", ssh_username = "multipass", 
          days_to_expire = {__r = 14}, image_refresh_timer = {__r = 6}, verbosity_level = multipass::logging::Level::debug, connection_type = multipass::RpcConnectionType::ssl}
        config = std::unique_ptr<const multipass::DaemonConfig> = {get() = 0x0}
        server_address = "unix:/run/multipass_socket"
        daemon = {<QObject> = {<No data fields>}, <multipass::Rpc::Service> = {<grpc::Service> = {_vptr.Service = 0x5555563c9628 <vtable for multipass::Daemon+296>, server_ = 0x0, methods_ = std::vector of length 16, capacity 16 = {
                std::unique_ptr<grpc::internal::RpcServiceMethod> = {get() = 0x555556454410}, std::unique_ptr<grpc::internal::RpcServiceMethod> = {get() = 0x555556454c10}, std::unique_ptr<grpc::internal::RpcServiceMethod> = {
                  get() = 0x55555644d200}, std::unique_ptr<grpc::internal::RpcServiceMethod> = {get() = 0x55555644df70}, std::unique_ptr<grpc::internal::RpcServiceMethod> = {get() = 0x555556454b60}, 
                std::unique_ptr<grpc::internal::RpcServiceMethod> = {get() = 0x55555643f0b0}, std::unique_ptr<grpc::internal::RpcServiceMethod> = {get() = 0x55555645f4c0}, std::unique_ptr<grpc::internal::RpcServiceMethod> = {
                  get() = 0x55555645d0b0}, std::unique_ptr<grpc::internal::RpcServiceMethod> = {get() = 0x55555645f580}, std::unique_ptr<grpc::internal::RpcServiceMethod> = {get() = 0x55555645f600}, 
                std::unique_ptr<grpc::internal::RpcServiceMethod> = {get() = 0x55555645f680}, std::unique_ptr<grpc::internal::RpcServiceMethod> = {get() = 0x55555645f700}, std::unique_ptr<grpc::internal::RpcServiceMethod> = {
                  get() = 0x55555645f780}, std::unique_ptr<grpc::internal::RpcServiceMethod> = {get() = 0x55555645f800}, std::unique_ptr<grpc::internal::RpcServiceMethod> = {get() = 0x55555645f880}, 
                std::unique_ptr<grpc::internal::RpcServiceMethod> = {get() = 0x55555645f900}}}, <No data fields>}, <multipass::VMStatusMonitor> = {_vptr.VMStatusMonitor = 0x5555563c96c8 <vtable for multipass::Daemon+456>}, 
          static staticMetaObject = {d = {superdata = 0x7ffff7736980 <QObject::staticMetaObject>, stringdata = 0x5555560f0660 <qt_meta_stringdata_multipass__Daemon>, data = 0x5555560f0f60 <qt_meta_data_multipass__Daemon>, 
              static_metacall = 0x555555ba7382 <multipass::Daemon::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>, relatedMetaObjects = 0x0, extradata = 0x0}}, config = std::unique_ptr<const multipass::DaemonConfig> = {
            get() = 0x555556449210}, vm_instance_specs = std::unordered_map with 0 elements, vm_instances = std::unordered_map with 0 elements, deleted_instances = std::unordered_map with 0 elements, 
          mount_threads = std::unordered_map with 0 elements, delayed_shutdown_instances = std::unordered_map with 0 elements, allocated_mac_addrs = std::unordered_set with 1 element = {[0] = "52:54:00:bd:35:7f"}, 
          remote_image_host_map = std::unordered_map with 4 elements = {["daily"] = 0x55555644d450, ["release"] = 0x55555644d450, [""] = 0x55555644c570, ["snapcraft"] = 0x55555644c570}, 
          daemon_rpc = {<QObject> = {<No data fields>}, <multipass::Rpc::Service> = {<grpc::Service> = {_vptr.Service = 0x5555563c9470 <vtable for multipass::DaemonRpc+256>, server_ = 0x0, 
                methods_ = std::vector of length 16, capacity 16 = {std::unique_ptr<grpc::internal::RpcServiceMethod> = {get() = 0x55555645cb90}, std::unique_ptr<grpc::internal::RpcServiceMethod> = {get() = 0x55555645fa50}, 
                  std::unique_ptr<grpc::internal::RpcServiceMethod> = {get() = 0x55555645fad0}, std::unique_ptr<grpc::internal::RpcServiceMethod> = {get() = 0x55555645fb50}, std::unique_ptr<grpc::internal::RpcServiceMethod> = {
                    get() = 0x55555645fbd0}, std::unique_ptr<grpc::internal::RpcServiceMethod> = {get() = 0x55555645fc50}, std::unique_ptr<grpc::internal::RpcServiceMethod> = {get() = 0x55555645fcd0}, 
                  std::unique_ptr<grpc::internal::RpcServiceMethod> = {get() = 0x55555645fd50}, std::unique_ptr<grpc::internal::RpcServiceMethod> = {get() = 0x55555645fdd0}, std::unique_ptr<grpc::internal::RpcServiceMethod> = {
                    get() = 0x55555645fe50}, std::unique_ptr<grpc::internal::RpcServiceMethod> = {get() = 0x55555645fed0}, std::unique_ptr<grpc::internal::RpcServiceMethod> = {get() = 0x55555645ff50}, 
                  std::unique_ptr<grpc::internal::RpcServiceMethod> = {get() = 0x55555645ffd0}, std::unique_ptr<grpc::internal::RpcServiceMethod> = {get() = 0x555556460050}, std::unique_ptr<grpc::internal::RpcServiceMethod> = {
                    get() = 0x5555564600d0}, std::unique_ptr<grpc::internal::RpcServiceMethod> = {get() = 0x555556460150}}}, <No data fields>}, static staticMetaObject = {d = {superdata = 0x7ffff7736980 <QObject::staticMetaObject>, 
                stringdata = 0x5555560f1300 <qt_meta_stringdata_multipass__DaemonRpc>, data = 0x5555560f1c00 <qt_meta_data_multipass__DaemonRpc>, 
                static_metacall = 0x555555ba7da6 <multipass::DaemonRpc::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>, relatedMetaObjects = 0x0, extradata = 0x0}}, server_address = "unix:/run/multipass_socket", 
            server = std::unique_ptr<grpc::Server> = {get() = 0x555556456e50}}, source_images_maintenance_task = <incomplete type>, metrics_provider = {metrics_url = {d = 0x5555564685c0}, unique_id = {static null = {<No data fields>}, 
              d = 0x555556457830}, data_path = {static null = {<No data fields>}, d = 0x555556446760}, metric_batches = {d = 0x0, a = 0x0}, metrics_mutex = {<std::__mutex_base> = {_M_mutex = pthread_mutex_t = {Type = Normal, 
                  Status = Not acquired, Robust = No, Shared = No, Protocol = None}}, <No data fields>}, metrics_cv = {_M_cond = pthread_cond_t = {Threads known to still execute a wait function = 1, Clock ID = CLOCK_REALTIME, 
                Shared = No}}, running = true, metrics_available = false, metrics_sender = {thread = {_M_id = {_M_thread = 140736917911296}}}}, metrics_opt_in = {opt_in_status = multipass::OptInStatus_Status_PENDING, 
            delay_opt_in_count = 3}}
        handler = {signal_handling_thread = {thread = {_M_id = {_M_thread = 140737201219328}}}}
  Id   Target Id                                           Frame 
* 1    Thread 0x7fffef614bc0 (LWP 30233) "multipassd"      0x00007ffff73e7254 in QProcess::state() const () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
  2    Thread 0x7fffeee2a700 (LWP 30406) "multipassd"      0x00007ffff6d0e06c in __GI___sigtimedwait (set=set@entry=0x7fffeee298f0, info=info@entry=0x7fffeee297c0, timeout=timeout@entry=0x0)
    at ../sysdeps/unix/sysv/linux/sigtimedwait.c:29
  3    Thread 0x7fffee629700 (LWP 30409) "Qt bearer threa" futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x7fffe0013b00) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
  4    Thread 0x7fffedd5b700 (LWP 30412) "QDBusConnection" 0x00007ffff6dda6d9 in __GI___poll (fds=0x7fffe0004db0, nfds=2, timeout=24618) at ../sysdeps/unix/sysv/linux/poll.c:29
  5    Thread 0x7fffed51b700 (LWP 30467) "QNetworkAccessM" 0x00007ffff6dda6d9 in __GI___poll (fds=0x7fffe40049b0, nfds=1, timeout=124441) at ../sysdeps/unix/sysv/linux/poll.c:29
  6    Thread 0x7fffecd1a700 (LWP 30469) "Thread (pooled)" futex_reltimed_wait_cancelable (private=<optimized out>, reltime=0x7fffecd19890, expected=0, futex_word=0x7fffe4005fb4) at ../sysdeps/unix/sysv/linux/futex-internal.h:142
  10   Thread 0x7fffdf7fe700 (LWP 30486) "default-executo" futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x5555564601f4) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
  11   Thread 0x7fffdffff700 (LWP 30487) "resolver-execut" futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x55555645e8d0) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
  12   Thread 0x7fffdeffd700 (LWP 30488) "grpc_global_tim" futex_reltimed_wait_cancelable (private=<optimized out>, reltime=0x7fffdeffc830, expected=0, futex_word=0x5555563fba6c <g_cv_wait+44>)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:142
  13   Thread 0x7fffde7fc700 (LWP 30489) "grpcpp_sync_ser" 0x00007ffff6de710f in epoll_wait (epfd=17, events=0x7fffc4000d08, maxevents=100, timeout=10000) at ../sysdeps/unix/sysv/linux/epoll_wait.c:30
  14   Thread 0x7fffddffb700 (LWP 30490) "multipassd"      futex_abstimed_wait_cancelable (private=<optimized out>, abstime=0x7fffddffa7e0, expected=0, futex_word=0x7fffffffe2c8) at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  15   Thread 0x7fffdd7fa700 (LWP 30721) "grpcpp_sync_ser" syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
  16   Thread 0x7fffdcff9700 (LWP 30995) "grpc_global_tim" futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x5555563fba6c <g_cv_wait+44>) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
  17   Thread 0x7fffc3fff700 (LWP 382) "grpcpp_sync_ser"   futex_reltimed_wait_cancelable (private=<optimized out>, reltime=0x7fffc3ffe440, expected=0, futex_word=0x7fffc3ffe5e0) at ../sysdeps/unix/sysv/linux/futex-internal.h:142
ricab commented 5 years ago

It turns out this is a thread-synchronization problem: one thread is still processing the launch after another deleted the instance. In here it was after ctrl+c, but it could have been parallel clients.

The agreement to address this is to use QReadWriteLock to lock obviously destructive operations in the delete procedure, locking it only for reading in other operations, for the time being.