Package: emacs;
Reported by: Óscar Fuentes <oscarfv <at> eclipso.eu>
Date: Mon, 14 Jul 2025 11:17:02 UTC
Severity: normal
Found in version 31.0.50
To reply to this bug, email your comments to 79014 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
View this report as an mbox folder, status mbox, maintainer mbox
bug-gnu-emacs <at> gnu.org
:bug#79014
; Package emacs
.
(Mon, 14 Jul 2025 11:17:02 GMT) Full text and rfc822 format available.Óscar Fuentes <oscarfv <at> eclipso.eu>
:bug-gnu-emacs <at> gnu.org
.
(Mon, 14 Jul 2025 11:17:02 GMT) Full text and rfc822 format available.Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
From: Óscar Fuentes <oscarfv <at> eclipso.eu> To: bug-gnu-emacs <at> gnu.org Subject: 31.0.50; igc: infinite loop Date: Mon, 14 Jul 2025 13:15:43 +0200
On a long-lived emacs session (two weeks of intensive use), while reverting a versioned file with C-x v u (something that I did multiple times before on the same session) Emacs entered an infinite loop using 100% CPU, ignoring C-g and SIGUSR2 and had to be killed eventually after attaching gdb and obtaining the backtraces below. #0 truncate_undo_list (b=b <at> entry=0x7fb33b464b18) at ../../emacs/src/lisp.h:1534 list = <optimized out> prev = <optimized out> next = <optimized out> last_boundary = 0x0 size_so_far = 20445947 count = {bytes = <optimized out>} undo_outer_limit = <optimized out> #1 0x00005596d35701d9 in compact_buffer (buffer=buffer <at> entry=0x7fb33b464b18) at ../../emacs/src/buffer.c:1874 #2 0x00005596d36669e2 in buffer_step (it=<synthetic pointer>) at ../../emacs/src/igc.c:4051 buf = 0x7fb33b464b1d b = 0x7fb33b464b18 #3 igc_on_idle () at ../../emacs/src/igc.c:4083 work_done = <optimized out> clock = {expire = <optimized out>} buffer_it = {alist = <optimized out>, buf = <optimized out>} #4 0x00005596d354f2b5 in timer_check_2 (timers=<optimized out>, idle_timers=<optimized out>) at ../../emacs/src/keyboard.c:4722 now = {tv_sec = <optimized out>, tv_nsec = <optimized out>} idleness_now = {tv_sec = <optimized out>, tv_nsec = <optimized out>} now = {tv_sec = <optimized out>, tv_nsec = <optimized out>} idleness_now = {tv_sec = <optimized out>, tv_nsec = <optimized out>} funcall = <optimized out> chosen_timer = <optimized out> timer = <optimized out> idle_timer = <optimized out> --Type <RET> for more, q to quit, c to continue without paging-- difference = {tv_sec = <optimized out>, tv_nsec = <optimized out>} timer_difference = {tv_sec = <optimized out>, tv_nsec = <optimized out>} idle_timer_difference = {tv_sec = <optimized out>, tv_nsec = <optimized out>} ripe = <optimized out> timer_ripe = <optimized out> idle_timer_ripe = <optimized out> timer_time = {tv_sec = <optimized out>, tv_nsec = <optimized out>} idle_timer_time = {tv_sec = <optimized out>, tv_nsec = <optimized out>} count = {bytes = <optimized out>} old_deactivate_mark = <optimized out> #5 timer_check () at ../../emacs/src/keyboard.c:4891 nexttime = {tv_sec = <optimized out>, tv_nsec = <optimized out>} timers = 0x7fb256c7dc73 idle_timers = <optimized out> tem = <optimized out> #6 0x00005596d354f7e5 in readable_events (flags=flags <at> entry=3) at ../../emacs/src/keyboard.c:3618 #7 0x00005596d354f9c0 in get_input_pending (flags=flags <at> entry=3) at ../../emacs/src/keyboard.c:8007 #8 0x00005596d354fad5 in Finput_pending_p (check_timers=0x38) at ../../emacs/src/keyboard.c:11799 #9 0x00007fb32f4ed5b2 in F7369742d666f72_sit_for_0 () at /home/oscar/dev/emacs/igc/build/src/../native-lisp/31.0.50-61e73da1/preloaded/subr-13adf6a6-dbedbcf7.eln #10 0x00005596d35d6a0c in Ffuncall (nargs=2, args=0x7fff3751ec00) at ../../emacs/src/eval.c:3195 count = {bytes = <optimized out>} val = <optimized out> #11 0x00007fb32e40648e in F646973706c61792d7761726e696e67_display_warning_0 () at /home/oscar/.emacs.d/eln-cache/31.0.50-61e73da1/warnings-28e75f4d-f0ade81c.eln #12 0x00005596d35d6a0c in Ffuncall (nargs=4, args=0x7fff3751ee00) at ../../emacs/src/eval.c:3195 --Type <RET> for more, q to quit, c to continue without paging-- count = {bytes = <optimized out>} val = <optimized out> #13 0x00007fb32f243db7 in F756e646f2d6f757465722d6c696d69742d7472756e63617465_undo_outer_limit_truncate_0 () at /home/oscar/dev/emacs/igc/build/src/../native-lisp/31.0.50-61e73da1/preloaded/simple-fab5b0cf-9e866eaa.eln #14 0x00005596d35d6a0c in Ffuncall (nargs=nargs <at> entry=2, args=args <at> entry=0x7fff3751ee80) at ../../emacs/src/eval.c:3195 count = {bytes = <optimized out>} val = <optimized out> #15 0x00005596d35ae9ed in truncate_undo_list (b=b <at> entry=0x7fb33b464b18) at ../../emacs/src/undo.c:366 tem = <optimized out> list = <optimized out> prev = <optimized out> next = <optimized out> last_boundary = 0x0 size_so_far = <optimized out> count = {bytes = <optimized out>} undo_outer_limit = <optimized out> #16 0x00005596d35701d9 in compact_buffer (buffer=buffer <at> entry=0x7fb33b464b18) at ../../emacs/src/buffer.c:1874 #17 0x00005596d36669e2 in buffer_step (it=<synthetic pointer>) at ../../emacs/src/igc.c:4051 buf = 0x7fb33b464b1d b = 0x7fb33b464b18 #18 igc_on_idle () at ../../emacs/src/igc.c:4083 work_done = <optimized out> clock = {expire = <optimized out>} --Type <RET> for more, q to quit, c to continue without paging-- buffer_it = {alist = <optimized out>, buf = <optimized out>} #19 0x00005596d354f2b5 in timer_check_2 (timers=<optimized out>, idle_timers=<optimized out>) at ../../emacs/src/keyboard.c:4722 now = {tv_sec = <optimized out>, tv_nsec = <optimized out>} idleness_now = {tv_sec = <optimized out>, tv_nsec = <optimized out>} now = {tv_sec = <optimized out>, tv_nsec = <optimized out>} idleness_now = {tv_sec = <optimized out>, tv_nsec = <optimized out>} funcall = <optimized out> chosen_timer = <optimized out> timer = <optimized out> idle_timer = <optimized out> difference = {tv_sec = <optimized out>, tv_nsec = <optimized out>} timer_difference = {tv_sec = <optimized out>, tv_nsec = <optimized out>} idle_timer_difference = {tv_sec = <optimized out>, tv_nsec = <optimized out>} ripe = <optimized out> timer_ripe = <optimized out> idle_timer_ripe = <optimized out> timer_time = {tv_sec = <optimized out>, tv_nsec = <optimized out>} idle_timer_time = {tv_sec = <optimized out>, tv_nsec = <optimized out>} count = {bytes = <optimized out>} old_deactivate_mark = <optimized out> #20 timer_check () at ../../emacs/src/keyboard.c:4891 nexttime = {tv_sec = <optimized out>, tv_nsec = <optimized out>} timers = 0x7fb256c795b3 idle_timers = <optimized out> tem = <optimized out> (gdb) xbacktrace "sit-for" (0x3751ec08) "display-warning" (0x3751ee08) "undo-outer-limit-truncate" (0x3751ee88) "sit-for" (0x3751f1c8) "display-warning" (0x3751f3c8) "undo-outer-limit-truncate" (0x3751f448) "sit-for" (0x3751f788) "display-warning" (0x3751f988) "undo-outer-limit-truncate" (0x3751fa08) "sit-for" (0x3751fd48) "display-warning" (0x3751ff48) "undo-outer-limit-truncate" (0x3751ffc8) "sit-for" (0x37520308) "display-warning" (0x37520508) "undo-outer-limit-truncate" (0x37520588) "sit-for" (0x375208c8) "display-warning" (0x37520ac8) "undo-outer-limit-truncate" (0x37520b48) "sit-for" (0x37520e88) "display-warning" (0x37521088) "undo-outer-limit-truncate" (0x37521108) "sit-for" (0x37521448) "display-warning" (0x37521648) "undo-outer-limit-truncate" (0x375216c8) "sit-for" (0x37521a08) "display-warning" (0x37521c08) "undo-outer-limit-truncate" (0x37521c88) In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.18.4) of 2025-06-29 built on zen Repository revision: 1c19182e28e90b619a4c3d5553e3b5ae03eccd12 Repository branch: feature/igc Windowing system distributor 'The X.Org Foundation', version 11.0.12101016 System Description: Debian GNU/Linux 13 (trixie) Configured using: 'configure 'CPPFLAGS=-O2 -fno-omit-frame-pointer -g3' CPPFLAGS=-I/home/oscar/dev/include/mps LDFLAGS=-L/home/oscar/dev/other/mps/code --with-native-compilation --with-tree-sitter --without-toolkit-scroll-bars --with-x-toolkit=lucid --with-modules --without-imagemagick --with-mps=yes' Configured features: CAIRO FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG LIBOTF LIBSELINUX LIBXML2 MODULES MPS NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TREE_SITTER WEBP X11 XAW3D XDBE XIM XPM LUCID ZLIB Important settings: value of $LANG: C locale-coding-system: nil Major mode: Lisp Interaction Minor modes in effect: window-highlight-mode: t xterm-mouse-mode: t treemacs-filewatch-mode: t treemacs-follow-mode: t treemacs-git-mode: t treemacs-fringe-indicator-mode: t org-roam-db-autosync-mode: t fancy-compilation-mode: t diff-hl-flydiff-mode: t diff-hl-mode: t difftastic-bindings-mode: t global-git-commit-mode: t pulsar-global-mode: t pulsar-mode: t evil-owl-mode: t enhanced-evil-paredit-mode: t evil-local-mode: t key-chord-mode: t paredit-mode: t server-mode: t display-fill-column-indicator-mode: t vertico-multiform-mode: t marginalia-mode: t vertico-mode: t which-key-mode: t global-anzu-mode: t anzu-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t minibuffer-regexp-mode: t column-number-mode: t line-number-mode: t indent-tabs-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: /home/oscar/elisp/singles/flx hides /home/oscar/.emacs.d/elpa/flx-20240205.356/flx /home/oscar/elisp/magit/lisp/magit-section hides /home/oscar/.emacs.d/elpa/magit-section-20250704.2300/magit-section /home/oscar/elisp/singles/which-key hides /home/oscar/dev/emacs/igc/emacs/lisp/which-key Features: (shadow sort mail-extr emacsbug help-fns radix-tree vertico-directory mule-util vertico-sort fussy window-highlight solarized-selenized-dark-theme solarized-selenized-light-theme solarized-palettes solarized solarized-faces xt-mouse term/xterm xterm meteo-radar lsp-dart lsp-dart-commands lsp-dart-flutter-widget-guide lsp-dart-flutter-fringe-colors lsp-dart-flutter-colors lsp-dart-outline lsp-dart-code-lens lsp-lens lsp-dart-test-tree lsp-treemacs lsp-treemacs-generic lsp-treemacs-themes treemacs-treelib treemacs treemacs-header-line treemacs-compatibility treemacs-mode treemacs-bookmarks treemacs-tags treemacs-interface treemacs-persistence treemacs-filewatch-mode treemacs-follow-mode treemacs-rendering treemacs-annotations treemacs-async treemacs-workspaces treemacs-dom treemacs-visuals treemacs-fringe-indicator treemacs-faces treemacs-icons treemacs-scope treemacs-themes treemacs-core-utils pfuture hl-line treemacs-logging treemacs-customization treemacs-macros lsp-dart-test-output lsp-dart-test-support lsp-dart-dap lsp-dart-devtools lsp-dart-flutter-daemon jsonrpc dap-utils dom xml dap-mode dap-tasks dap-launch lsp-docker yaml posframe dap-overlays lsp-dart-closing-labels lsp-dart-utils lsp-dart-protocol lsp-mode lsp-protocol tree-widget spinner network-stream nsm markdown-mode lv f flymake flycheck lp0-ts-mode lp0-mode symbol-overlay company-ctags find-file company-fuzzy ht company aggressive-indent deft orgit emacsql-sqlite-builtin org-roam-migrate org-roam-log org-roam-mode org-roam-capture org-roam-id org-roam-node org-roam-db org-roam-utils org-roam-compat org-roam org-attach emacsql-sqlite emacsql emacsql-compiler org-noter org-element org-persist org-id org-element-ast inline avl-tree org-protocol org-capture org-refile org-crypt org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-src sh-script smie treesit executable ob-comint org-pcomplete org-list org-footnote org-faces org-entities noutline outline ob-emacs-lisp ob-core ob-eval org-cycle org-table org-keys oc org-loaddefs find-func etags-select etags fileloop generator xref project ol org-fold org-fold-core org-compat org-version org-macs cond-star fancy-compilation ffap diff-hl-flydiff diff-hl log-view difftastic-bindings difftastic view magit-bookmark bookmark git-rebase magit-dired magit-extras magit-sparse-checkout magit-gitignore magit-ediff ediff magit-subtree magit-patch magit-submodule 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 magit-diff smerge-mode diff git-commit magit-core magit-autorevert autorevert filenotify magit-margin magit-transient magit-process with-editor shell pcomplete magit-mode transient magit-git magit-base which-func imenu vc-git files-x vc-dir ewoc vc vc-dispatcher magit-section benchmark cursor-sensor crm llama pulsar pulse color evil-owl format-spec buffer-flip enhanced-evil-paredit evil-anzu evil evil-keybindings evil-integration evil-maps evil-commands evil-digraphs reveal evil-jumps evil-command-window evil-types evil-search evil-ex evil-macros evil-repeat evil-states evil-core evil-common rect evil-vars mini-echo mini-echo-segments let-alist hide-mode-line face-remap wgrep grep ag vc-svn find-dired s dash key-chord comp comp-cstr comp-run comp-common cmake-mode rx rst compile comint ansi-osc ansi-color paredit-menu paredit edmacro kmacro server yasnippet lisp-mnt psvn wid-edit log-edit message sendmail yank-media puny rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util text-property-search time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils mailheader pcvs-util add-log diff-mode track-changes pp elp ediff-merg ediff-mult ediff-wind ediff-diff ediff-help ediff-init ediff-util dired dired-loaddefs display-fill-column-indicator vertico-multiform marginalia vertico flx-rs-core flx-rs flx goto-chg avy ring highlight-parentheses ws-butler which-key diminish cl anzu easy-mmode thingatpt tmr pcase compat solar cal-dst cal-menu calendar cal-loaddefs finder-inf advice cl-extra help-mode warnings disp-table apropospriate-theme-autoloads company-posframe-autoloads company-autoloads consult-flycheck-autoloads consult-lsp-autoloads consult-org-roam-autoloads corfu-autoloads deadgrep-autoloads diff-hl-autoloads eat-autoloads ellama-autoloads embark-consult-autoloads consult-autoloads embark-autoloads flutter-autoloads flycheck-autoloads fussy-autoloads flx-autoloads groovy-mode-autoloads llm-autoloads lsp-dart-autoloads dart-mode-autoloads dap-mode-autoloads bui-autoloads lsp-docker-autoloads lsp-treemacs-autoloads lsp-ui-autoloads lsp-mode-autoloads f-autoloads marginalia-autoloads markdown-mode-autoloads org-roam-autoloads magit-section-autoloads llama-autoloads emacsql-autoloads plz-event-source-autoloads plz-media-type-autoloads plz-autoloads pomm-autoloads alert-autoloads log4e-autoloads gntp-autoloads spinner-autoloads swiper-autoloads ivy-autoloads symbol-overlay-autoloads treemacs-autoloads cfrs-autoloads posframe-autoloads ht-autoloads hydra-autoloads lv-autoloads pfuture-autoloads ace-window-autoloads avy-autoloads s-autoloads info dash-autoloads vertico-autoloads wgrep-ag-autoloads wgrep-deadgrep-autoloads wgrep-autoloads yaml-autoloads package browse-url xdg url url-proxy url-privacy url-expand url-methods url-history url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs icons password-cache json subr-x map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd touch-screen tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine 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 emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads inotify dynamic-setting system-font-setting font-render-setting cairo x-toolkit x multi-tty move-toolbar make-network-process tty-child-frames native-compile mps emacs) Memory information: ((conses 24 0 0) (symbols 56 0 0) (strings 40 0 0) (string-bytes 1 0) (vectors 24 0) (vector-slots 8 0 0) (floats 24 0 0) (intervals 64 0 0) (buffers 1072 0))
bug-gnu-emacs <at> gnu.org
:bug#79014
; Package emacs
.
(Mon, 14 Jul 2025 13:18:01 GMT) Full text and rfc822 format available.Message #8 received at 79014 <at> debbugs.gnu.org (full text, mbox):
From: Eli Zaretskii <eliz <at> gnu.org> To: Óscar Fuentes <oscarfv <at> eclipso.eu> Cc: 79014 <at> debbugs.gnu.org Subject: Re: bug#79014: 31.0.50; igc: infinite loop Date: Mon, 14 Jul 2025 16:16:52 +0300
> Date: Mon, 14 Jul 2025 13:15:43 +0200 > From: Óscar Fuentes via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org> > > > On a long-lived emacs session (two weeks of intensive use), while > reverting a versioned file with C-x v u (something that I did multiple > times before on the same session) Emacs entered an infinite loop using > 100% CPU, ignoring C-g and SIGUSR2 and had to be killed eventually after > attaching gdb and obtaining the backtraces below. > > #0 truncate_undo_list (b=b <at> entry=0x7fb33b464b18) at ../../emacs/src/lisp.h:1534 > list = <optimized out> > prev = <optimized out> > next = <optimized out> > last_boundary = 0x0 > size_so_far = 20445947 > count = {bytes = <optimized out>} > undo_outer_limit = <optimized out> > #1 0x00005596d35701d9 in compact_buffer (buffer=buffer <at> entry=0x7fb33b464b18) > at ../../emacs/src/buffer.c:1874 > #2 0x00005596d36669e2 in buffer_step (it=<synthetic pointer>) at ../../emacs/src/igc.c:4051 > buf = 0x7fb33b464b1d > b = 0x7fb33b464b18 > #3 igc_on_idle () at ../../emacs/src/igc.c:4083 > work_done = <optimized out> > clock = {expire = <optimized out>} > buffer_it = {alist = <optimized out>, buf = <optimized out>} > #4 0x00005596d354f2b5 in timer_check_2 (timers=<optimized out>, idle_timers=<optimized out>) > at ../../emacs/src/keyboard.c:4722 > now = {tv_sec = <optimized out>, tv_nsec = <optimized out>} > idleness_now = {tv_sec = <optimized out>, tv_nsec = <optimized out>} > now = {tv_sec = <optimized out>, tv_nsec = <optimized out>} > idleness_now = {tv_sec = <optimized out>, tv_nsec = <optimized out>} > funcall = <optimized out> > chosen_timer = <optimized out> > timer = <optimized out> > idle_timer = <optimized out> > --Type <RET> for more, q to quit, c to continue without paging-- > difference = {tv_sec = <optimized out>, tv_nsec = <optimized out>} > timer_difference = {tv_sec = <optimized out>, tv_nsec = <optimized out>} > idle_timer_difference = {tv_sec = <optimized out>, tv_nsec = <optimized out>} > ripe = <optimized out> > timer_ripe = <optimized out> > idle_timer_ripe = <optimized out> > timer_time = {tv_sec = <optimized out>, tv_nsec = <optimized out>} > idle_timer_time = {tv_sec = <optimized out>, tv_nsec = <optimized out>} > count = {bytes = <optimized out>} > old_deactivate_mark = <optimized out> > #5 timer_check () at ../../emacs/src/keyboard.c:4891 > nexttime = {tv_sec = <optimized out>, tv_nsec = <optimized out>} > timers = 0x7fb256c7dc73 > idle_timers = <optimized out> > tem = <optimized out> > #6 0x00005596d354f7e5 in readable_events (flags=flags <at> entry=3) at ../../emacs/src/keyboard.c:3618 > #7 0x00005596d354f9c0 in get_input_pending (flags=flags <at> entry=3) at ../../emacs/src/keyboard.c:8007 > #8 0x00005596d354fad5 in Finput_pending_p (check_timers=0x38) at ../../emacs/src/keyboard.c:11799 > #9 0x00007fb32f4ed5b2 in F7369742d666f72_sit_for_0 () > at /home/oscar/dev/emacs/igc/build/src/../native-lisp/31.0.50-61e73da1/preloaded/subr-13adf6a6-dbedbcf7.eln > #10 0x00005596d35d6a0c in Ffuncall (nargs=2, args=0x7fff3751ec00) at ../../emacs/src/eval.c:3195 > count = {bytes = <optimized out>} > val = <optimized out> > #11 0x00007fb32e40648e in F646973706c61792d7761726e696e67_display_warning_0 () > at /home/oscar/.emacs.d/eln-cache/31.0.50-61e73da1/warnings-28e75f4d-f0ade81c.eln > #12 0x00005596d35d6a0c in Ffuncall (nargs=4, args=0x7fff3751ee00) at ../../emacs/src/eval.c:3195 > --Type <RET> for more, q to quit, c to continue without paging-- > count = {bytes = <optimized out>} > val = <optimized out> > #13 0x00007fb32f243db7 in F756e646f2d6f757465722d6c696d69742d7472756e63617465_undo_outer_limit_truncate_0 > () > at /home/oscar/dev/emacs/igc/build/src/../native-lisp/31.0.50-61e73da1/preloaded/simple-fab5b0cf-9e866eaa.eln > #14 0x00005596d35d6a0c in Ffuncall (nargs=nargs <at> entry=2, args=args <at> entry=0x7fff3751ee80) > at ../../emacs/src/eval.c:3195 > count = {bytes = <optimized out>} > val = <optimized out> > #15 0x00005596d35ae9ed in truncate_undo_list (b=b <at> entry=0x7fb33b464b18) at ../../emacs/src/undo.c:366 > tem = <optimized out> > list = <optimized out> > prev = <optimized out> > next = <optimized out> > last_boundary = 0x0 > size_so_far = <optimized out> > count = {bytes = <optimized out>} > undo_outer_limit = <optimized out> > #16 0x00005596d35701d9 in compact_buffer (buffer=buffer <at> entry=0x7fb33b464b18) > at ../../emacs/src/buffer.c:1874 > #17 0x00005596d36669e2 in buffer_step (it=<synthetic pointer>) at ../../emacs/src/igc.c:4051 > buf = 0x7fb33b464b1d > b = 0x7fb33b464b18 > #18 igc_on_idle () at ../../emacs/src/igc.c:4083 > work_done = <optimized out> > clock = {expire = <optimized out>} > --Type <RET> for more, q to quit, c to continue without paging-- > buffer_it = {alist = <optimized out>, buf = <optimized out>} > #19 0x00005596d354f2b5 in timer_check_2 (timers=<optimized out>, idle_timers=<optimized out>) > at ../../emacs/src/keyboard.c:4722 > now = {tv_sec = <optimized out>, tv_nsec = <optimized out>} > idleness_now = {tv_sec = <optimized out>, tv_nsec = <optimized out>} > now = {tv_sec = <optimized out>, tv_nsec = <optimized out>} > idleness_now = {tv_sec = <optimized out>, tv_nsec = <optimized out>} > funcall = <optimized out> > chosen_timer = <optimized out> > timer = <optimized out> > idle_timer = <optimized out> > difference = {tv_sec = <optimized out>, tv_nsec = <optimized out>} > timer_difference = {tv_sec = <optimized out>, tv_nsec = <optimized out>} > idle_timer_difference = {tv_sec = <optimized out>, tv_nsec = <optimized out>} > ripe = <optimized out> > timer_ripe = <optimized out> > idle_timer_ripe = <optimized out> > timer_time = {tv_sec = <optimized out>, tv_nsec = <optimized out>} > idle_timer_time = {tv_sec = <optimized out>, tv_nsec = <optimized out>} > count = {bytes = <optimized out>} > old_deactivate_mark = <optimized out> > #20 timer_check () at ../../emacs/src/keyboard.c:4891 > nexttime = {tv_sec = <optimized out>, tv_nsec = <optimized out>} > timers = 0x7fb256c795b3 > idle_timers = <optimized out> > tem = <optimized out> > > > > (gdb) xbacktrace > "sit-for" (0x3751ec08) > "display-warning" (0x3751ee08) > "undo-outer-limit-truncate" (0x3751ee88) > "sit-for" (0x3751f1c8) > "display-warning" (0x3751f3c8) > "undo-outer-limit-truncate" (0x3751f448) > "sit-for" (0x3751f788) > "display-warning" (0x3751f988) > "undo-outer-limit-truncate" (0x3751fa08) > "sit-for" (0x3751fd48) > "display-warning" (0x3751ff48) > "undo-outer-limit-truncate" (0x3751ffc8) > "sit-for" (0x37520308) > "display-warning" (0x37520508) > "undo-outer-limit-truncate" (0x37520588) > "sit-for" (0x375208c8) > "display-warning" (0x37520ac8) > "undo-outer-limit-truncate" (0x37520b48) > "sit-for" (0x37520e88) > "display-warning" (0x37521088) > "undo-outer-limit-truncate" (0x37521108) > "sit-for" (0x37521448) > "display-warning" (0x37521648) > "undo-outer-limit-truncate" (0x375216c8) > "sit-for" (0x37521a08) > "display-warning" (0x37521c08) > "undo-outer-limit-truncate" (0x37521c88) Any idea what it was trying to warn about in display-warning frames? I suspect it's some kind of memory-full situation. Do you still have that session in GDB?
bug-gnu-emacs <at> gnu.org
:bug#79014
; Package emacs
.
(Mon, 14 Jul 2025 13:36:02 GMT) Full text and rfc822 format available.Message #11 received at 79014 <at> debbugs.gnu.org (full text, mbox):
From: Óscar Fuentes <oscarfv <at> eclipso.eu> To: Eli Zaretskii <eliz <at> gnu.org> Cc: 79014 <at> debbugs.gnu.org Subject: Re: bug#79014: 31.0.50; igc: infinite loop Date: Mon, 14 Jul 2025 15:35:17 +0200
Eli Zaretskii <eliz <at> gnu.org> writes: > Any idea what it was trying to warn about in display-warning frames? No, sorry. > I suspect it's some kind of memory-full situation. I'll mention this in case it is relevant: Emacs was using about 2.8 GB of RSS and that machine has 64 GB of RAM, almost all free. > Do you still have that session in GDB? No :-(
bug-gnu-emacs <at> gnu.org
:bug#79014
; Package emacs
.
(Mon, 14 Jul 2025 13:47:01 GMT) Full text and rfc822 format available.Message #14 received at 79014 <at> debbugs.gnu.org (full text, mbox):
From: Eli Zaretskii <eliz <at> gnu.org> To: Óscar Fuentes <oscarfv <at> eclipso.eu> Cc: 79014 <at> debbugs.gnu.org Subject: Re: bug#79014: 31.0.50; igc: infinite loop Date: Mon, 14 Jul 2025 16:45:38 +0300
> From: Óscar Fuentes <oscarfv <at> eclipso.eu> > Cc: 79014 <at> debbugs.gnu.org > Date: Mon, 14 Jul 2025 15:35:17 +0200 > > Eli Zaretskii <eliz <at> gnu.org> writes: > > > Any idea what it was trying to warn about in display-warning frames? > > No, sorry. > > > I suspect it's some kind of memory-full situation. > > I'll mention this in case it is relevant: Emacs was using about 2.8 GB > of RSS and that machine has 64 GB of RAM, almost all free. > > > Do you still have that session in GDB? > > No :-( Then I don't see how we could do anything with this report. Too bad. Please in the future try to leave the crashed session inside GDB at least for a while. Unless someone has ideas how to make some progress with this bug, I will soon close it as unreproducible.
bug-gnu-emacs <at> gnu.org
:bug#79014
; Package emacs
.
(Mon, 14 Jul 2025 13:52:01 GMT) Full text and rfc822 format available.Message #17 received at submit <at> debbugs.gnu.org (full text, mbox):
From: Gerd Möllmann <gerd.moellmann <at> gmail.com> To: Óscar Fuentes via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org> Cc: Óscar Fuentes <oscarfv <at> eclipso.eu>, 79014 <at> debbugs.gnu.org Subject: Re: bug#79014: 31.0.50; igc: infinite loop Date: Mon, 14 Jul 2025 15:50:58 +0200
[Message part 1 (text/plain, inline)]
Óscar Fuentes via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org> writes: > On a long-lived emacs session (two weeks of intensive use), while > reverting a versioned file with C-x v u (something that I did multiple > times before on the same session) Emacs entered an infinite loop using > 100% CPU, ignoring C-g and SIGUSR2 and had to be killed eventually after > attaching gdb and obtaining the backtraces below. Thanks. That's a recursive call to igc_on_idle from Lisp being called whle it is running. Looks like something like this is needed:
[on_idle.diff (text/x-patch, attachment)]
bug-gnu-emacs <at> gnu.org
:bug#79014
; Package emacs
.
(Mon, 14 Jul 2025 13:52:02 GMT) Full text and rfc822 format available.bug-gnu-emacs <at> gnu.org
:bug#79014
; Package emacs
.
(Mon, 14 Jul 2025 14:28:02 GMT) Full text and rfc822 format available.Message #23 received at 79014 <at> debbugs.gnu.org (full text, mbox):
From: Óscar Fuentes <oscarfv <at> eclipso.eu> To: Eli Zaretskii <eliz <at> gnu.org> Cc: pipcet <at> protonmail.com, 79014 <at> debbugs.gnu.org Subject: Re: bug#79014: 31.0.50; igc: infinite loop Date: Mon, 14 Jul 2025 16:27:25 +0200
Eli Zaretskii <eliz <at> gnu.org> writes: >> > Any idea what it was trying to warn about in display-warning frames? >> >> No, sorry. >> >> > I suspect it's some kind of memory-full situation. >> >> I'll mention this in case it is relevant: Emacs was using about 2.8 GB >> of RSS and that machine has 64 GB of RAM, almost all free. >> >> > Do you still have that session in GDB? >> >> No :-( > > Then I don't see how we could do anything with this report. Too bad. > Please in the future try to leave the crashed session inside GDB at > least for a while. That's a remote machine that runs Emacs as a daemon. Probably I could figure out how to run another remote instance without killing the previous one, but I had urgent work to do. > Unless someone has ideas how to make some progress with this bug, I > will soon close it as unreproducible. Let's see what Pip has to say. I think I have seen a similar backtrace on the past. The sequence of nested calls doesn't look too sane (timer_check ... igc_on_idle ... truncate_undo_list ... display_warning ... Finput_pending_p ... timer_check) but as mini-echo-mode [1] was active, it starts making sense. mini-echo hides the modeline and uses a repeating idle timer for updating the echo area with the information that usually would be in the modeline. That can execute arbitrary code. Bug 74547 was also a crash with the igc/mini-echo combo. Looks like if the mini-echo timer does its thing at the "wrong" moment wrt igc state, problems arise. For starters, does it make sense for igc_on_idle to be recursive? Can't that function detect that is being called recursively and just return? Another thought: does the time consumed by igc_on_idle count as idle time for idle timers? 1 https://github.com/eki3z/mini-echo.el
bug-gnu-emacs <at> gnu.org
:bug#79014
; Package emacs
.
(Mon, 14 Jul 2025 14:38:02 GMT) Full text and rfc822 format available.Message #26 received at submit <at> debbugs.gnu.org (full text, mbox):
From: Óscar Fuentes <oscarfv <at> eclipso.eu> To: Gerd Möllmann <gerd.moellmann <at> gmail.com> Cc: "Óscar Fuentes via Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>, 79014 <at> debbugs.gnu.org Subject: Re: bug#79014: 31.0.50; igc: infinite loop Date: Mon, 14 Jul 2025 16:37:12 +0200
Gerd Möllmann <gerd.moellmann <at> gmail.com> writes: > Thanks. That's a recursive call to igc_on_idle from Lisp being called > whle it is running. Looks like something like this is needed: Thanks Gerd. Looks like the backtrace was useful after all :-) As I implied on my previous message, it would be useful to understand in what circunstances a recursive call to igc_on_idle happens. More precisely, why Emacs enters an idle state within an idle state. And how the time used by igc_on_idle is accounted for idle timers. Those are general questions, not addressed at you specifically.
bug-gnu-emacs <at> gnu.org
:bug#79014
; Package emacs
.
(Mon, 14 Jul 2025 14:38:02 GMT) Full text and rfc822 format available.bug-gnu-emacs <at> gnu.org
:bug#79014
; Package emacs
.
(Mon, 14 Jul 2025 15:04:03 GMT) Full text and rfc822 format available.Message #32 received at 79014 <at> debbugs.gnu.org (full text, mbox):
From: Gerd Möllmann <gerd.moellmann <at> gmail.com> To: Óscar Fuentes <oscarfv <at> eclipso.eu> Cc: "Óscar Fuentes via Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>, 79014 <at> debbugs.gnu.org Subject: Re: bug#79014: 31.0.50; igc: infinite loop Date: Mon, 14 Jul 2025 17:03:49 +0200
Óscar Fuentes <oscarfv <at> eclipso.eu> writes: > Gerd Möllmann <gerd.moellmann <at> gmail.com> writes: > >> Thanks. That's a recursive call to igc_on_idle from Lisp being called >> whle it is running. Looks like something like this is needed: > > Thanks Gerd. Looks like the backtrace was useful after all :-) :-) > > As I implied on my previous message, it would be useful to understand in > what circunstances a recursive call to igc_on_idle happens. More > precisely, why Emacs enters an idle state within an idle state. And how > the time used by igc_on_idle is accounted for idle timers. > > Those are general questions, not addressed at you specifically. It's difficult. igc_on_indle is called when timer_check runs. That function basically let's Lisp timers work as one would expect, and that is done, because everything is synchronous, by calling timer_check at points where someone though we have the time to do it. One point is when reading input events and another is somewhere in wait_reading_process_input. And it happens that in your case somewhere in the Ffuncall that was on the backtrace one of the points was hit. IOW, in this case, timer_check was also called recursively. But since that can apparently happen independent of igc, I've left it alone of course. Maybe also igc_on_idle is not a good name. Don't know. My 2 cents. Maybe someone else can say more, or has an idea how to do it better.
bug-gnu-emacs <at> gnu.org
:bug#79014
; Package emacs
.
(Mon, 14 Jul 2025 15:05:01 GMT) Full text and rfc822 format available.bug-gnu-emacs <at> gnu.org
:bug#79014
; Package emacs
.
(Mon, 14 Jul 2025 15:09:02 GMT) Full text and rfc822 format available.Message #38 received at 79014 <at> debbugs.gnu.org (full text, mbox):
From: Pip Cet <pipcet <at> protonmail.com> To: Óscar Fuentes <oscarfv <at> eclipso.eu> Cc: Eli Zaretskii <eliz <at> gnu.org>, 79014 <at> debbugs.gnu.org Subject: Re: bug#79014: 31.0.50; igc: infinite loop Date: Mon, 14 Jul 2025 15:08:23 +0000
Óscar Fuentes <oscarfv <at> eclipso.eu> writes: > Eli Zaretskii <eliz <at> gnu.org> writes: > >>> > Any idea what it was trying to warn about in display-warning frames? >>> >>> No, sorry. >>> >>> > I suspect it's some kind of memory-full situation. >>> >>> I'll mention this in case it is relevant: Emacs was using about 2.8 GB >>> of RSS and that machine has 64 GB of RAM, almost all free. >>> >>> > Do you still have that session in GDB? >>> >>> No :-( >> >> Then I don't see how we could do anything with this report. Too bad. >> Please in the future try to leave the crashed session inside GDB at >> least for a while. > > That's a remote machine that runs Emacs as a daemon. Probably I could > figure out how to run another remote instance without killing the > previous one, but I had urgent work to do. >> Unless someone has ideas how to make some progress with this bug, I >> will soon close it as unreproducible. > > Let's see what Pip has to say. I'll have to look up the conversation, but IIRC, this is a clear bug: igc_on_idle shouldn't always start on the same buffer, and it should not call itself recursively; compact_buffer should not attempt to truncate an undo list in a recursive call, either. I'm pretty sure I suggested moving this line BUF_COMPACT (buffer) = BUF_MODIFF (buffer); in compact_buffer to happen before we call truncate_undo_list, which would prevent this infloop, but there's more than one thing to be fixed here. > For starters, does it make sense for igc_on_idle to be recursive? No, I don't think it does. If I'm reading the code correctly, display-warning calls (sit-for 0), and that probably shouldn't cause us to become idle at all. > Can't that function detect that is being called recursively and just > return? I'm not sure I have a good idea of how to fix this yet. igc_on_idle appears to be called in the wrong place if there's a possibility it calls out to Lisp, too. > Another thought: does the time consumed by igc_on_idle count as idle > time for idle timers? I'd like to rephrase that a little: why isn't igc_on_idle an idle timer? There's already some logic in keyboard.c to run idle timers at the correct time, when actually idle, so we could reuse that for the idle work that igc.c needs to do. For now, though, let's do this (on feature/igc): From 41d3fdf4c394c14e3beed1eda3caec6b8e57cb2f Mon Sep 17 00:00:00 2001 From: Pip Cet <pipcet <at> protonmail.com> Date: Mon, 14 Jul 2025 15:05:05 +0000 Subject: [PATCH] Avoid infloops during buffer compaction (bug#79014) * src/buffer.c (compact_buffer): Set the 'BUF_COMPACT' timestamp before entering truncate_undo_list; that way, if truncate_undo_list calls this function recursively, the same buffer will not be considered for compaction twice. --- src/buffer.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/buffer.c b/src/buffer.c index b85394cff3b..e474b8f9dfe 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1866,6 +1866,10 @@ compact_buffer (struct buffer *buffer) && (buffer->base_buffer == NULL) && (BUF_COMPACT (buffer) != BUF_MODIFF (buffer))) { + /* This needs to be first: truncate_undo_list can call out to + Lisp, which may result in this function being reentered. Make + sure we don't infloop in this case. */ + BUF_COMPACT (buffer) = BUF_MODIFF (buffer); /* If a buffer's undo list is Qt, that means that undo is turned off in that buffer. Calling truncate_undo_list on Qt tends to return NULL, which effectively turns undo back on. @@ -1885,7 +1889,6 @@ compact_buffer (struct buffer *buffer) if (BUF_GAP_SIZE (buffer) > size) make_gap_1 (buffer, -(BUF_GAP_SIZE (buffer) - size)); } - BUF_COMPACT (buffer) = BUF_MODIFF (buffer); } } -- 2.50.0
bug-gnu-emacs <at> gnu.org
:bug#79014
; Package emacs
.
(Tue, 15 Jul 2025 09:55:01 GMT) Full text and rfc822 format available.Message #41 received at 79014 <at> debbugs.gnu.org (full text, mbox):
From: Óscar Fuentes <oscarfv <at> eclipso.eu> To: Pip Cet <pipcet <at> protonmail.com> Cc: Eli Zaretskii <eliz <at> gnu.org>, 79014 <at> debbugs.gnu.org Subject: Re: bug#79014: 31.0.50; igc: infinite loop Date: Tue, 15 Jul 2025 11:54:06 +0200
Hello Pip. Was the patch below posted for discussion or did you forgot to push it to feature/igc? I'll like to rebuild Emacs with the fix and having it on the branch is much preferable to applying it as a patch. And while we are at it, I hope there are no objections if I merge master into feature/igc. Thanks. Pip Cet <pipcet <at> protonmail.com> writes: > For now, though, let's do this (on feature/igc): > > From 41d3fdf4c394c14e3beed1eda3caec6b8e57cb2f Mon Sep 17 00:00:00 2001 > From: Pip Cet <pipcet <at> protonmail.com> > Date: Mon, 14 Jul 2025 15:05:05 +0000 > Subject: [PATCH] Avoid infloops during buffer compaction (bug#79014) > > * src/buffer.c (compact_buffer): Set the 'BUF_COMPACT' timestamp > before entering truncate_undo_list; that way, if truncate_undo_list > calls this function recursively, the same buffer will not be > considered for compaction twice.
bug-gnu-emacs <at> gnu.org
:bug#79014
; Package emacs
.
(Wed, 16 Jul 2025 13:55:01 GMT) Full text and rfc822 format available.Message #44 received at 79014 <at> debbugs.gnu.org (full text, mbox):
From: Óscar Fuentes <oscarfv <at> eclipso.eu> To: Pip Cet <pipcet <at> protonmail.com>, Gerd Möllmann <gerd.moellmann <at> gmail.com> Cc: Eli Zaretskii <eliz <at> gnu.org>, 79014 <at> debbugs.gnu.org Subject: Re: bug#79014: 31.0.50; igc: infinite loop Date: Wed, 16 Jul 2025 15:54:44 +0200
Gerd, Pip: Which patch should I apply? Both, perhaps?
bug-gnu-emacs <at> gnu.org
:bug#79014
; Package emacs
.
(Wed, 16 Jul 2025 13:58:01 GMT) Full text and rfc822 format available.Message #47 received at 79014 <at> debbugs.gnu.org (full text, mbox):
From: Pip Cet <pipcet <at> protonmail.com> To: Óscar Fuentes <oscarfv <at> eclipso.eu> Cc: Gerd Möllmann <gerd.moellmann <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>, 79014 <at> debbugs.gnu.org Subject: Re: bug#79014: 31.0.50; igc: infinite loop Date: Wed, 16 Jul 2025 13:57:07 +0000
Óscar Fuentes <oscarfv <at> eclipso.eu> writes: > Gerd, Pip: > > Which patch should I apply? Both, perhaps? Try Gerd's patch first, I'd suggest; it changes less than mine does, and it should be sufficient to avoid the problem. Pip
bug-gnu-emacs <at> gnu.org
:bug#79014
; Package emacs
.
(Wed, 16 Jul 2025 14:35:02 GMT) Full text and rfc822 format available.Message #50 received at 79014 <at> debbugs.gnu.org (full text, mbox):
From: Gerd Möllmann <gerd.moellmann <at> gmail.com> To: Pip Cet <pipcet <at> protonmail.com> Cc: Óscar Fuentes <oscarfv <at> eclipso.eu>, Eli Zaretskii <eliz <at> gnu.org>, 79014 <at> debbugs.gnu.org Subject: Re: bug#79014: 31.0.50; igc: infinite loop Date: Wed, 16 Jul 2025 16:34:40 +0200
Pip Cet <pipcet <at> protonmail.com> writes: > Óscar Fuentes <oscarfv <at> eclipso.eu> writes: > >> Gerd, Pip: >> >> Which patch should I apply? Both, perhaps? > > Try Gerd's patch first, I'd suggest; it changes less than mine does, and > it should be sufficient to avoid the problem. > > Pip I'm about to push what I have in my Emacs, when it builds successfully. (Sorry, I didn't see your patch. I guess I'm a bit out of the loop, meanhilw.)
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.