GNU bug report logs - #41802
28.0.50; eww triggers 100% CPU consumption when opening page with animated gif

Previous Next

Package: emacs;

Reported by: Jhair Tocancipa Triana <jhair.tocancipa <at> gmail.com>

Date: Thu, 11 Jun 2020 13:48:02 UTC

Severity: normal

Tags: fixed

Merged with 40685

Found in version 28.0.50

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 41802 in the body.
You can then email your comments to 41802 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#41802; Package emacs. (Thu, 11 Jun 2020 13:48:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jhair Tocancipa Triana <jhair.tocancipa <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 11 Jun 2020 13:48:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jhair Tocancipa Triana <jhair.tocancipa <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; eww triggers 100% CPU consumption when opening page with
 animated gif
Date: Thu, 11 Jun 2020 15:47:28 +0200
[Message part 1 (text/plain, inline)]
This bug report will be sent to the Bug-GNU-Emacs mailing list
and the GNU bug tracker at debbugs.gnu.org.  Please check that
the From: line contains a valid email address.  After a delay of up
to one day, you should receive an acknowledgment at that address.

Please write in English if possible, as the Emacs maintainers
usually do not have translators for other languages.

Please describe exactly what actions triggered the bug, and
the precise symptoms of the bug.  If you can, give a recipe
starting from 'emacs -Q':

I can reproduce the issue with the following steps:

1) emacs -Q
2) M-x eww RET
3) https://github.com/drewbarbs/erc-status-sidebar RET

After that CPU consumption rises to 100% until I close the eww buffer
(see emacs-eww-gif-100-cpu.png).

Attached you can find the backtrace
(emacs-eww-gif-100-cpu-bt-full.txt.gz) and xbacktrace
(emacs-eww-gif-100-cpu-xbacktrace.txt.gz).

Please notice that chrome is able to show the page with the animated gif
without causing high CPU consumption.


In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.18, cairo version 1.16.0)
 of 2020-06-11 built on DE1-USER-Ubuntu
Repository revision: d8a6d2e4810a4072cabbf76170dc4bf708f27d10
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12008000
System Description: Ubuntu 20.04 LTS

Recent messages:
nnml: Reading incoming mail (no new mail)...done
Reading active file from private via nnml...done
nnimap read 0k from imap.gmail.com
Reading active file via nndraft...done
Checking new news...done
Mark set
Making completion list...
Quit
Making completion list...
delete-backward-char: Text is read-only [3 times]

Configured features:
XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB NOTIFY
INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF
ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS LIBSYSTEMD
PDUMPER LCMS2 GMP

Important settings:
  value of $LC_ALL: en_US.UTF-8
  value of $LC_MONETARY: en_US.UTF-8
  value of $LC_NUMERIC: en_US.UTF-8
  value of $LC_TIME: en_US.UTF-8
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: IBuffer

Minor modes in effect:
  global-magit-file-mode: t
  magit-auto-revert-mode: t
  global-git-commit-mode: t
  async-bytecomp-package-mode: t
  gnus-desktop-notify-mode: t
  shell-dirtrack-mode: t
  erc-spelling-mode: t
  erc-services-mode: t
  erc-notifications-mode: t
  erc-dcc-mode: t
  which-key-mode: t
  spaceline-helm-mode: t
  savehist-mode: t
  popwin-mode: t
  google-this-mode: t
  global-anzu-mode: t
  anzu-mode: t
  display-time-mode: t
  desktop-save-mode: t
  erc-list-mode: t
  erc-menu-mode: t
  erc-autojoin-mode: t
  erc-ring-mode: t
  erc-networks-mode: t
  erc-pcomplete-mode: t
  erc-match-mode: t
  erc-netsplit-mode: t
  erc-hl-nicks-mode: t
  erc-button-mode: t
  erc-fill-mode: t
  erc-stamp-mode: t
  erc-smiley-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-move-to-prompt-mode: t
  erc-readonly-mode: t
  global-company-mode: t
  company-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow emacsbug hl-line deuglify gnus-cus gnus-diary nndiary gnus-draft
gnus-dup gnus-fun gnus-html gnus-kill gnus-logic gnus-mh mh-comp mh-scan
mh-gnus mh-e mh-compat mh-buffers mh-loaddefs gnus-registry registry
eieio-base gnus-salt gnus-uu yenc gnus-vm tabify man cl-print
erc-ibuffer erc-log erc-notify erc-page erc-sound erc-speedbar speedbar
ezimage dframe erc-xdcc help-fns radix-tree vc-git moe-light-theme
base16-monokai-theme base16-theme monokai-theme helm-themes helm
helm-source eieio-compat helm-multi-match helm-lib qp gnus-picon
gnus-cite mm-archive mail-extr gnus-async gnus-bcklg sort gnus-ml
disp-table misearch multi-isearch shr-color url-cache eww mm-url
magit-submodule magit-obsolete magit-blame magit-stash magit-reflog
magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote
magit-commit magit-sequence magit-notes magit-worktree magit-tag
magit-merge magit-branch magit-reset magit-files magit-refs magit-status
magit magit-repos magit-apply magit-wip magit-log which-func imenu
magit-diff smerge-mode diff diff-mode magit-core magit-autorevert
autorevert filenotify magit-margin magit-transient magit-process
magit-mode git-commit transient magit-git magit-section magit-utils
log-edit pcvs-util add-log with-editor async-bytecomp mule-util ibuf-ext
ibuffer ibuffer-loaddefs leuven-theme smiley gnus-topic utf-7 nndraft
nnmh nnmaildir nnml gnus-demon bbdb-gnus bbdb-mua bbdb-com crm gnutls
network-stream gnus-agent gnus-srvr gnus-score score-mode nnvirtual
gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime dig nntp
gnus-cache footnote smtpmail nnir gnus-sum shr svg dom bbdb-message
sendmail bbdb bbdb-site timezone gnus-desktop-notify gnus-group
gnus-undo gnus-start gnus-cloud nnimap nnmail mail-source utf7 netrc
nnoo gnus-spec gnus-int gnus-range message rfc822 mml mml-sec epa epg
epg-config mm-decode mm-bodies mm-encode mailabbrev gmm-utils mailheader
gnus-win gnus nnheader gnus-util rmail rmail-loaddefs
text-property-search mail-utils diminish tramp tramp-loaddefs trampver
tramp-integration files-x tramp-compat shell parse-time iso8601
ob-python erc-spelling flyspell ispell erc-services
erc-desktop-notifications erc-dcc which-key spaceline-config
spaceline-segments spaceline powerline powerline-separators
powerline-themes paren savehist popwin google-this anzu time desktop
frameset notifications dbus xml yasnippet-snippets angular-snippets s
dash yasnippet flymake-proc flymake warnings pylookup ido cl python-pep8
compile ls-lisp dpaste server org-download org-attach org-id url-http
url url-proxy url-privacy url-expand url-methods url-history mailcap
url-auth mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums
mail-prsvr url-cookie url-domsuf url-util url-gw nsm rmc puny async
org-present org-crypt org-mouse org ob ob-tangle ob-ref ob-lob ob-table
ob-exp org-macro org-footnote org-src ob-comint org-pcomplete org-list
org-faces org-entities noutline outline org-version ob-emacs-lisp
ob-core ob-eval org-table ol org-keys org-compat org-macs org-loaddefs
advice find-func cal-menu calendar cal-loaddefs erc-list erc-menu
erc-join erc-ring erc-networks erc-pcomplete time-date pcomplete comint
ansi-color erc-track erc-match erc-netsplit erc-image image-dired
image-mode exif dired dired-loaddefs url-queue erc-hl-nicks color
erc-button erc-fill erc-stamp easy-mmode erc-goodies erc erc-backend
erc-compat format-spec thingatpt pp erc-loaddefs company-oddmuse
company-keywords company-etags etags fileloop generator xref project
company-gtags company-dabbrev-code company-dabbrev company-files
company-capf company-cmake company-xcode company-clang company-semantic
company-eclim company-template company-bbdb company-emoji
company-emoji-list company exec-path-from-shell paradox paradox-menu
edmacro kmacro cl-extra help-mode paradox-commit-list derived hydra ring
lv cus-edit cus-start cus-load wid-edit paradox-execute let-alist
paradox-github pcase paradox-core spinner tex-site finder-inf rx info
package easymenu browse-url url-handlers url-parse auth-source cl-seq
eieio eieio-core cl-macs eieio-loaddefs password-cache json subr-x map
url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode
lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch
timer select scroll-bar mouse jit-lock font-lock syntax facemenu
font-core term/tty-colors frame minibuffer cl-generic cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese composite charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote threads dbusbind
inotify lcms2 dynamic-setting system-font-setting font-render-setting
cairo move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 3911265 405219)
 (symbols 48 49650 1)
 (strings 32 1034723 54524)
 (string-bytes 1 67500487)
 (vectors 16 345948)
 (vector-slots 8 4966263 396117)
 (floats 8 604 946)
 (intervals 56 202876 18669)
 (buffers 992 53))

[emacs-eww-gif-100-cpu.png (image/png, attachment)]
[emacs-eww-gif-100-cpu-bt-full.txt.gz (application/gzip, attachment)]
[emacs-eww-gif-100-cpu-xbacktrace.txt.gz (application/gzip, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41802; Package emacs. (Thu, 11 Jun 2020 20:56:01 GMT) Full text and rfc822 format available.

Message #8 received at 41802 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Jhair Tocancipa Triana <jhair.tocancipa <at> gmail.com>
Cc: 41802 <at> debbugs.gnu.org
Subject: Re: bug#41802: 28.0.50; eww triggers 100% CPU consumption when
 opening page with animated gif
Date: Thu, 11 Jun 2020 22:54:57 +0200 (CEST)
On Thu, Jun 11, 2020 at 03:47:28PM +0200, Jhair Tocancipa Triana wrote:
> I can reproduce the issue with the following steps:
> 
> 1) emacs -Q
> 2) M-x eww RET
> 3) https://github.com/drewbarbs/erc-status-sidebar RET
> 
> After that CPU consumption rises to 100% until I close the eww buffer

Almost certainly this is down to how we handle images.

The gif file is decoded one frame at a time, which is quite
inefficient as to decode frame x, all frames from 0-x must be decoded.

This is normally only a problem for the first run through as we cache
the images, however, if the gif is long enough, by the time we reach
the the last frame the first frames may have already been flushed from
the cache resulting in them having to be decoded again.

There was some discussion of this a little while back and I don't
think we had any workable solution beyond a rewrite of the image code.
-- 
Alan Third




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41802; Package emacs. (Fri, 17 Jul 2020 01:22:01 GMT) Full text and rfc822 format available.

Message #11 received at 41802 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Jhair Tocancipa Triana <jhair.tocancipa <at> gmail.com>
Cc: 41802 <at> debbugs.gnu.org
Subject: Re: bug#41802: 28.0.50; eww triggers 100% CPU consumption when
 opening page with animated gif
Date: Fri, 17 Jul 2020 03:21:08 +0200
Jhair Tocancipa Triana <jhair.tocancipa <at> gmail.com> writes:

> I can reproduce the issue with the following steps:
>
> 1) emacs -Q
> 2) M-x eww RET
> 3) https://github.com/drewbarbs/erc-status-sidebar RET
>
> After that CPU consumption rises to 100% until I close the eww buffer
> (see emacs-eww-gif-100-cpu.png).

I guess this depends on the speed of your computer -- I didn't get 100%
CPU utilisation on that particular GIF.

But it's unfortunate that Emacs is so slow to display animated GIFs.  I
have experienced situations where Emacs has become completely unusable,
especially when there's a lot of the animated GIFs.  There is code in
image.el to try to detect when this is happening:

  (when (and (buffer-live-p (plist-get (cdr image) :animate-buffer))
             ;; Delayed more than two seconds more than expected.
	     (or (time-less-p (time-since target-time) 2)
		 (progn
		   (message "Stopping animation; animation possibly too big")
		   nil)))

But perhaps a two-second timeout is too lenient, and it should stop
animations a lot sooner than that.  Or perhaps the code is buggy...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Forcibly Merged 40685 41802. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 17 Jul 2020 14:05:01 GMT) Full text and rfc822 format available.

Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 29 Jul 2020 06:41:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 40685 <at> debbugs.gnu.org and Francis Meetze <francis <at> bridgesense.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 29 Jul 2020 06:41:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 26 Aug 2020 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 237 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.