gnome-shell gets killed during random actions in qemu VMs/llvmpipe unaccelerated environments
Ever since GNOME 45 I've been running into e.g. opening the top-right thingy and trying to open settings killing gnome-shell when running in unaccelerated environments.
After a bit of investigation I remembered #3037 (closed) so I tried running gnome-shell with MUTTER_DEBUG_KMS_THREAD_TYPE=user
and that worked.
Then I made the following workaround patch which also worked:
diff --git a/src/backends/native/meta-renderer-native.c b/src/backends/native/meta-renderer-native.c
index e6c653e..cf0ee1a 100644
--- a/src/backends/native/meta-renderer-native.c
+++ b/src/backends/native/meta-renderer-native.c
@@ -2177,6 +2177,12 @@ meta_renderer_native_initable_init (GInitable *initable,
flags = meta_kms_device_get_flags (kms_device);
renderer_native->has_addfb2 = !!(flags & META_KMS_DEVICE_FLAG_HAS_ADDFB2);
+ /* if we're not accelerated, inhibit kms thread in order to avoid getting
+ * killed randomly e.g. in qemu virtual machines as that's quite annoying
+ */
+ if (!gpu_kms_is_hardware_rendering (renderer_native, renderer_native->primary_gpu_kms))
+ meta_kms_inhibit_kernel_thread (meta_kms_device_get_kms (kms_device));
+
kms_modifiers_debug_env = g_getenv ("MUTTER_DEBUG_USE_KMS_MODIFIERS");
if (kms_modifiers_debug_env)
{
System is Chimera Linux, x86_64 architecture, mesa 23.3 (older versions had the same issue). It's musl libc and clang compiler, but that probably shouldn't be relevant. I haven't been able to test this on other distributions.
If I enable any sort of acceleration, e.g. by using virgl, everything works fine with no crashes. Using the softpipe mesa driver also seemingly works but is way to slow to really find out if that's just a coincidence or what.