Bug#1050512: gnome-shell: Crash when viewing video with mpv

2023-09-10 Thread Simon McVittie
On Sun, 10 Sep 2023 at 21:54:46 +0200, Marc Glisse wrote:
> On Sun, 10 Sep 2023, Simon McVittie wrote:
> > There is a merge request upstream which *might* fix this. If you are able
> > to rebuild the mutter source package with patches applied, please try
> > applying the attached file "bug1050512-without-xsync.patch" and see whether
> > you can reproduce the crash. If that works, please report back. If not,
> > please revert that change, apply "bug1050512-with-xsync.patch", rebuild
> > and try again.
> 
> The first patch does not work (still crashing). The second one does seem to
> help, that's great! Playing a few videos did not trigger any crash :-)

Thanks, I've forwarded this feedback upstream to
.
If there's no movement on that MR soon, we can temporarily apply the patch
as Debian-specific.

smcv



Bug#1050512: gnome-shell: Crash when viewing video with mpv

2023-09-10 Thread Marc Glisse

On Sun, 10 Sep 2023, Simon McVittie wrote:


Would you be able to reproduce this with MUTTER_SYNC=1 in the environment
(setting it in ~/.config/environment.d/mutter-sync.conf should apparently
work) to confirm that it's the same crash as mutter#2857 upstream?


I was hoping to wait until the other bug was fixed, since producing the 
trace is a bit of work.



You say this happens when playing a video with mpv: perhaps this could
be because mpv disables power saving / screen blanking while it's playing
the video?


I have no idea. It also happens (but less quickly) when watching videos 
full screen with firefox.



If you install the x11-xserver-utils package and run "xset -dpms", does
that trigger the same crash?


No, it doesn't seem to have any effect.


There is a merge request upstream which *might* fix this. If you are able
to rebuild the mutter source package with patches applied, please try
applying the attached file "bug1050512-without-xsync.patch" and see whether
you can reproduce the crash. If that works, please report back. If not,
please revert that change, apply "bug1050512-with-xsync.patch", rebuild
and try again.


The first patch does not work (still crashing). The second one does seem 
to help, that's great! Playing a few videos did not trigger any crash :-)


If the problem reappears (with a lower frequency), I'll write again.


If you're not able to rebuild the mutter source package,


I had to use DEB_BUILD_OPTIONS=nocheck since several tests were failing, 
including some with very long timeouts.



there's a heatwave here at the moment,


Same here...

--
Marc Glisse



Bug#1050512: gnome-shell: Crash when viewing video with mpv

2023-09-10 Thread Simon McVittie
Control: tags -1 + moreinfo

On Thu, 31 Aug 2023 at 13:45:04 +0200, Marc Glisse wrote:
> It looks like my stack trace is useless because I forgot to set
> MUTTER_SYNC=1 :-(
>
> It seems likely that this is the same bug as
> https://gitlab.gnome.org/GNOME/mutter/-/issues/2857 (sadly not fixed yet).

Would you be able to reproduce this with MUTTER_SYNC=1 in the environment
(setting it in ~/.config/environment.d/mutter-sync.conf should apparently
work) to confirm that it's the same crash as mutter#2857 upstream?

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6778#note_1782883
seems like the characteristic backtrace: a BadMatch in response to
DPMSForceLevel().

You say this happens when playing a video with mpv: perhaps this could
be because mpv disables power saving / screen blanking while it's playing
the video?

If you install the x11-xserver-utils package and run "xset -dpms", does
that trigger the same crash?

There is a merge request upstream which *might* fix this. If you are able
to rebuild the mutter source package with patches applied, please try
applying the attached file "bug1050512-without-xsync.patch" and see whether
you can reproduce the crash. If that works, please report back. If not,
please revert that change, apply "bug1050512-with-xsync.patch", rebuild
and try again.

If you're not able to rebuild the mutter source package, I'll try to
prepare packages that you can try, but there's a heatwave here at the
moment, so I'm trying not to heat my house more by compiling lots of
packages right now!

Thanks,
smcv
From: =?UTF-8?q?Jonas=20=C3=85dahl?= 
Date: Mon, 7 Aug 2023 22:42:18 +0200
Subject: monitor-manager/xrandr: Trap DPMS changes

Apparently DPMSForceLevel() can fail to force a valid level sometimes.

Bug: https://gitlab.gnome.org/GNOME/mutter/-/issues/2857
Bug: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6883
Forwarded: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3160
Bug-Debian: https://bugs.debian.org/1050512
---
 src/backends/x11/meta-monitor-manager-xrandr.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/backends/x11/meta-monitor-manager-xrandr.c b/src/backends/x11/meta-monitor-manager-xrandr.c
index f288c7af239..1a23709c8a2 100644
--- a/src/backends/x11/meta-monitor-manager-xrandr.c
+++ b/src/backends/x11/meta-monitor-manager-xrandr.c
@@ -180,8 +180,10 @@ meta_monitor_manager_xrandr_set_power_save_mode (MetaMonitorManager *manager,
 return;
   }
 
+  meta_clutter_x11_trap_x_errors ();
   DPMSForceLevel (manager_xrandr->xdisplay, state);
   DPMSSetTimeouts (manager_xrandr->xdisplay, 0, 0, 0);
+  meta_clutter_x11_untrap_x_errors ();
 }
 
 static xcb_randr_rotation_t
-- 
GitLab

>From 7d911855b480ce19941f27df3d2d8c270ceb6ba5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=85dahl?= 
Date: Mon, 7 Aug 2023 22:42:18 +0200
Subject: [PATCH] monitor-manager/xrandr: Trap DPMS changes

Apparently DPMSForceLevel() can fail to force a valid level sometimes.

Bug: https://gitlab.gnome.org/GNOME/mutter/-/issues/2857
Bug: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6883
Origin: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3160
[smcv: call XSync() before untrap, as suggested by Sebastian Keller]
Bug-Debian: https://bugs.debian.org/1050512
---
 src/backends/x11/meta-monitor-manager-xrandr.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/backends/x11/meta-monitor-manager-xrandr.c b/src/backends/x11/meta-monitor-manager-xrandr.c
index beb9fb80d2..0785dad36f 100644
--- a/src/backends/x11/meta-monitor-manager-xrandr.c
+++ b/src/backends/x11/meta-monitor-manager-xrandr.c
@@ -180,8 +180,11 @@ meta_monitor_manager_xrandr_set_power_save_mode (MetaMonitorManager *manager,
 return;
   }
 
+  meta_clutter_x11_trap_x_errors ();
   DPMSForceLevel (manager_xrandr->xdisplay, state);
   DPMSSetTimeouts (manager_xrandr->xdisplay, 0, 0, 0);
+  XSync (manager_xrandr->xdisplay, False);
+  meta_clutter_x11_untrap_x_errors ();
 }
 
 static xcb_randr_rotation_t
-- 
2.40.1



Bug#1050512: gnome-shell: Crash when viewing video with mpv

2023-08-31 Thread Marc Glisse
It looks like my stack trace is useless because I forgot to set 
MUTTER_SYNC=1 :-(


It seems likely that this is the same bug as 
https://gitlab.gnome.org/GNOME/mutter/-/issues/2857 (sadly not fixed yet).


--
Marc Glisse



Bug#1050512: gnome-shell: Crash when viewing video with mpv

2023-08-25 Thread Marc Glisse
Package: gnome-shell
Version: 44.3-5
Severity: important

Dear Maintainer,

when I play a video with mpv, after a bit of time (usually less than a minute),
I get a gray screen telling me that gnome shell has crashed and I need to log
out. Funny thing: if I press the windows key, I see all the windows in small
size, and the video is actually still playing. But as soon as I leave the
overview, the grey screen comes back. This is quite reproducible, I've had it 4
times today already with different videos.  This system is up-to-date
"testing", and the problem is recent (most likely the mutter/gnome-shell
updates from today).

You can find a more complete backtrace at
https://geometrica.saclay.inria.fr/team/Marc.Glisse/tmp/gnome-shell-0 ,
I am only pasting the basic one here

Thread 1 "gnome-shell" received signal SIGTRAP, Trace/breakpoint trap.
g_log_structured_array (log_level=, fields=0x7ffd87953a60, 
n_fields=4) at ../../../glib/gmessages.c:555




  Download 
failed: Invalid argument.  Continuing without source file 
./debian/build/deb/../../../glib/gmessages.c.
555 ../../../glib/gmessages.c: No such file or directory.
(gdb) bt
#0  g_log_structured_array (log_level=, fields=0x7ffd87953a60, 
n_fields=4) at ../../../glib/gmessages.c:555
#1  0x7fe19fd36a8e in g_log_default_handler 
(log_domain=log_domain@entry=0x7fe19f99e48f "libmutter", 
log_level=log_level@entry=6, message=message@entry=0x561f847d66f0 "Received an 
X Window System error.\nThis probably reflects a bug in the program.\nThe error 
was 'BadMatch (invalid parameter attributes)'.\n  (Details: serial 149487 
error_code 8 request_code 147 (unknow"..., unused_data=unused_data@entry=0x0) 
at ../../../glib/gmessages.c:3284
#2  0x7fe19fd36d00 in g_logv (log_domain=0x7fe19f99e48f "libmutter", 
log_level=G_LOG_LEVEL_ERROR, format=, 
args=args@entry=0x7ffd87953bb0) at ../../../glib/gmessages.c:1391
#3  0x7fe19fd36faf in g_log (log_domain=log_domain@entry=0x7fe19f99e48f 
"libmutter", log_level=log_level@entry=G_LOG_LEVEL_ERROR, 
format=format@entry=0x7fe19f9bc010 "Received an X Window System error.\nThis 
probably reflects a bug in the program.\nThe error was '%s'.\n  (Details: 
serial %ld error_code %d request_code %d (%s) minor_code %d)\n  (Note to 
programmers: nor"...) at ../../../glib/gmessages.c:1460
#4  0x7fe19f916ffe in display_error_event (error=0x7ffd87953d30, 
x11_display=0x561f82ef19a0 [MetaX11Display]) at ../src/x11/meta-x11-errors.c:113
#5  meta_x_error (xdisplay=, error=0x7ffd87953d30) at 
../src/x11/meta-x11-errors.c:136
#6  meta_x_error (xdisplay=, error=0x7ffd87953d30) at 
../src/x11/meta-x11-errors.c:132
#7  0x7fe19f2dd99b in _XError (dpy=dpy@entry=0x561f82268200, 
rep=rep@entry=0x7fe18808a0f0) at ../../src/XlibInt.c:1503
#8  0x7fe19f2da607 in handle_error (dpy=0x561f82268200, err=0x7fe18808a0f0, 
in_XReply=) at ../../src/xcb_io.c:211
#9  0x7fe19f2da6a5 in handle_response (dpy=dpy@entry=0x561f82268200, 
response=0x7fe18808a0f0, in_XReply=in_XReply@entry=0) at ../../src/xcb_io.c:403
#10 0x7fe19f2db152 in _XEventsQueued (dpy=dpy@entry=0x561f82268200, 
mode=mode@entry=2) at ../../src/xcb_io.c:442
#11 0x7fe19f2cc817 in XPending (dpy=0x561f82268200) at 
../../src/Pending.c:55
#12 0x7fe19fd2dec8 in g_main_context_check_unlocked 
(context=context@entry=0x561f821b58b0, max_priority=, 
max_priority@entry=2147483647, fds=fds@entry=0x561f90579290, 
n_fds=n_fds@entry=11) at ../../../glib/gmain.c:4171
#13 0x7fe19fd2e51b in g_main_context_iterate_unlocked 
(context=0x561f821b58b0, block=block@entry=1, dispatch=dispatch@entry=1, 
self=) at ../../../glib/gmain.c:4346
#14 0x7fe19fd2eebf in g_main_loop_run (loop=0x561f845069a0) at 
../../../glib/gmain.c:4551
#15 0x7fe19f8d71a5 in meta_context_run_main_loop 
(context=context@entry=0x561f821b3c80 [MetaContextMain], 
error=error@entry=0x7ffd87954020) at ../src/core/meta-context.c:482
#16 0x561f81aeb99f in main (argc=, argv=) at 
../src/main.c:683


In case it matters, on one of the videos, mpv shows

 (+) Video --vid=1 (*) (h264 1280x720 29.706fps)
 (+) Audio --aid=1 (*) (aac 2ch 44100Hz)
AO: [pipewire] 44100Hz stereo 2ch floatp
VO: [gpu] 1280x720 yuv420p


I have a nvidia gpu with the proprietary driver packaged by Debian.
I don't see anything relevant in Xorg.*.log*
dmesg shows for each crash something like

[25284.801604] rfkill: input handler enabled
[25284.877204] gnome-shell[25306]: segfault at 28 ip 7f5bba4f5f14 sp 
7ffd36235540 error 4 in libmutter-clutter-12.so.0.0.0[7f5bba489000+8d000] 
likely on CPU 8 (core 0, socket 0)
[25284.877213] Code: 72 e1 03