GNOME Bugzilla – Bug 768087
gnome-screenshot 100% CPU with totem unable to play file missing coded
Last modified: 2016-10-09 06:22:40 UTC
I'm seeing a reproducible 100% CPU of gnome-screenshot 3.20.1 on a Fedora 24 freshly installed yesterday. It happens under both Wayland and direct X11, so unrelated to that. This happens when I try to Take Screenshot with "Grab the current Window", delay 4s, with Effects: [X] Include pointer and [X] Include the window border and "Apply effect: Drop shadow" of a Totem Video Player launched by "xdg-open some.mp4" when it's trying to open a H.264 movie but cannot due to the Codecs missing by default on Fedora, so Totem is fullscreen in its black showing on a secondary attached screen showing "Unable to play the file. H.264 (Main Profile) decoder, MPEG-4 AAC decoder are required to play the file, but are not installed. [Cancel] [Find in Software]" .. gnome-screenshot does the camera-click sound effect, and then goes into 100%, and on Alt-Tab does not show up in the Window list. Suspect it has something to do specifically with Totem being at that screen, because if I now killall gnome-screenshot, and Cancel that dialog in Totem, and retry a Screenshot now, then it works. Happy to help provide further information, but I'd need steps how-to. If this was Java, which I'm more familiar with than gdb & co. I would provide a "jstack" which would help me debug this - if there is something equivalent in your land that would be useful to you, let me know but tell me how to.
Can you install the debuginfo packages and use gdb or pstack to get traces? This sounds like https://bugzilla.redhat.com/show_bug.cgi?id=1353321
Created attachment 331215 [details] [review] screenshot-dialog: Avoid resizing the preview too much Relying on configure events to resize the preview makes us do more work than necessary and, in particular, gtk+ sometimes sends us phony configure events sized 1x1 which make us hit a pretty CPU intensive resize operation in gdk-pixbuf. Instead, we can avoid all that by creating the preview pixbuf lazily on the draw handler using the actual allocated widget size. -- Can you try to reproduce with this patch?
Created attachment 331323 [details] pstack
(In reply to Michael Vorburger from comment #3) > Thread 1 (Thread 0x7f9d34e1da40 (LWP 11432)): > #0 0x00007f9d32bfa7c7 in pixops_process () from /lib64/libgdk_pixbuf-2.0.so.0 > #1 0x00007f9d32bfb2e5 in _pixops_scale () from /lib64/libgdk_pixbuf-2.0.so.0 > #2 0x00007f9d32bf2ff9 in gdk_pixbuf_scale () from /lib64/libgdk_pixbuf-2.0.so.0 > #3 0x00007f9d32bf35b7 in gdk_pixbuf_scale_simple () from /lib64/libgdk_pixbuf-2.0.so.0 > #4 0x00005632d6e7e64a in on_preview_configure_event () right, thanks, as I suspected, this should be fixed with the patch above
Review of attachment 331215 [details] [review]: Looks good, thanks Rui.
Attachment 331215 [details] pushed as c21823b - screenshot-dialog: Avoid resizing the preview too much