After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 768087 - gnome-screenshot 100% CPU with totem unable to play file missing coded
gnome-screenshot 100% CPU with totem unable to play file missing coded
Status: RESOLVED FIXED
Product: gnome-screenshot
Classification: Core
Component: general
3.20.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-screenshot-maint
gnome-screenshot-maint
Depends on:
Blocks:
 
 
Reported: 2016-06-27 10:22 UTC by Michael Vorburger
Modified: 2016-10-09 06:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot-dialog: Avoid resizing the preview too much (2.94 KB, patch)
2016-07-11 12:33 UTC, Rui Matos
committed Details | Review
pstack (6.39 KB, text/plain)
2016-07-12 12:35 UTC, Michael Vorburger
  Details

Description Michael Vorburger 2016-06-27 10:22:29 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.
Comment 1 Rui Matos 2016-07-11 12:31:17 UTC
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
Comment 2 Rui Matos 2016-07-11 12:33:13 UTC
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?
Comment 3 Michael Vorburger 2016-07-12 12:35:47 UTC
Created attachment 331323 [details]
pstack
Comment 4 Rui Matos 2016-07-12 14:34:05 UTC
(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
Comment 5 Cosimo Cecchi 2016-07-12 15:27:58 UTC
Review of attachment 331215 [details] [review]:

Looks good, thanks Rui.
Comment 6 Rui Matos 2016-07-13 17:54:12 UTC
Attachment 331215 [details] pushed as c21823b - screenshot-dialog: Avoid resizing the preview too much