This seems to happen with multiple applications, but the most common crashes occur with firefox (unsnapped) and kgx.
With an external monitor hooked up to my nvidia GPU, there's a random chance that Mir will freeze (not crash) upon closing a window of one the aforementioned applications (among others, but those two are the two I most open and close windows with). @AlanGriffiths confirmed that this doesn't happen on his machine which doesn't use nvidia graphics.
I tried both inspecting a coredump and running mir under a debugger with and without cleanup signal handling code disabled. It appears that no signal is raised when the bug is triggered as gdb doesn't stop, I have to manually stop using ctrl + c. The stack trace doesn't contain any immediately suspicious functions. Logs also don't show any errors.
How I disabled signal handling / cleanup code
**This is just an educated guess, so it might be wrong.**
```diff
@@ -34,7 +34,6 @@
namespace
{
-constexpr std::array const fatal_error_signals = {SIGQUIT, SIGABRT, SIGFPE, SIGSEGV, SIGBUS };
std::weak_ptr weak_emergency_cleanup;
@@ -210,17 +209,6 @@ void mir::run_mir(
server_ptr->stop();
};
- struct sigaction old_action;
- if ((sigaction(SIGHUP, nullptr, &old_action) == 0) && (old_action.sa_handler == SIG_IGN))
- {
- // If our parent process is ignoring SIGHUP (e.g. is nohup) then we do the same
- main_loop->register_signal_handler({SIGINT, SIGTERM}, terminator);
- }
- else
- {
- main_loop->register_signal_handler({SIGINT, SIGHUP, SIGTERM}, terminator);
- }
-
FatalErrorStrategy fatal_error_strategy{config.the_fatal_error_strategy()};
DisplayServer server(config);
@@ -228,53 +216,6 @@ void mir::run_mir(
weak_emergency_cleanup = config.the_emergency_cleanup();
- static std::atomic concurrent_calls{0};
-
- auto const raii = raii::paired_calls(
- [&]()
- {
- if (!concurrent_calls++)
- {
- for (auto sig : fatal_error_signals)
- {
- struct sigaction sig_handler_desc;
- sigfillset(&sig_handler_desc.sa_mask);
- sig_handler_desc.sa_flags = SA_SIGINFO;
- sig_handler_desc.sa_sigaction = &fatal_signal_cleanup;
-
- if (sigaction(sig, &sig_handler_desc, old_handlers.initialiser_for_signal(sig)))
- {
- using namespace std::string_literals;
- BOOST_THROW_EXCEPTION((
- std::system_error{
- errno,
- std::system_category(),
- "Failed to install signal handler for "s + signum_to_string(sig)
- }));
- }
- }
- }
- },
- [&]()
- {
- if (!--concurrent_calls)
- {
- for (auto sig : fatal_error_signals)
- {
- if (sigaction(sig, old_handlers.at(sig), nullptr))
- {
- using namespace std::string_literals;
- BOOST_THROW_EXCEPTION((
- std::system_error{
- errno,
- std::system_category(),
- "Failed to install signal handler for "s + signum_to_string(sig)
- }));
- }
- }
- }
- });
-
mir::ThreadPoolExecutor::set_unhandled_exception_handler(&terminate_with_current_exception);
init(server);
```
The crash happens if there's any content on the external monitor. So --display-config=clone or --display-config=sidebyside exhibit the issue. But --display-config=single doesn't.
The crash sometimes breaks things so bad the magic sysreqs don't work and I have to force shutdown
Looking at coredump stack traces, there isn't one place where Mir always crashes. If we ignore threads that are external to us, usually there are some threads called from Mir and into OpenGL.
Some apps like xterm don't exhibit this crash.
It doesn't matter if alt+f4 or ctrl+d is used with kgx.
Coredump stack trace sample (signal handling / cleanup code disabled)
Notable threads are: 1, 29, and 14.
```
Thread 30 (Thread 0x7fb7ae4006c0 (LWP 11804)):
#0 futex_wait (private=0, expected=2, futex_word=0x599d2b579530) at ../sysdeps/nptl/futex-internal.h:146
#1 __GI___lll_lock_wait (futex=futex@entry=0x599d2b579530, private=0) at ./nptl/lowlevellock.c:49
#2 0x00007fb7fd0a00f1 in lll_mutex_lock_optimized (mutex=0x599d2b579530) at ./nptl/pthread_mutex_lock.c:48
#3 ___pthread_mutex_lock (mutex=0x599d2b579530) at ./nptl/pthread_mutex_lock.c:93
#4 0x00007fb7f90b9a35 in ??? () at /lib/x86_64-linux-gnu/libEGL_nvidia.so.0
#5 0x00007fb7f906fb7b in ??? () at /lib/x86_64-linux-gnu/libEGL_nvidia.so.0
#6 0x00007fb7f90bfcce in ??? () at /lib/x86_64-linux-gnu/libEGL_nvidia.so.0
#7 0x00007fb7fd09ca94 in start_thread (arg=) at ./nptl/pthread_create.c:447
#8 0x00007fb7fd129c3c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
Thread 29 (Thread 0x7fb7c74006c0 (LWP 11517)):
#0 futex_wait (private=0, expected=2, futex_word=0x599d2b579530) at ../sysdeps/nptl/futex-internal.h:146
#1 __GI___lll_lock_wait (futex=futex@entry=0x599d2b579530, private=0) at ./nptl/lowlevellock.c:49
#2 0x00007fb7fd0a00f1 in lll_mutex_lock_optimized (mutex=0x599d2b579530) at ./nptl/pthread_mutex_lock.c:48
#3 ___pthread_mutex_lock (mutex=0x599d2b579530) at ./nptl/pthread_mutex_lock.c:93
#4 0x00007fb7fb362a25 in ??? () at /lib/x86_64-linux-gnu/libnvidia-glsi.so.550.120
#5 0x00007fb7fb36e1ee in _nv004glsi () at /lib/x86_64-linux-gnu/libnvidia-glsi.so.550.120
#6 0x00007fb7f2bf2701 in ??? () at /lib/x86_64-linux-gnu/libnvidia-eglcore.so.550.120
#7 0x00007fb7f29c8b21 in ??? () at /lib/x86_64-linux-gnu/libnvidia-eglcore.so.550.120
#8 0x00007fb7fc26ae25 in (anonymous namespace)::BoundEGLStream::TextureHandle::bind (this=0x7fb79020da80) at /home/tarek/code-projects/mir/src/platforms/eglstream-kms/server/buffer_allocator.cpp:203
#9 0x00007fb7fc26c2b8 in (anonymous namespace)::EGLStreamBuffer::bind (this=0x7fb79020da50) at /home/tarek/code-projects/mir/src/platforms/eglstream-kms/server/buffer_allocator.cpp:466
#10 0x00007fb7fe569042 in mir::renderer::gl::Renderer::draw (this=0x7fb79c371830, renderable=...) at /home/tarek/code-projects/mir/src/renderers/gl/renderer.cpp:502
#11 0x00007fb7fe5685ac in mir::renderer::gl::Renderer::render (this=0x7fb79c371830, renderables=std::vector of length 7, capacity 7 = {...}) at /home/tarek/code-projects/mir/src/renderers/gl/renderer.cpp:366
#12 0x00007fb7fe297b0d in mir::compositor::DefaultDisplayBufferCompositor::composite (this=0x7fb790205200, scene_elements=...) at /home/tarek/code-projects/mir/src/server/compositor/default_display_buffer_compositor.cpp:121
#13 0x00007fb7fe2a088d in mir::compositor::CompositingFunctor::operator() (this=0x599d2c926a10) at /home/tarek/code-projects/mir/src/server/compositor/multi_threaded_compositor.cpp:153
#14 0x00007fb7fe2a690f in std::__invoke_impl (__f=...) at /usr/include/c++/13/bits/invoke.h:61
#15 0x00007fb7fe2a6781 in std::__invoke (__fn=...) at /usr/include/c++/13/bits/invoke.h:96
#16 0x00007fb7fe2a609e in std::reference_wrapper::operator()<>() const (this=0x599d2bd21730) at /usr/include/c++/13/bits/refwrap.h:359
#17 0x00007fb7fe2a5568 in std::__invoke_impl&> (__f=...) at /usr/include/c++/13/bits/invoke.h:61
#18 0x00007fb7fe2a4766 in std::__invoke_r&> (__fn=...) at /usr/include/c++/13/bits/invoke.h:111
#19 0x00007fb7fe2a37fe in std::_Function_handler >::_M_invoke(std::_Any_data const&) (__functor=...) at /usr/include/c++/13/bits/std_function.h:290
#20 0x00007fb7fe8a47e0 in std::function::operator()() const (this=0x599d2bd21730) at /usr/include/c++/13/bits/std_function.h:591
#21 0x00007fb7fe8bb00f in operator() (__closure=0x599d2bd21710) at /home/tarek/code-projects/mir/src/common/thread_pool_executor.cpp:204
#22 0x00007fb7fe8bd67e in std::__invoke_impl&&)::&>(std::__invoke_other, struct {...} &) (__f=...) at /usr/include/c++/13/bits/invoke.h:61
#23 0x00007fb7fe8bcf1f in std::__invoke_r&&)::&>(struct {...} &) (__fn=...) at /usr/include/c++/13/bits/invoke.h:111
#24 0x00007fb7fe8bc59a in std::_Function_handler&&):: >::_M_invoke(const std::_Any_data &) (__functor=...) at /usr/include/c++/13/bits/std_function.h:290
#25 0x00007fb7fe8a47e0 in std::function::operator()() const (this=0x7fb7c73ff270) at /usr/include/c++/13/bits/std_function.h:591
#26 0x00007fb7fe8babb0 in (anonymous namespace)::Worker::work_loop (me=0x599d2b55b950, shutdown_channel=...) at /home/tarek/code-projects/mir/src/common/thread_pool_executor.cpp:122
#27 0x00007fb7fe8be6c5 in std::__invoke_impl*>&&), (anonymous namespace)::Worker*, std::promise*> > (__f=@0x599d2ca77e38: 0x7fb7fe8baae1 <(anonymous namespace)::Worker::work_loop((anonymous namespace)::Worker*, std::promise*>&&)>) at /usr/include/c++/13/bits/invoke.h:61
#28 0x00007fb7fe8be63b in std::__invoke*>&&), (anonymous namespace)::Worker*, std::promise*> > (__fn=@0x599d2ca77e38: 0x7fb7fe8baae1 <(anonymous namespace)::Worker::work_loop((anonymous namespace)::Worker*, std::promise*>&&)>) at /usr/include/c++/13/bits/invoke.h:96
#29 0x00007fb7fe8be553 in std::thread::_Invoker*>&&), (anonymous namespace)::Worker*, std::promise*> > >::_M_invoke<0, 1, 2> (this=0x599d2ca77e18) at /usr/include/c++/13/bits/std_thread.h:292
#30 0x00007fb7fe8be4d6 in std::thread::_Invoker*>&&), (anonymous namespace)::Worker*, std::promise*> > >::operator() (this=0x599d2ca77e18) at /usr/include/c++/13/bits/std_thread.h:299
#31 0x00007fb7fe8be4a0 in std::thread::_State_impl*>&&), (anonymous namespace)::Worker*, std::promise*> > > >::_M_run (this=0x599d2ca77e10) at /usr/include/c++/13/bits/std_thread.h:244
#32 0x00007fb7fd4ecdb4 in ??? () at /lib/x86_64-linux-gnu/libstdc++.so.6
#33 0x00007fb7fd09ca94 in start_thread (arg=) at ./nptl/pthread_create.c:447
#34 0x00007fb7fd129c3c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
Thread 28 (Thread 0x7fb7974006c0 (LWP 11800)):
#0 0x00007fb7fd12bc1a in __libc_recv (flags=, len=56, buf=0x7fb7973ff0d0, fd=161) at ../sysdeps/unix/sysv/linux/recv.c:28
#1 __libc_recv (fd=161, buf=0x7fb7973ff0d0, len=56, flags=0) at ../sysdeps/unix/sysv/linux/recv.c:23
#2 0x00007fb7f9079c33 in ??? () at /lib/x86_64-linux-gnu/libEGL_nvidia.so.0
#3 0x00007fb7f907a9fd in ??? () at /lib/x86_64-linux-gnu/libEGL_nvidia.so.0
#4 0x00007fb7f906fb5d in ??? () at /lib/x86_64-linux-gnu/libEGL_nvidia.so.0
#5 0x00007fb7f90bfcce in ??? () at /lib/x86_64-linux-gnu/libEGL_nvidia.so.0
#6 0x00007fb7fd09ca94 in start_thread (arg=) at ./nptl/pthread_create.c:447
#7 0x00007fb7fd129c3c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
Thread 27 (Thread 0x7fb7a2a006c0 (LWP 11793)):
#0 0x00007fb7fd12bc1a in __libc_recv (flags=, len=56, buf=0x7fb7a29ff0d0, fd=155) at ../sysdeps/unix/sysv/linux/recv.c:28
#1 __libc_recv (fd=155, buf=0x7fb7a29ff0d0, len=56, flags=0) at ../sysdeps/unix/sysv/linux/recv.c:23
#2 0x00007fb7f9079c33 in ??? () at /lib/x86_64-linux-gnu/libEGL_nvidia.so.0
#3 0x00007fb7f907a9fd in ??? () at /lib/x86_64-linux-gnu/libEGL_nvidia.so.0
#4 0x00007fb7f906fb5d in ??? () at /lib/x86_64-linux-gnu/libEGL_nvidia.so.0
#5 0x00007fb7f90bfcce in ??? () at /lib/x86_64-linux-gnu/libEGL_nvidia.so.0
#6 0x00007fb7fd09ca94 in start_thread (arg=) at ./nptl/pthread_create.c:447
#7 0x00007fb7fd129c3c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
Thread 26 (Thread 0x7fb7a10006c0 (LWP 11796)):
#0 0x00007fb7fd12bc1a in __libc_recv (flags=, len=56, buf=0x7fb7a0fff0d0, fd=158) at ../sysdeps/unix/sysv/linux/recv.c:28
#1 __libc_recv (fd=158, buf=0x7fb7a0fff0d0, len=56, flags=0) at ../sysdeps/unix/sysv/linux/recv.c:23
#2 0x00007fb7f9079c33 in ??? () at /lib/x86_64-linux-gnu/libEGL_nvidia.so.0
#3 0x00007fb7f907a9fd in ??? () at /lib/x86_64-linux-gnu/libEGL_nvidia.so.0
#4 0x00007fb7f906fb5d in ??? () at /lib/x86_64-linux-gnu/libEGL_nvidia.so.0
#5 0x00007fb7f90bfcce in ??? () at /lib/x86_64-linux-gnu/libEGL_nvidia.so.0
#6 0x00007fb7fd09ca94 in start_thread (arg=) at ./nptl/pthread_create.c:447
#7 0x00007fb7fd129c3c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
Thread 25 (Thread 0x7fb796a006c0 (LWP 11802)):
#0 0x00007fb7fd12bc1a in __libc_recv (flags=, len=56, buf=0x7fb7969ff0d0, fd=162) at ../sysdeps/unix/sysv/linux/recv.c:28
#1 __libc_recv (fd=162, buf=0x7fb7969ff0d0, len=56, flags=0) at ../sysdeps/unix/sysv/linux/recv.c:23
#2 0x00007fb7f9079c33 in ??? () at /lib/x86_64-linux-gnu/libEGL_nvidia.so.0
#3 0x00007fb7f907a9fd in ??? () at /lib/x86_64-linux-gnu/libEGL_nvidia.so.0
#4 0x00007fb7f906fb5d in ??? () at /lib/x86_64-linux-gnu/libEGL_nvidia.so.0
#5 0x00007fb7f90bfcce in ??? () at /lib/x86_64-linux-gnu/libEGL_nvidia.so.0
#6 0x00007fb7fd09ca94 in start_thread (arg=) at ./nptl/pthread_create.c:447
#7 0x00007fb7fd129c3c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
Thread 24 (Thread 0x7fb7c4e006c0 (LWP 11522)):
#0 0x00007fb7fd11b4cd in __GI___poll (fds=0x7fb7c4dff1b0, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1 0x00007fb7fe8a84fb in (anonymous namespace)::dispatch_loop(const std::string &, std::shared_ptr, std::shared_ptr, const std::function &) (name="Mir/X11 Spawner", thread_register=std::shared_ptr (use count 4, weak count 0) = {...}, dispatcher=std::shared_ptr (use count 2, weak count 0) = {...}, exception_handler=...) at /home/tarek/code-projects/mir/src/common/dispatch/threaded_dispatcher.cpp:199
#2 0x00007fb7fe8b1bce in std::__invoke_impl, std::allocator > const&, std::shared_ptr, std::shared_ptr, std::function const&), std::__cxx11::basic_string, std::allocator >, std::shared_ptr, std::shared_ptr, std::function >(std::__invoke_other, void (*&&)(std::__cxx11::basic_string, std::allocator > const&, std::shared_ptr, std::shared_ptr, std::function const&), std::__cxx11::basic_string, std::allocator >&&, std::shared_ptr&&, std::shared_ptr&&, std::function&&) (__f=@0x599d2c937438: 0x7fb7fe8a83cd <(anonymous namespace)::dispatch_loop(const std::string &, std::shared_ptr, std::shared_ptr, const std::function &)>) at /usr/include/c++/13/bits/invoke.h:61
#3 0x00007fb7fe8b19f2 in std::__invoke, std::allocator > const&, std::shared_ptr, std::shared_ptr, std::function const&), std::__cxx11::basic_string, std::allocator >, std::shared_ptr, std::shared_ptr, std::function >(void (*&&)(std::__cxx11::basic_string, std::allocator > const&, std::shared_ptr, std::shared_ptr, std::function const&), std::__cxx11::basic_string, std::allocator >&&, std::shared_ptr&&, std::shared_ptr&&, std::function&&) (__fn=@0x599d2c937438: 0x7fb7fe8a83cd <(anonymous namespace)::dispatch_loop(const std::string &, std::shared_ptr, std::shared_ptr, const std::function &)>) at /usr/include/c++/13/bits/invoke.h:96
#4 0x00007fb7fe8b1853 in std::thread::_Invoker, std::allocator > const&, std::shared_ptr, std::shared_ptr, std::function const&), std::__cxx11::basic_string, std::allocator >, std::shared_ptr, std::shared_ptr, std::function > >::_M_invoke<0ul, 1ul, 2ul, 3ul, 4ul>(std::_Index_tuple<0ul, 1ul, 2ul, 3ul, 4ul>) (this=0x599d2c9373d8) at /usr/include/c++/13/bits/std_thread.h:292
#5 0x00007fb7fe8b1778 in std::thread::_Invoker, std::allocator > const&, std::shared_ptr, std::shared_ptr, std::function const&), std::__cxx11::basic_string, std::allocator >, std::shared_ptr, std::shared_ptr, std::function > >::operator()() (this=0x599d2c9373d8) at /usr/include/c++/13/bits/std_thread.h:299
#6 0x00007fb7fe8b1428 in std::thread::_State_impl, std::allocator > const&, std::shared_ptr, std::shared_ptr, std::function const&), std::__cxx11::basic_string, std::allocator >, std::shared_ptr, std::shared_ptr, std::function > > >::_M_run() (this=0x599d2c9373d0) at /usr/include/c++/13/bits/std_thread.h:244
#7 0x00007fb7fd4ecdb4 in ??? () at /lib/x86_64-linux-gnu/libstdc++.so.6
#8 0x00007fb7fd09ca94 in start_thread (arg=) at ./nptl/pthread_create.c:447
#9 0x00007fb7fd129c3c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
Thread 23 (Thread 0x7fb7a1a006c0 (LWP 11794)):
#0 0x00007fb7fd098d61 in __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x599d2b68a9ec) at ./nptl/futex-internal.c:57
#1 __futex_abstimed_wait_common (cancel=true, private=0, abstime=0x0, clockid=0, expected=0, futex_word=0x599d2b68a9ec) at ./nptl/futex-internal.c:87
#2 __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x599d2b68a9ec, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at ./nptl/futex-internal.c:139
#3 0x00007fb7fd09b7dd in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x599d2b579530, cond=0x599d2b68a9c0) at ./nptl/pthread_cond_wait.c:503
#4 ___pthread_cond_wait (cond=0x599d2b68a9c0, mutex=0x599d2b579530) at ./nptl/pthread_cond_wait.c:627
#5 0x00007fb7f90b9c38 in ??? () at /lib/x86_64-linux-gnu/libEGL_nvidia.so.0
#6 0x00007fb7f90855d8 in ??? () at /lib/x86_64-linux-gnu/libEGL_nvidia.so.0
#7 0x00007fb7f90bfcce in ??? () at /lib/x86_64-linux-gnu/libEGL_nvidia.so.0
#8 0x00007fb7fd09ca94 in start_thread (arg=) at ./nptl/pthread_create.c:447
#9 0x00007fb7fd129c3c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
Thread 22 (Thread 0x7fb7ba0006c0 (LWP 11526)):
#0 0x00007fb7fd11b4cd in __GI___poll (fds=0x7fb7b9fff368, nfds=1, timeout=300000) at ../sysdeps/unix/sysv/linux/poll.c:29
#1 0x00007fb7f2bf6a07 in ??? () at /lib/x86_64-linux-gnu/libnvidia-eglcore.so.550.120
#2 0x00007fb7f2bf4fba in ??? () at /lib/x86_64-linux-gnu/libnvidia-eglcore.so.550.120
#3 0x00007fb7fd09ca94 in start_thread (arg=) at ./nptl/pthread_create.c:447
#4 0x00007fb7fd129c3c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
Thread 21 (Thread 0x7fb797e006c0 (LWP 11798)):
#0 0x00007fb7fd12bc1a in __libc_recv (flags=, len=56, buf=0x7fb797dff0d0, fd=159) at ../sysdeps/unix/sysv/linux/recv.c:28
#1 __libc_recv (fd=159, buf=0x7fb797dff0d0, len=56, flags=0) at ../sysdeps/unix/sysv/linux/recv.c:23
#2 0x00007fb7f9079c33 in ??? () at /lib/x86_64-linux-gnu/libEGL_nvidia.so.0
#3 0x00007fb7f907a9fd in ??? () at /lib/x86_64-linux-gnu/libEGL_nvidia.so.0
#4 0x00007fb7f906fb5d in ??? () at /lib/x86_64-linux-gnu/libEGL_nvidia.so.0
#5 0x00007fb7f90bfcce in ??? () at /lib/x86_64-linux-gnu/libEGL_nvidia.so.0
#6 0x00007fb7fd09ca94 in start_thread (arg=) at ./nptl/pthread_create.c:447
#7 0x00007fb7fd129c3c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
Thread 20 (Thread 0x7fb7c62006c0 (LWP 11827)):
#0 0x00007fb7fd11b4cd in __GI___poll (fds=0x7fb7c61ff1b0, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1 0x00007fb7fe8a84fb in (anonymous namespace)::dispatch_loop(const std::string &, std::shared_ptr, std::shared_ptr, const std::function &) (name="Mir/Input Reader", thread_register=std::shared_ptr (use count 4, weak count 0) = {...}, dispatcher=std::shared_ptr (use count 2, weak count 0) = {...}, exception_handler=...) at /home/tarek/code-projects/mir/src/common/dispatch/threaded_dispatcher.cpp:199
#2 0x00007fb7fe8b1bce in std::__invoke_impl, std::allocator > const&, std::shared_ptr, std::shared_ptr, std::function const&), std::__cxx11::basic_string, std::allocator >, std::shared_ptr, std::shared_ptr, std::function >(std::__invoke_other, void (*&&)(std::__cxx11::basic_string, std::allocator > const&, std::shared_ptr, std::shared_ptr, std::function const&), std::__cxx11::basic_string, std::allocator >&&, std::shared_ptr&&, std::shared_ptr&&, std::function&&) (__f=@0x599d2ca83b58: 0x7fb7fe8a83cd <(anonymous namespace)::dispatch_loop(const std::string &, std::shared_ptr, std::shared_ptr, const std::function &)>) at /usr/include/c++/13/bits/invoke.h:61
#3 0x00007fb7fe8b19f2 in std::__invoke, std::allocator > const&, std::shared_ptr, std::shared_ptr, std::function const&), std::__cxx11::basic_string, std::allocator >, std::shared_ptr, std::shared_ptr, std::function >(void (*&&)(std::__cxx11::basic_string, std::allocator > const&, std::shared_ptr, std::shared_ptr, std::function const&), std::__cxx11::basic_string, std::allocator >&&, std::shared_ptr&&, std::shared_ptr&&, std::function&&) (__fn=@0x599d2ca83b58: 0x7fb7fe8a83cd <(anonymous namespace)::dispatch_loop(const std::string &, std::shared_ptr, std::shared_ptr, const std::function &)>) at /usr/include/c++/13/bits/invoke.h:96
#4 0x00007fb7fe8b1853 in std::thread::_Invoker, std::allocator > const&, std::shared_ptr, std::shared_ptr, std::function const&), std::__cxx11::basic_string, std::allocator >, std::shared_ptr, std::shared_ptr, std::function > >::_M_invoke<0ul, 1ul, 2ul, 3ul, 4ul>(std::_Index_tuple<0ul, 1ul, 2ul, 3ul, 4ul>) (this=0x599d2ca83af8) at /usr/include/c++/13/bits/std_thread.h:292
#5 0x00007fb7fe8b1778 in std::thread::_Invoker, std::allocator > const&, std::shared_ptr, std::shared_ptr, std::function const&), std::__cxx11::basic_string, std::allocator >, std::shared_ptr, std::shared_ptr, std::function > >::operator()() (this=0x599d2ca83af8) at /usr/include/c++/13/bits/std_thread.h:299
#6 0x00007fb7fe8b1428 in std::thread::_State_impl, std::allocator > const&, std::shared_ptr, std::shared_ptr, std::function const&), std::__cxx11::basic_string, std::allocator >, std::shared_ptr, std::shared_ptr, std::function > > >::_M_run() (this=0x599d2ca83af0) at /usr/include/c++/13/bits/std_thread.h:244
#7 0x00007fb7fd4ecdb4 in ??? () at /lib/x86_64-linux-gnu/libstdc++.so.6
#8 0x00007fb7fd09ca94 in start_thread (arg=) at ./nptl/pthread_create.c:447
#9 0x00007fb7fd129c3c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
Thread 19 (Thread 0x7fb7c58006c0 (LWP 11828)):
#0 0x00007fb7fd12a042 in epoll_wait (epfd=47, events=0x7fb7c57ff080, maxevents=32, timeout=-1) at ../sysdeps/unix/sysv/linux/epoll_wait.c:30
#1 0x00007fb7fdb973ab in wl_event_loop_dispatch () at /lib/x86_64-linux-gnu/libwayland-server.so.0
#2 0x00007fb7fdb97c45 in wl_display_run () at /lib/x86_64-linux-gnu/libwayland-server.so.0
#3 0x00007fb7fe32d4e3 in operator() (__closure=0x7fb778001368, d=0x599d2c8b0250) at /home/tarek/code-projects/mir/src/server/frontend_wayland/wayland_connector.cpp:419
#4 0x00007fb7fe32fb80 in std::__invoke_impl, wl_display*>(std::__invoke_other, struct {...} &&) (__f=...) at /usr/include/c++/13/bits/invoke.h:61
#5 0x00007fb7fe32fb25 in std::__invoke, wl_display*>(struct {...} &&) (__fn=...) at /usr/include/c++/13/bits/invoke.h:96
#6 0x00007fb7fe32fa95 in std::thread::_Invoker, wl_display*> >::_M_invoke<0, 1>(std::_Index_tuple<0, 1>) (this=0x7fb778001368) at /usr/include/c++/13/bits/std_thread.h:292
#7 0x00007fb7fe32fa4e in std::thread::_Invoker, wl_display*> >::operator()(void) (this=0x7fb778001368) at /usr/include/c++/13/bits/std_thread.h:299
#8 0x00007fb7fe32fa32 in std::thread::_State_impl, wl_display*> > >::_M_run(void) (this=0x7fb778001360) at /usr/include/c++/13/bits/std_thread.h:244
#9 0x00007fb7fd4ecdb4 in ??? () at /lib/x86_64-linux-gnu/libstdc++.so.6
#10 0x00007fb7fd09ca94 in start_thread (arg=) at ./nptl/pthread_create.c:447
#11 0x00007fb7fd129c3c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
Thread 18 (Thread 0x7fb7fa8006c0 (LWP 11475)):
#0 0x00007fb7fd11b4cd in __GI___poll (fds=0x599d2b566a60, nfds=2, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1 0x00007fb7fd89066e in ??? () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2 0x00007fb7fd830a53 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3 0x00007fb7fd830aa9 in ??? () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4 0x00007fb7fd85fc82 in ??? () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5 0x00007fb7fd09ca94 in start_thread (arg=) at ./nptl/pthread_create.c:447
#6 0x00007fb7fd129c3c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
Thread 17 (Thread 0x7fb7e52006c0 (LWP 11506)):
#0 0x00007fb7fd098d61 in __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x599d2b85dfd8) at ./nptl/futex-internal.c:57
#1 __futex_abstimed_wait_common (cancel=true, private=0, abstime=0x0, clockid=0, expected=0, futex_word=0x599d2b85dfd8) at ./nptl/futex-internal.c:87
#2 __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x599d2b85dfd8, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at ./nptl/futex-internal.c:139
#3 0x00007fb7fd09b7dd in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x599d2b85df80, cond=0x599d2b85dfb0) at ./nptl/pthread_cond_wait.c:503
#4 ___pthread_cond_wait (cond=0x599d2b85dfb0, mutex=0x599d2b85df80) at ./nptl/pthread_cond_wait.c:627
#5 0x00007fb7d1f1d7cd in ??? () at /usr/lib/x86_64-linux-gnu/dri/iris_dri.so
#6 0x00007fb7d1efcaab in ??? () at /usr/lib/x86_64-linux-gnu/dri/iris_dri.so
#7 0x00007fb7d1f1d6fc in ??? () at /usr/lib/x86_64-linux-gnu/dri/iris_dri.so
#8 0x00007fb7fd09ca94 in start_thread (arg=) at ./nptl/pthread_create.c:447
#9 0x00007fb7fd129c3c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
Thread 16 (Thread 0x7fb7db8006c0 (LWP 11496)):
#0 0x00007fb7fd098d61 in __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x0, op=393, expected=0, futex_word=0x599d2b5e8288) at ./nptl/futex-internal.c:57
#1 __futex_abstimed_wait_common (cancel=true, private=0, abstime=0x0, clockid=0, expected=0, futex_word=0x599d2b5e8288) at ./nptl/futex-internal.c:87
#2 __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x599d2b5e8288, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0) at ./nptl/futex-internal.c:139
#3 0x00007fb7fd09b7dd in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x599d2b5e8230, cond=0x599d2b5e8260) at ./nptl/pthread_cond_wait.c:503
#4 ___pthread_cond_wait (cond=0x599d2b5e8260, mutex=0x599d2b5e8230) at ./nptl/pthread_cond_wait.c:627
#5 0x00007fb7d1f1d7cd in ??? () at /usr/lib/x86_64-linux-gnu/dri/iris_dri.so
#6 0x00007fb7d1efcaab in ??? () at /usr/lib/x86_64-linux-gnu/dri/iris_dri.so
#7 0x00007fb7d1f1d6fc in ??? () at /usr/lib/x86_64-linux-gnu/dri/iris_dri.so
#8 0x00007fb7fd09ca94 in start_thread (arg=) at ./nptl/pthread_create.c:447
#9 0x00007fb7fd129c3c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
Thread 15 (Thread 0x7fb7baa006c0 (LWP 11525)):
#0 syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1 0x00007fb7fe8c4bdb in std::__detail::__platform_wait (__addr=0x7fb7fe901b80 , __val=405) at /usr/include/c++/13/bits/atomic_wait.h:113
#2 0x00007fb7fe8c4ab6 in std::__detail::__waiter_pool::_M_do_wait (this=0x7fb7fe901b40 , __addr=0x7fb7fe901b80 , __old=405) at /usr/include/c++/13/bits/atomic_wait.h:267
#3 0x00007fb7fe8c4f36 in std::__detail::__waiter >::_M_do_wait_v::wait(bool, std::memory_order) const::{lambda()#1}>(bool, std::__atomic_base::wait(bool, std::memory_order) const::{lambda()#1}) (this=0x7fb7ba9ff1b0, __old=false, __vfn=...) at /usr/include/c++/13/bits/atomic_wait.h:396
#4 0x00007fb7fe8c4e32 in std::__atomic_wait_address_v::wait(bool, std::memory_order) const::{lambda()#1}>(bool const*, bool, std::__atomic_base::wait(bool, std::memory_order) const::{lambda()#1}) (__addr=0x7fb79000e118, __old=false, __vfn=...) at /usr/include/c++/13/bits/atomic_wait.h:426
#5 0x00007fb7fe8c4b25 in std::__atomic_base::wait (__m=std::memory_order::seq_cst, __old=false, this=0x7fb79000e118) at /usr/include/c++/13/bits/atomic_base.h:613
#6 std::atomic::wait (this=0x7fb79000e118, __old=false, __m=std::memory_order::seq_cst) at /usr/include/c++/13/atomic:170
#7 0x00007fb7fe8c4920 in mir::Signal::wait (this=0x7fb79000e118) at /home/tarek/code-projects/mir/src/common/signal.cpp:32
#8 0x00007fb7fe8bab73 in (anonymous namespace)::Worker::work_loop (me=0x7fb79000e0f0, shutdown_channel=...) at /home/tarek/code-projects/mir/src/common/thread_pool_executor.cpp:119
#9 0x00007fb7fe8be6c5 in std::__invoke_impl*>&&), (anonymous namespace)::Worker*, std::promise*> > (__f=@0x7fb79000e1c8: 0x7fb7fe8baae1 <(anonymous namespace)::Worker::work_loop((anonymous namespace)::Worker*, std::promise*>&&)>) at /usr/include/c++/13/bits/invoke.h:61
#10 0x00007fb7fe8be63b in std::__invoke*>&&), (anonymous namespace)::Worker*, std::promise*> > (__fn=@0x7fb79000e1c8: 0x7fb7fe8baae1 <(anonymous namespace)::Worker::work_loop((anonymous namespace)::Worker*, std::promise*>&&)>) at /usr/include/c++/13/bits/invoke.h:96
#11 0x00007fb7fe8be553 in std::thread::_Invoker*>&&), (anonymous namespace)::Worker*, std::promise*> > >::_M_invoke<0, 1, 2> (this=0x7fb79000e1a8) at /usr/include/c++/13/bits/std_thread.h:292
#12 0x00007fb7fe8be4d6 in std::thread::_Invoker*>&&), (anonymous namespace)::Worker*, std::promise*> > >::operator() (this=0x7fb79000e1a8) at /usr/include/c++/13/bits/std_thread.h:299
#13 0x00007fb7fe8be4a0 in std::thread::_State_impl*>&&), (anonymous namespace)::Worker*, std::promise*> > > >::_M_run (this=0x7fb79000e1a0) at /usr/include/c++/13/bits/std_thread.h:244
#14 0x00007fb7fd4ecdb4 in ??? () at /lib/x86_64-linux-gnu/libstdc++.so.6
#15 0x00007fb7fd09ca94 in start_thread (arg=) at ./nptl/pthread_create.c:447
#16 0x00007fb7fd129c3c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
Warning: the current language does not match this frame.
Thread 14 (Thread 0x7fb7c7e006c0 (LWP 11516)):
#0 futex_wait (private=0, expected=2, futex_word=0x599d2b579530) at ../sysdeps/nptl/futex-internal.h:146
#1 __GI___lll_lock_wait (futex=futex@entry=0x599d2b579530, private=0) at ./nptl/lowlevellock.c:49
#2 0x00007fb7fd0a00f1 in lll_mutex_lock_optimized (mutex=0x599d2b579530) at ./nptl/pthread_mutex_lock.c:48
#3 ___pthread_mutex_lock (mutex=0x599d2b579530) at ./nptl/pthread_mutex_lock.c:93
#4 0x00007fb7fb362a25 in ??? () at /lib/x86_64-linux-gnu/libnvidia-glsi.so.550.120
#5 0x00007fb7fb36e1ee in _nv004glsi () at /lib/x86_64-linux-gnu/libnvidia-glsi.so.550.120
#6 0x00007fb7f2bf2701 in ??? () at /lib/x86_64-linux-gnu/libnvidia-eglcore.so.550.120
#7 0x00007fb7f2cd880f in ??? () at /lib/x86_64-linux-gnu/libnvidia-eglcore.so.550.120
#8 0x00007fb7f2c8bad3 in ??? () at /lib/x86_64-linux-gnu/libnvidia-eglcore.so.550.120
#9 0x00007fb7f28bf67a in ??? () at /lib/x86_64-linux-gnu/libnvidia-eglcore.so.550.120
#10 0x00007fb7f28bfef2 in ??? () at /lib/x86_64-linux-gnu/libnvidia-eglcore.so.550.120
#11 0x00007fb7fc2a3bc9 in mir::graphics::common::CPUCopyOutputSurface::Impl::commit (this=0x7fb7a47ca950) at /home/tarek/code-projects/mir/src/platforms/common/server/cpu_copy_output_surface.cpp:301
#12 0x00007fb7fc2a2fcb in mir::graphics::common::CPUCopyOutputSurface::commit (this=0x7fb7a47de470) at /home/tarek/code-projects/mir/src/platforms/common/server/cpu_copy_output_surface.cpp:182
#13 0x00007fb7fe5685f8 in mir::renderer::gl::Renderer::render (this=0x7fb7a450cbb0, renderables=std::vector of length 2, capacity 2 = {...}) at /home/tarek/code-projects/mir/src/renderers/gl/renderer.cpp:369
#14 0x00007fb7fe297b0d in mir::compositor::DefaultDisplayBufferCompositor::composite (this=0x7fb7a4521f20, scene_elements=...) at /home/tarek/code-projects/mir/src/server/compositor/default_display_buffer_compositor.cpp:121
#15 0x00007fb7fe2a088d in mir::compositor::CompositingFunctor::operator() (this=0x599d2ca8a6f0) at /home/tarek/code-projects/mir/src/server/compositor/multi_threaded_compositor.cpp:153
#16 0x00007fb7fe2a690f in std::__invoke_impl (__f=...) at /usr/include/c++/13/bits/invoke.h:61
#17 0x00007fb7fe2a6781 in std::__invoke (__fn=...) at /usr/include/c++/13/bits/invoke.h:96
#18 0x00007fb7fe2a609e in std::reference_wrapper::operator()<>() const (this=0x599d2c916430) at /usr/include/c++/13/bits/refwrap.h:359
#19 0x00007fb7fe2a5568 in std::__invoke_impl&> (__f=...) at /usr/include/c++/13/bits/invoke.h:61
#20 0x00007fb7fe2a4766 in std::__invoke_r&> (__fn=...) at /usr/include/c++/13/bits/invoke.h:111
#21 0x00007fb7fe2a37fe in std::_Function_handler >::_M_invoke(std::_Any_data const&) (__functor=...) at /usr/include/c++/13/bits/std_function.h:290
#22 0x00007fb7fe8a47e0 in std::function::operator()() const (this=0x599d2c916430) at /usr/include/c++/13/bits/std_function.h:591
#23 0x00007fb7fe8bb00f in operator() (__closure=0x599d2c916410) at /home/tarek/code-projects/mir/src/common/thread_pool_executor.cpp:204
#24 0x00007fb7fe8bd67e in std::__invoke_impl&&)::&>(std::__invoke_other, struct {...} &) (__f=...) at /usr/include/c++/13/bits/invoke.h:61
#25 0x00007fb7fe8bcf1f in std::__invoke_r&&)::&>(struct {...} &) (__fn=...) at /usr/include/c++/13/bits/invoke.h:111
#26 0x00007fb7fe8bc59a in std::_Function_handler&&):: >::_M_invoke(const std::_Any_data &) (__functor=...) at /usr/include/c++/13/bits/std_function.h:290
#27 0x00007fb7fe8a47e0 in std::function::operator()() const (this=0x7fb7c7dff270) at /usr/include/c++/13/bits/std_function.h:591
#28 0x00007fb7fe8babb0 in (anonymous namespace)::Worker::work_loop (me=0x599d2b574f70, shutdown_channel=...) at /home/tarek/code-projects/mir/src/common/thread_pool_executor.cpp:122
#29 0x00007fb7fe8be6c5 in std::__invoke_impl*>&&), (anonymous namespace)::Worker*, std::promise
This seems to happen with multiple applications, but the most common crashes occur with firefox (unsnapped) and kgx.
With an external monitor hooked up to my nvidia GPU, there's a random chance that Mir will freeze (not crash) upon closing a window of one the aforementioned applications (among others, but those two are the two I most open and close windows with). @AlanGriffiths confirmed that this doesn't happen on his machine which doesn't use nvidia graphics.
I tried both inspecting a coredump and running mir under a debugger with and without cleanup signal handling code disabled. It appears that no signal is raised when the bug is triggered as gdb doesn't stop, I have to manually stop using
ctrl + c
. The stack trace doesn't contain any immediately suspicious functions. Logs also don't show any errors.How I disabled signal handling / cleanup code
**This is just an educated guess, so it might be wrong.** ```diff @@ -34,7 +34,6 @@ namespace { -constexpr std::array const fatal_error_signals = {SIGQUIT, SIGABRT, SIGFPE, SIGSEGV, SIGBUS }; std::weak_ptr