Control: retitle -1 mutter: autopkgtest regression: segfault in 
workspace-basic.metatest
Control: forwarded -1 https://gitlab.gnome.org/GNOME/mutter/-/issues/2559

It looks as though the specific test-case that is segfaulting is
consistently the one after stacking/unmaximize-new-size.metatest, which
should be stacking/workspace-basic.metatest. That's consistent with
Bernhard's backtrace, too.

I was unable to reproduce this in a test VM, with src:mutter rebuilt
from unstable and everything else from testing, but it is reproducible
on my laptop. Perhaps it's only reproducible if mutter has access to
some resource that my ssh login session to my test VM lacks, or perhaps
there's a race condition that makes this timing-dependent?

On Tue, 06 Dec 2022 at 00:54:19 +0100, Bernhard Übelacker wrote:
> #0  0xb7ce33f4 in meta_workspace_index (workspace=0x0) at 
> ../src/core/workspace.c:722
> #1  0xb2e96606 in switch_workspace (plugin=0xe9f200 [MetaDefaultPlugin], 
> from=0, to=1, direction=META_MOTION_RIGHT) at 
> ../src/compositor/plugins/default.c:572
> #2  0xb7c9e3a0 in meta_plugin_manager_switch_workspace (plugin_mgr=0xe9b3e0, 
> from=0, to=1, direction=META_MOTION_RIGHT) at 
> ../src/compositor/meta-plugin-manager.c:272
> #3  0xb7c94a98 in meta_compositor_switch_workspace (compositor=0xc0e9c0 
> [MetaCompositorNative], from=0xe7a320 [MetaWorkspace], to=0xe7a370 
> [MetaWorkspace], direction=META_MOTION_RIGHT) at 
> ../src/compositor/compositor.c:682
> #4  0xb7ce5a2f in meta_workspace_activate_with_focus (workspace=0xe7a370 
> [MetaWorkspace], focus_this=0x0, timestamp=492883) at 
> ../src/core/workspace.c:684
> #5  0xb7ce5c1e in meta_workspace_activate (workspace=0xe7a370 
> [MetaWorkspace], timestamp=492883) at ../src/core/workspace.c:714
> #6  0x0047d8a5 in test_case_do (error=0xbfeb8408, argv=<optimized out>, 
> argc=<optimized out>, test=0xece680) at ../src/tests/test-runner.c:1068
> #7  run_test (index=<optimized out>, filename=0xac7e20 
> "/usr/share/mutter-11/tests/stacking/workspace-basic.metatest", 
> context=<optimized out>) at ../src/tests/test-runner.c:1280

This is consistent with what I get. I think the problem here is that
the invariant for a window having a workspace is

    window->unmanaging || workspace != NULL || window->on_all_workspaces

but switch_workspace() doesn't account for window->unmanaging being a
possibility.

Please take any further analysis to the upstream bug:
https://gitlab.gnome.org/GNOME/mutter/-/issues/2559

I'm testing a patch that should turn this from a segfault into a non-fatal
warning.

    smcv

Reply via email to