Bug#1024438: mutter: autopkgtest regression: segfault in workspace-basic.metatest

2022-12-20 Thread Simon McVittie
Control: severity -1 important

On Sun, 18 Dec 2022 at 15:58:06 +, Simon McVittie wrote:
> 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'm testing a patch that should turn this from a segfault into a non-fatal
> warning.

It seems that running each test-case separately, instead of combining all
the test-cases into one run, works around this. That workaround is present
in the 43.2-3 upload (this change is
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2773 upstream).

I also applied a patch so that if the same error occurs for real users of
mutter, it will be a non-fatal critical warning rather than a crash
(https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2774 upstream).

The test failure continues to be a bug: please see upstream issue
report  if you are
interested in helping to resolve it. I think the solution is to make
switch_workspace() in src/compositor/plugins/default.c do something
reasonable if the window is being unmanaged, but I'm not sure what that
reasonable thing would be.

smcv



Bug#1024438: mutter: autopkgtest regression: segfault in workspace-basic.metatest

2022-12-19 Thread Bernhard Übelacker

Am 18.12.22 um 16:58 schrieb Simon McVittie:


I was unable to reproduce this in a test VM, ...
..., 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?



Hello Simon,
I forgot to mention that I had to add to
my qemu test VM this graphics configuration:

   -device virtio-vga-gl -display gtk,gl=on

Kind regards,
Bernhard



Bug#1024438: mutter: autopkgtest regression: segfault in workspace-basic.metatest

2022-12-18 Thread Simon McVittie
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=, 
> argc=, test=0xece680) at ../src/tests/test-runner.c:1068
> #7  run_test (index=, filename=0xac7e20 
> "/usr/share/mutter-11/tests/stacking/workspace-basic.metatest", 
> context=) 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