Flakey closeWithActiveWindows test
The test keeps failing more often than not.
But unlike the issue that was fixed in mutter!3077 (merged), I cannot reproduce the failure locally. And I've tried pretty hard: Running the test in a while true; do
loop, I did not encounter a single error until I cancelled after about 130 iterations. And that's inside a toolbox image that's almost identical to the CI image.
Fun.
Alas, after a lot of sweating and swearing, I manage to get a backtace out of the CI pipeline itself:
Thread 1 "gnome-shell" received signal SIGSEGV, Segmentation fault.
0x00007ffff7769da4 in clutter_stage_get_device_coords (stage=0x0, device=0x9c39b0, sequence=0x0, coords=0x7fffffff8f18) at ../clutter/clutter/clutter-stage.c:3113
3113 ClutterStagePrivate *priv = stage->priv;
#0 0x00007ffff7769da4 in clutter_stage_get_device_coords (stage=0x0, device=0x9c39b0, sequence=0x0, coords=0x7fffffff8f18) at ../clutter/clutter/clutter-stage.c:3113
#1 0x00007ffff776aa47 in clutter_stage_repick_device (stage=0x0, device=0x9c39b0) at ../clutter/clutter/clutter-stage.c:3514
#2 0x00007ffff7459db6 in meta_window_actor_after_effects (self=0x1a962b0) at ../src/compositor/meta-window-actor.c:705
#3 0x00007ffff745a045 in meta_window_actor_effect_completed (self=0x1a962b0, event=META_PLUGIN_MAP) at ../src/compositor/meta-window-actor.c:788
#4 0x00007ffff7451474 in meta_plugin_window_effect_completed (plugin=0xa64fc0, actor=0x1a962b0, event=2) at ../src/compositor/meta-plugin.c:99
#5 0x00007ffff7451520 in meta_plugin_map_completed (plugin=0xa64fc0, actor=0x1a962b0) at ../src/compositor/meta-plugin.c:127
#6 0x00007ffff692cbe6 in ffi_call_unix64 () at /lib64/libffi.so.8
Complete backtrace
Thread 1 "gnome-shell" received signal SIGSEGV, Segmentation fault.
0x00007ffff7769da4 in clutter_stage_get_device_coords (stage=0x0, device=0x9c39b0, sequence=0x0, coords=0x7fffffff8f18) at ../clutter/clutter/clutter-stage.c:3113
3113 ClutterStagePrivate *priv = stage->priv;
#0 0x00007ffff7769da4 in clutter_stage_get_device_coords (stage=0x0, device=0x9c39b0, sequence=0x0, coords=0x7fffffff8f18) at ../clutter/clutter/clutter-stage.c:3113
#1 0x00007ffff776aa47 in clutter_stage_repick_device (stage=0x0, device=0x9c39b0) at ../clutter/clutter/clutter-stage.c:3514
#2 0x00007ffff7459db6 in meta_window_actor_after_effects (self=0x1a962b0) at ../src/compositor/meta-window-actor.c:705
#3 0x00007ffff745a045 in meta_window_actor_effect_completed (self=0x1a962b0, event=META_PLUGIN_MAP) at ../src/compositor/meta-window-actor.c:788
#4 0x00007ffff7451474 in meta_plugin_window_effect_completed (plugin=0xa64fc0, actor=0x1a962b0, event=2) at ../src/compositor/meta-plugin.c:99
#5 0x00007ffff7451520 in meta_plugin_map_completed (plugin=0xa64fc0, actor=0x1a962b0) at ../src/compositor/meta-plugin.c:127
#6 0x00007ffff692cbe6 in ffi_call_unix64 () at /lib64/libffi.so.8
#7 0x00007ffff69294bf in ffi_call_int.lto_priv () at /lib64/libffi.so.8
#8 0x00007ffff692c18e in ffi_call () at /lib64/libffi.so.8
#9 0x00007ffff784a8a7 in Gjs::Function::invoke(JSContext*, JS::CallArgs const&, JS::Handle<JSObject*>, _GIArgument*) [clone .localalias] [clone .lto_priv.0] () at /lib64/libgjs.so.0
#10 0x00007ffff78551b9 in Gjs::Function::call(JSContext*, unsigned int, JS::Value*) () at /lib64/libgjs.so.0
#11 0x00007ffff5ca35ba in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) () at /lib64/libmozjs-102.so.0
#12 0x00007ffff5c9751c in Interpret(JSContext*, js::RunState&) () at /lib64/libmozjs-102.so.0
#13 0x00007ffff5ca2e49 in js::RunScript(JSContext*, js::RunState&) () at /lib64/libmozjs-102.so.0
#14 0x00007ffff5ca33b8 in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) () at /lib64/libmozjs-102.so.0
#15 0x00007ffff611e3fc in js::jit::DoCallFallback(JSContext*, js::jit::BaselineFrame*, js::jit::ICFallbackStub*, unsigned int, JS::Value*, JS::MutableHandle<JS::Value>) () at /lib64/libmozjs-102.so.0
#16 0x000031157e99dce3 in ()
#17 0x0000000002472b68 in ()
#18 0x00007fffffff9cc0 in ()
#19 0xfff9800000000000 in ()
#20 0x00007ffff65fc8c8 in () at /lib64/libmozjs-102.so.0
#21 0x000031157e9a2d82 in ()
#22 0x0000000000004822 in ()
#23 0x00007fffffff9d50 in ()
#24 0x0000000003fafc58 in ()
#25 0x0000000000000001 in ()
#26 0x00007fffffff9d00 in ()
#27 0xfffe3966500aaf70 in ()
#28 0xfff9800000000000 in ()
#29 0xfff9000000000000 in ()
#30 0x00007fffffff9d98 in ()
#31 0x0000000003fafc58 in ()
#32 0x000031157e9a5246 in ()
#33 0x0000000000006821 in ()
#34 0xfff9000000000000 in ()
#35 0xfff9800000000000 in ()
#36 0xfffe3966500aaf70 in ()
#37 0x000008f912a80330 in ()
#38 0x0000000001912f28 in ()
#39 0x0000000003fafc08 in ()
#40 0x00003966500ab110 in ()
#41 0x0000000003fafbd8 in ()
#42 0x7d8b8ec62e297d00 in ()
#43 0x000000000047a8a0 in ()
#44 0x00007fff00000002 in ()
#45 0x000000000000000c in ()
#46 0x00007fffffff9e00 in ()
#47 0x000031157e99b54f in ()
#48 0x0000000000001043 in ()
#49 0x00003966500ab150 in ()
#50 0x0000000000000001 in ()
#51 0xfff9800000000000 in ()
#52 0xfff9000000000000 in ()
#53 0x00007fffffff9e70 in ()
#54 0x00000000ffffff00 in ()
#55 0x00007fffffff9e80 in ()
#56 0x0000000000582d10 in ()
#57 0x000031157e9a33b0 in ()
#58 0x000000000047a8a0 in ()
#59 0x00007fffffffa230 in ()
#60 0x00007ffff62ab484 in EnterJit(JSContext*, js::RunState&, unsigned char*) () at /lib64/libmozjs-102.so.0
#61 0x00007ffff5c9ee73 in Interpret(JSContext*, js::RunState&) () at /lib64/libmozjs-102.so.0
#62 0x00007ffff5ca2e49 in js::RunScript(JSContext*, js::RunState&) () at /lib64/libmozjs-102.so.0
#63 0x00007ffff5ca33b8 in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) () at /lib64/libmozjs-102.so.0
#64 0x00007ffff5ca37b4 in js::Call(JSContext*, JS::Handle<JS::Value>, JS::Handle<JS::Value>, js::AnyInvokeArgs const&, JS::MutableHandle<JS::Value>, js::CallReason) () at /lib64/libmozjs-102.so.0
#65 0x00007ffff5d25161 in JS_CallFunctionValue(JSContext*, JS::Handle<JSObject*>, JS::Handle<JS::Value>, JS::HandleValueArray const&, JS::MutableHandle<JS::Value>) () at /lib64/libmozjs-102.so.0
#66 0x00007ffff7847f85 in Gjs::Closure::invoke(JS::Handle<JSObject*>, JS::HandleValueArray const&, JS::MutableHandle<JS::Value>) () at /lib64/libgjs.so.0
#67 0x00007ffff7885bce in Gjs::Closure::marshal(_GValue*, unsigned int, _GValue const*, void*, void*) () at /lib64/libgjs.so.0
#68 0x00007ffff7af94ea in g_closure_invoke () at /lib64/libgobject-2.0.so.0
#69 0x00007ffff7b27e16 in signal_emit_unlocked_R.isra.0 () at /lib64/libgobject-2.0.so.0
#70 0x00007ffff7b18cbd in g_signal_emit_valist () at /lib64/libgobject-2.0.so.0
#71 0x00007ffff7b18f33 in g_signal_emit () at /lib64/libgobject-2.0.so.0
#72 0x00007ffff77856f1 in clutter_timeline_stop (timeline=0x44a52e0) at ../clutter/clutter/clutter-timeline.c:1456
#73 0x00007ffff76ff110 in transition_closure_free (data=0x3167be0) at ../clutter/clutter/clutter-actor.c:17054
#74 0x00007ffff79de5db in iter_remove_or_steal () at /lib64/libglib-2.0.so.0
#75 0x00007ffff76e579a in _clutter_actor_stop_transitions (self=0x1a962b0) at ../clutter/clutter/clutter-actor.c:4077
#76 0x00007ffff76fb969 in clear_stage_views_cb (actor=0x1a962b0, depth=1, user_data=0x1) at ../clutter/clutter/clutter-actor.c:15285
#77 0x00007ffff76fcf48 in _clutter_actor_traverse_depth (actor=0x1a962b0, before_children_callback=0x7ffff76fb934 <clear_stage_views_cb>, after_children_callback=0x0, current_depth=1, user_data=0x1) at ../clutter/clutter/clutter-actor.c:16004
#78 0x00007ffff76fcf9f in _clutter_actor_traverse_depth (actor=0xa62d80, before_children_callback=0x7ffff76fb934 <clear_stage_views_cb>, after_children_callback=0x0, current_depth=0, user_data=0x1) at ../clutter/clutter/clutter-actor.c:16016
#79 0x00007ffff76fd052 in _clutter_actor_traverse (actor=0xa62d80, flags=CLUTTER_ACTOR_TRAVERSE_DEPTH_FIRST, before_children_callback=0x7ffff76fb934 <clear_stage_views_cb>, after_children_callback=0x0, user_data=0x1) at ../clutter/clutter/clutter-actor.c:16065
#80 0x00007ffff76fba98 in clutter_actor_clear_stage_views_recursive (self=0xa62d80, stop_transitions=1) at ../clutter/clutter/clutter-actor.c:15316
#81 0x00007ffff76e5b6b in clutter_actor_remove_child_internal (self=0xb246a0, child=0xa62d80, flags=REMOVE_CHILD_DEFAULT_FLAGS) at ../clutter/clutter/clutter-actor.c:4225
#82 0x00007ffff76f2930 in clutter_actor_remove_child (self=0xb246a0, child=0xa62d80) at ../clutter/clutter/clutter-actor.c:11547
#83 0x00007ffff77186a7 in container_real_remove (container=0xb246a0, actor=0xa62d80) at ../clutter/clutter/clutter-container.c:113
#84 0x00007ffff7718a99 in container_remove_actor (container=0xb246a0, actor=0xa62d80) at ../clutter/clutter/clutter-container.c:255
#85 0x00007ffff771922b in clutter_container_remove_actor (container=0xb246a0, actor=0xa62d80) at ../clutter/clutter/clutter-container.c:400
#86 0x00007ffff692cbe6 in ffi_call_unix64 () at /lib64/libffi.so.8
#87 0x00007ffff69294bf in ffi_call_int.lto_priv () at /lib64/libffi.so.8
#88 0x00007ffff692c18e in ffi_call () at /lib64/libffi.so.8
#89 0x00007ffff784a8a7 in Gjs::Function::invoke(JSContext*, JS::CallArgs const&, JS::Handle<JSObject*>, _GIArgument*) [clone .localalias] [clone .lto_priv.0] () at /lib64/libgjs.so.0
#90 0x00007ffff78551b9 in Gjs::Function::call(JSContext*, unsigned int, JS::Value*) () at /lib64/libgjs.so.0
#91 0x00007ffff5ca35ba in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) () at /lib64/libmozjs-102.so.0
#92 0x00007ffff5c9751c in Interpret(JSContext*, js::RunState&) () at /lib64/libmozjs-102.so.0
#93 0x00007ffff5ca2f83 in js::RunScript(JSContext*, js::RunState&) () at /lib64/libmozjs-102.so.0
#94 0x00007ffff5ca33b8 in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) () at /lib64/libmozjs-102.so.0
#95 0x00007ffff5ca37b4 in js::Call(JSContext*, JS::Handle<JS::Value>, JS::Handle<JS::Value>, js::AnyInvokeArgs const&, JS::MutableHandle<JS::Value>, js::CallReason) () at /lib64/libmozjs-102.so.0
#96 0x00007ffff5d25161 in JS_CallFunctionValue(JSContext*, JS::Handle<JSObject*>, JS::Handle<JS::Value>, JS::HandleValueArray const&, JS::MutableHandle<JS::Value>) () at /lib64/libmozjs-102.so.0
#97 0x00007ffff7847f85 in Gjs::Closure::invoke(JS::Handle<JSObject*>, JS::HandleValueArray const&, JS::MutableHandle<JS::Value>) () at /lib64/libgjs.so.0
#98 0x00007ffff7885bce in Gjs::Closure::marshal(_GValue*, unsigned int, _GValue const*, void*, void*) () at /lib64/libgjs.so.0
#99 0x00007ffff7af94ea in g_closure_invoke () at /lib64/libgobject-2.0.so.0
#100 0x00007ffff7b27e16 in signal_emit_unlocked_R.isra.0 () at /lib64/libgobject-2.0.so.0
#101 0x00007ffff7b18cbd in g_signal_emit_valist () at /lib64/libgobject-2.0.so.0
#102 0x00007ffff7b18f33 in g_signal_emit () at /lib64/libgobject-2.0.so.0
#103 0x00007ffff7d4b85f in _shell_global_notify_shutdown (global=<optimized out>) at ../src/shell-global.c:1929
#104 0x0000000000402962 in main (argc=<optimized out>, argv=<optimized out>) at ../src/main.c:697
For completeness, here's the JS stack as well:
== Stack trace for context 0x469780 ==
#0 582db0 i resource:///org/gnome/shell/ui/windowManager.js:1555 (beee51e0a10 @ 133)
#1 582d20 i resource:///org/gnome/shell/ui/windowManager.js:1520 (beee51e0970 @ 22)
#2 7fffffff9da0 b resource:///org/gnome/shell/ui/environment.js:113 (8f912a80330 @ 39)
#3 582c98 i resource:///org/gnome/shell/ui/environment.js:202 (8f912a806a0 @ 14)
#4 582bd8 i resource:///org/gnome/shell/ui/layout.js:241 (8f912acf600 @ 217)
So apparently this is what happens:
- on shutdown, we reparent "adopted" actors from
Main.uiGroup
back toglobal.stage
- when removing
global.window_group
while a window effect is ongoing, the transition is stopped - at the end of the transition, the corresponding
completed_foo()
function is called -
meta_window_actor_after_effects()
tries to call a stage method when the stage isNULL
(becauseglobal.window_group
hasn't been added toglobal.stage
yet) - BOOOM
Not sure what the best place for a fix would be. Recursively stopping transitions before doing the reparenting seems a bit clumsy, and just adding a NULL
check in after_effects()
feels quite random.
Any better ideas?