Package: emacs;
Reported by: Alexander Prähauser <ahprae <at> protonmail.com>
Date: Wed, 15 Jan 2025 19:01:01 UTC
Severity: normal
Found in version 31.0.50
To reply to this bug, email your comments to 75593 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#75593
; Package emacs
.
(Wed, 15 Jan 2025 19:01:02 GMT) Full text and rfc822 format available.Alexander Prähauser <ahprae <at> protonmail.com>
:bug-gnu-emacs <at> gnu.org
.
(Wed, 15 Jan 2025 19:01:02 GMT) Full text and rfc822 format available.Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
From: Alexander Prähauser <ahprae <at> protonmail.com> To: bug-gnu-emacs <at> gnu.org Subject: 31.0.50; Faulty macro kills Emacs Date: Wed, 15 Jan 2025 19:00:01 +0000
[Message part 1 (text/plain, inline)]
A macro I've defined in causes Emacs to crash. The macro is faulty but I still don't think it should do that. I've attached a file with a functioning version of the macro, the version that crashes with comments where it is changed and where it crashes and a configuration that causes it to crash. Careful, evaluating that buffer will kill Emacs. I've run `emacs -Q' in gdb and added a logging file. The output of `bt-full' is #0 0x00005555557537d9 in ??? () #1 0x0000000000000560 in ??? () #2 0x0000000000000002 in ??? () #3 0x0000000000000002 in ??? () #4 0x00007fffefb5b66b in ??? () #5 0x00007ffff0b592c3 in ??? () #6 0x00007ffff0b48b73 in ??? () #7 0x00007ffff0b5e593 in ??? () #8 0x0000555555727b78 in ??? () #9 0x0000000000000000 in ??? () In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.41, cairo version 1.18.2) of 2025-01-15 built on gentoolaptop Repository revision: 16c89c5ae5ec0c002c327793e783f0a943bacb0d Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12101014 System Description: Gentoo Linux Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG LCMS2 LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB Important settings: value of $LANG: en_US.utf8 locale-coding-system: utf-8-unix Major mode: Text Minor modes in effect: icicle-mode: t minibuffer-depth-indicate-mode: t gdb-many-windows: t mixed-pitch-mode: t Info-breadcrumbs-in-mode-line-mode: t recentf-mode: t global-edit-server-edit-mode: t global-goto-address-mode: t goto-address-mode: t auto-insert-mode: t dynamic-completion-mode: t electric-pair-mode: t corfu-history-mode: t delete-selection-mode: t global-undo-tree-mode: t undo-tree-mode: t desktop-save-mode: t d-emacs-mode: t emms-mode-line-mode: t emms-playing-time-display-mode: t emms-playing-time-mode: t rainbow-delimiters-mode: t global-org-modern-mode: t TeX-PDF-mode: t fancy-compilation-mode: t eshell-vterm-mode: t yas-global-mode: t yas-minor-mode: t all-the-icons-completion-mode: t global-aggressive-indent-mode: t org-roam-db-autosync-mode: t corfu-prescient-mode: t global-corfu-mode: t corfu-mode: t marginalia-mode: t global-git-commit-mode: t magit-auto-revert-mode: t savehist-mode: t smart-mark-mode: t windmove-mode: t straight-use-package-mode: t straight-package-neutering-mode: t override-global-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t global-prettify-symbols-mode: t tab-bar-history-mode: t tab-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t undelete-frame-mode: t minibuffer-regexp-mode: t line-number-mode: t global-visual-line-mode: t visual-line-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: /home/alex/.emacs.d/elpa/Icicles-20241217.3924/bookmark+ hides /home/alex/.emacs.d/elpa/bookmark+-20230325.160624/bookmark+ /home/alex/.emacs.d/straight/build/corfu-terminal/corfu-terminal hides /home/alex/.emacs.d/elpa/corfu-terminal-0.7/corfu-terminal /home/alex/.emacs.d/straight/build/corfu-terminal/corfu-terminal-autoloads hides /home/alex/.emacs.d/elpa/corfu-terminal-0.7/corfu-terminal-autoloads /home/alex/.emacs.d/straight/build/corfu/corfu hides /home/alex/.emacs.d/elpa/corfu-20250103.2029/corfu /home/alex/.emacs.d/straight/build/corfu/corfu-quick hides /home/alex/.emacs.d/elpa/corfu-20250103.2029/corfu-quick /home/alex/.emacs.d/straight/build/corfu/corfu-popupinfo hides /home/alex/.emacs.d/elpa/corfu-20250103.2029/corfu-popupinfo /home/alex/.emacs.d/straight/build/corfu/corfu-info hides /home/alex/.emacs.d/elpa/corfu-20250103.2029/corfu-info /home/alex/.emacs.d/straight/build/corfu/corfu-indexed hides /home/alex/.emacs.d/elpa/corfu-20250103.2029/corfu-indexed /home/alex/.emacs.d/straight/build/corfu/corfu-history hides /home/alex/.emacs.d/elpa/corfu-20250103.2029/corfu-history /home/alex/.emacs.d/straight/build/corfu/corfu-echo hides /home/alex/.emacs.d/elpa/corfu-20250103.2029/corfu-echo /home/alex/.emacs.d/straight/build/corfu/corfu-autoloads hides /home/alex/.emacs.d/elpa/corfu-20250103.2029/corfu-autoloads /home/alex/.emacs.d/elpa/Icicles-20241217.3924/doremi hides /home/alex/.emacs.d/elpa/doremi-20220406.185820/doremi /home/alex/.emacs.d/straight/build/consult/consult hides /home/alex/.emacs.d/elpa/consult-20250107.927/consult /home/alex/.emacs.d/straight/build/consult/consult-xref hides /home/alex/.emacs.d/elpa/consult-20250107.927/consult-xref /home/alex/.emacs.d/straight/build/consult/consult-register hides /home/alex/.emacs.d/elpa/consult-20250107.927/consult-register /home/alex/.emacs.d/straight/build/consult/consult-org hides /home/alex/.emacs.d/elpa/consult-20250107.927/consult-org /home/alex/.emacs.d/straight/build/consult/consult-kmacro hides /home/alex/.emacs.d/elpa/consult-20250107.927/consult-kmacro /home/alex/.emacs.d/straight/build/consult/consult-info hides /home/alex/.emacs.d/elpa/consult-20250107.927/consult-info /home/alex/.emacs.d/straight/build/consult/consult-imenu hides /home/alex/.emacs.d/elpa/consult-20250107.927/consult-imenu /home/alex/.emacs.d/straight/build/consult/consult-flymake hides /home/alex/.emacs.d/elpa/consult-20250107.927/consult-flymake /home/alex/.emacs.d/straight/build/consult/consult-compile hides /home/alex/.emacs.d/elpa/consult-20250107.927/consult-compile /home/alex/.emacs.d/straight/build/consult/consult-autoloads hides /home/alex/.emacs.d/elpa/consult-20250107.927/consult-autoloads /home/alex/.emacs.d/elpa/org-projectile-helm-20230817.801/org-projectile-helm hides /home/alex/.emacs.d/elpa/org-projectile-20230817.851/org-projectile-helm /home/alex/.emacs.d/straight/build/popon/popon hides /home/alex/.emacs.d/elpa/popon-0.13/popon /home/alex/.emacs.d/straight/build/popon/popon-autoloads hides /home/alex/.emacs.d/elpa/popon-0.13/popon-autoloads /home/alex/.emacs.d/elpa/transient-20250108.1351/transient hides /usr/local/share/emacs/31.0.50/lisp/transient /home/alex/.emacs.d/elpa/bind-key-20230203.2004/bind-key hides /usr/local/share/emacs/31.0.50/lisp/bind-key /home/alex/.emacs.d/elpa/modus-themes-20250107.1034/theme-loaddefs hides /usr/local/share/emacs/31.0.50/lisp/theme-loaddefs /home/alex/.emacs.d/elpa/use-package-20230426.2324/use-package-lint hides /usr/local/share/emacs/31.0.50/lisp/use-package/use-package-lint /home/alex/.emacs.d/elpa/use-package-20230426.2324/use-package-jump hides /usr/local/share/emacs/31.0.50/lisp/use-package/use-package-jump /home/alex/.emacs.d/elpa/use-package-ensure-system-package-20221209.2013/use-package-ensure-system-package hides /usr/local/share/emacs/31.0.50/lisp/use-package/use-package-ensure-system-package /home/alex/.emacs.d/elpa/use-package-20230426.2324/use-package-ensure hides /usr/local/share/emacs/31.0.50/lisp/use-package/use-package-ensure /home/alex/.emacs.d/elpa/use-package-20230426.2324/use-package hides /usr/local/share/emacs/31.0.50/lisp/use-package/use-package /home/alex/.emacs.d/elpa/use-package-20230426.2324/use-package-diminish hides /usr/local/share/emacs/31.0.50/lisp/use-package/use-package-diminish /home/alex/.emacs.d/elpa/use-package-20230426.2324/use-package-delight hides /usr/local/share/emacs/31.0.50/lisp/use-package/use-package-delight /home/alex/.emacs.d/elpa/use-package-20230426.2324/use-package-core hides /usr/local/share/emacs/31.0.50/lisp/use-package/use-package-core /home/alex/.emacs.d/elpa/use-package-20230426.2324/use-package-bind-key hides /usr/local/share/emacs/31.0.50/lisp/use-package/use-package-bind-key /home/alex/.emacs.d/straight/build/compat/compat hides /usr/local/share/emacs/31.0.50/lisp/emacs-lisp/compat /home/alex/.emacs.d/straight/build/seq/seq hides /usr/local/share/emacs/31.0.50/lisp/emacs-lisp/seq /home/alex/.emacs.d/elpa/avy-act-20241226.2351/avy-act hides /home/alex/.emacs.d/site-lisp/avy-act/avy-act /home/alex/.emacs.d/elpa/Icicles-20241217.3924/hexrgb hides /home/alex/.emacs.d/site-lisp/doremi/hexrgb /home/alex/.emacs.d/elpa/Icicles-20241217.3924/doremi hides /home/alex/.emacs.d/site-lisp/doremi/doremi /home/alex/.emacs.d/elpa/Icicles-20241217.3924/icicles-fn hides /home/alex/.emacs.d/site-lisp/icicles/icicles-fn /home/alex/.emacs.d/elpa/Icicles-20241217.3924/vline hides /home/alex/.emacs.d/site-lisp/icicles/vline /home/alex/.emacs.d/elpa/Icicles-20241217.3924/thingatpt+ hides /home/alex/.emacs.d/site-lisp/icicles/thingatpt+ /home/alex/.emacs.d/elpa/Icicles-20241217.3924/synonyms hides /home/alex/.emacs.d/site-lisp/icicles/synonyms /home/alex/.emacs.d/elpa/Icicles-20241217.3924/pp+ hides /home/alex/.emacs.d/site-lisp/icicles/pp+ /home/alex/.emacs.d/site-lisp/palette hides /home/alex/.emacs.d/site-lisp/icicles/palette /home/alex/.emacs.d/elpa/Icicles-20241217.3924/lacarte hides /home/alex/.emacs.d/site-lisp/icicles/lacarte /home/alex/.emacs.d/elpa/Icicles-20241217.3924/info+ hides /home/alex/.emacs.d/site-lisp/icicles/info+ /home/alex/.emacs.d/elpa/Icicles-20241217.3924/icomplete+ hides /home/alex/.emacs.d/site-lisp/icicles/icomplete+ /home/alex/.emacs.d/elpa/Icicles-20241217.3924/icicles hides /home/alex/.emacs.d/site-lisp/icicles/icicles /home/alex/.emacs.d/elpa/Icicles-20241217.3924/icicles-var hides /home/alex/.emacs.d/site-lisp/icicles/icicles-var /home/alex/.emacs.d/elpa/Icicles-20241217.3924/icicles-opt hides /home/alex/.emacs.d/site-lisp/icicles/icicles-opt /home/alex/.emacs.d/elpa/Icicles-20241217.3924/icicles-mode hides /home/alex/.emacs.d/site-lisp/icicles/icicles-mode /home/alex/.emacs.d/elpa/Icicles-20241217.3924/icicles-mcmd hides /home/alex/.emacs.d/site-lisp/icicles/icicles-mcmd /home/alex/.emacs.d/elpa/Icicles-20241217.3924/icicles-mac hides /home/alex/.emacs.d/site-lisp/icicles/icicles-mac /home/alex/.emacs.d/elpa/Icicles-20241217.3924/icicles-face hides /home/alex/.emacs.d/site-lisp/icicles/icicles-face /home/alex/.emacs.d/elpa/Icicles-20241217.3924/icicles-doc2 hides /home/alex/.emacs.d/site-lisp/icicles/icicles-doc2 /home/alex/.emacs.d/elpa/Icicles-20241217.3924/icicles-doc1 hides /home/alex/.emacs.d/site-lisp/icicles/icicles-doc1 /home/alex/.emacs.d/elpa/Icicles-20241217.3924/icicles-cmd2 hides /home/alex/.emacs.d/site-lisp/icicles/icicles-cmd2 /home/alex/.emacs.d/elpa/Icicles-20241217.3924/icicles-cmd1 hides /home/alex/.emacs.d/site-lisp/icicles/icicles-cmd1 /home/alex/.emacs.d/elpa/Icicles-20241217.3924/icicles-chg hides /home/alex/.emacs.d/site-lisp/icicles/icicles-chg /home/alex/.emacs.d/elpa/Icicles-20241217.3924/hl-line+ hides /home/alex/.emacs.d/site-lisp/icicles/hl-line+ /home/alex/.emacs.d/elpa/Icicles-20241217.3924/hexrgb hides /home/alex/.emacs.d/site-lisp/icicles/hexrgb /home/alex/.emacs.d/elpa/Icicles-20241217.3924/fuzzy-match hides /home/alex/.emacs.d/site-lisp/icicles/fuzzy-match /home/alex/.emacs.d/elpa/Icicles-20241217.3924/doremi hides /home/alex/.emacs.d/site-lisp/icicles/doremi /home/alex/.emacs.d/site-lisp/doremi/doremi-frm hides /home/alex/.emacs.d/site-lisp/icicles/doremi-frm /home/alex/.emacs.d/site-lisp/dired+ hides /home/alex/.emacs.d/site-lisp/icicles/dired+ /home/alex/.emacs.d/elpa/Icicles-20241217.3924/crosshairs hides /home/alex/.emacs.d/site-lisp/icicles/crosshairs /home/alex/.emacs.d/elpa/Icicles-20241217.3924/col-highlight hides /home/alex/.emacs.d/site-lisp/icicles/col-highlight /home/alex/.emacs.d/elpa/Icicles-20241217.3924/bookmark+ hides /home/alex/.emacs.d/site-lisp/icicles/bookmark+ /home/alex/.emacs.d/elpa/Icicles-20241217.3924/apropos-fn+var hides /home/alex/.emacs.d/site-lisp/icicles/apropos-fn+var /home/alex/.emacs.d/site-lisp/d-emacs/d-emacs hides /home/alex/.emacs.d/site-lisp/Daselt/d-emacs/d-emacs /home/alex/.emacs.d/site-lisp/d-emacs/d-emacs-pkg hides /home/alex/.emacs.d/site-lisp/Daselt/d-emacs/d-emacs-pkg /home/alex/.emacs.d/site-lisp/d-emacs/killermacro hides /home/alex/.emacs.d/site-lisp/d-emacs/d-emacs-dirs/killermacro /home/alex/.emacs.d/site-lisp/add-tex-envs hides /home/alex/.emacs.d/site-lisp/DEmacs.old/DEmacs/DEmacs-basic/add-tex-envs /home/alex/.emacs.d/site-lisp/d-emacs/old/d-macroexpansions hides /home/alex/.emacs.d/site-lisp/Daselt/d-emacs/pkg-configs/d-macroexpansions /home/alex/.emacs.d/site-lisp/d-emacs/old/d-commands hides /home/alex/.emacs.d/site-lisp/Daselt/d-emacs/pkg-configs/d-commands /home/alex/.emacs.d/site-lisp/d-emacs/old/d-functions hides /home/alex/.emacs.d/site-lisp/Daselt/d-emacs/pkg-configs/d-functions /home/alex/.emacs.d/site-lisp/d-emacs/old/d-modes hides /home/alex/.emacs.d/site-lisp/Daselt/d-emacs/pkg-configs/d-modes /home/alex/.emacs.d/site-lisp/d-emacs/old/d-tutorial hides /home/alex/.emacs.d/site-lisp/Daselt/d-emacs/pkg-configs/d-tutorial /home/alex/.emacs.d/site-lisp/d-emacs/old/d-constants hides /home/alex/.emacs.d/site-lisp/Daselt/d-emacs/pkg-configs/d-constants /home/alex/.emacs.d/site-lisp/d-emacs/old/d-customs hides /home/alex/.emacs.d/site-lisp/Daselt/d-emacs/pkg-configs/d-customs /home/alex/.emacs.d/site-lisp/Daselt/d-lua/d-lua hides /home/alex/.emacs.d/site-lisp/Daselt/d-lua/auto/d-lua /home/alex/.emacs.d/site-lisp/Daselt/auto/DLua hides /home/alex/.emacs.d/site-lisp/Daselt/d-lua/auto/DLua /home/alex/.emacs.d/site-lisp/d-emacs/d-emacs-stump/d-emacs-stump hides /home/alex/.emacs.d/site-lisp/d-emacs/d-emacs-stump/test/d-emacs-stump /home/alex/.emacs.d/site-lisp/d-emacs/d-dfk/d-dfk-customs hides /home/alex/.emacs.d/site-lisp/Daselt/d-emacs/pkg-configs/d-dfk/d-dfk-customs /home/alex/.emacs.d/site-lisp/d-emacs/old/d-emacs-special-example-user-defined-bindlists hides /home/alex/.emacs.d/site-lisp/Daselt/d-emacs/pkg-configs/d-emacs/d-emacs-special-example-user-defined-bindlists /home/alex/.emacs.d/site-lisp/d-emacs/old/d-emacs-eval-maps hides /home/alex/.emacs.d/site-lisp/Daselt/d-emacs/pkg-configs/d-emacs/d-emacs-eval-maps /home/alex/.emacs.d/site-lisp/d-emacs/old/d-emacs-commands hides /home/alex/.emacs.d/site-lisp/Daselt/d-emacs/pkg-configs/d-emacs/d-emacs-commands /home/alex/.emacs.d/site-lisp/d-emacs/old/d-emacs-functions hides /home/alex/.emacs.d/site-lisp/Daselt/d-emacs/pkg-configs/d-emacs/d-emacs-functions /home/alex/.emacs.d/site-lisp/d-emacs/old/d-emacs-customs hides /home/alex/.emacs.d/site-lisp/Daselt/d-emacs/pkg-configs/d-emacs/d-emacs-customs /home/alex/.emacs.d/site-lisp/d-emacs/old/d-emacs-constants hides /home/alex/.emacs.d/site-lisp/Daselt/d-emacs/pkg-configs/d-emacs/d-emacs-constants /home/alex/.emacs.d/site-lisp/d-emacs/d-lua/d-lua-eval-commands hides /home/alex/.emacs.d/site-lisp/Daselt/d-emacs/pkg-configs/d-lua/d-lua-eval-commands /home/alex/.emacs.d/site-lisp/d-emacs/d-lua/d-lua-eval hides /home/alex/.emacs.d/site-lisp/Daselt/d-emacs/pkg-configs/d-lua/d-lua-eval /home/alex/.emacs.d/site-lisp/d-emacs/d-lua/d-lua-functions hides /home/alex/.emacs.d/site-lisp/Daselt/d-emacs/pkg-configs/d-lua/d-lua-functions /home/alex/.emacs.d/site-lisp/d-emacs/d-lua/d-lua-customs hides /home/alex/.emacs.d/site-lisp/Daselt/d-emacs/pkg-configs/d-lua/d-lua-customs /home/alex/.emacs.d/site-lisp/d-emacs/d-lua/d-lua-constants hides /home/alex/.emacs.d/site-lisp/Daselt/d-emacs/pkg-configs/d-lua/d-lua-constants /home/alex/.emacs.d/site-lisp/d-emacs/d-emacs-stump/d-stump-functions hides /home/alex/.emacs.d/site-lisp/Daselt/d-emacs/pkg-configs/d-stump/d-stump-functions /home/alex/.emacs.d/site-lisp/d-emacs/d-emacs-stump/d-stump-customs hides /home/alex/.emacs.d/site-lisp/Daselt/d-emacs/pkg-configs/d-stump/d-stump-customs /home/alex/.emacs.d/site-lisp/d-emacs/d-emacs-stump/d-stump-constants hides /home/alex/.emacs.d/site-lisp/Daselt/d-emacs/pkg-configs/d-stump/d-stump-constants /home/alex/.emacs.d/site-lisp/d-emacs/d-tri/d-tri-functions hides /home/alex/.emacs.d/site-lisp/Daselt/d-emacs/pkg-configs/d-tri/d-tri-functions /home/alex/.emacs.d/site-lisp/d-emacs/d-tri/d-tri-customs hides /home/alex/.emacs.d/site-lisp/Daselt/d-emacs/pkg-configs/d-tri/d-tri-customs Features: (shadow mail-extr gnus-msg emacsbug d-emacs-icicles icicles two-column icicles-mode dired+ mb-depth+ mb-depth icicles-cmd2 icicles-cmd1 icicles-mcmd icicles-fn icicles-var apropos-fn+var apropos icicles-opt ffap- fuzzy-match icicles-face cus-start display-line-numbers gdb-mi gud misearch multi-isearch image-file image-converter image-dired-dired image-dired image-dired-tags image-dired-external image-dired-util mixed-pitch corfu-quick dabbrev cape-char vertico-directory isearch+ isearch-prop menu-bar+ bookmark+ bookmark+-key bookmark+-bmu info+ fit-frame help-fns+ wid-edit+ bookmark+-lit pp+ dired-x bookmark+-1 smtpmail gnus-registry registry gnus-art mm-uu mml2015 mm-view mml-smime smime gnutls dig gnus-sum gnus-group gnus-undo gnus-start gnus-dbus gnus-cloud nnimap nnmail mail-source nnoo gnus-spec gnus-win gnus-int gnus-range imap rfc2104 utf7 d-emacs-org d-emacs-eww d-emacs-gnus d-emacs-vterm d-emacs-emacs d-emacs-corfu d-emacs-doremi d-emacs-cdlatex d-emacs-pdf-tools vc-git vc-dispatcher recentf tree-widget edit-server epa-file goto-addr autoinsert completion elec-pair corfu-history delsel undo-tree desktop frameset d-emacs d-emacs-mode d-emacs-stump d-emacs-dirs d-emacs-bind d-emacs-dfk d-emacs-xkb smartparens-c cc-mode-expansions cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs d-emacs-coords d-emacs-base avy-act eww vtable mule-util shr pixel-fill kinsoku mm-url gnus nnheader range emms-idapi-browser emms-idapi emms-idapi-musicbrainz emms-mpris emms-librefm-stream emms-librefm-scrobbler emms-playlist-limit emms-i18n emms-history emms-score emms-stream-info emms-metaplaylist-mode emms-bookmarks emms-cue emms-mode-line-icon emms-browser sort emms-volume emms-volume-sndioctl emms-volume-mixerctl emms-volume-pulse emms-volume-amixer emms-playlist-sort emms-last-played emms-player-xine emms-lyrics emms-streams emms-show-all emms-tag-editor emms-tag-tracktag emms-mark emms-mode-line emms-info-native emms-info-native-spc emms-info-native-mp3 emms-info-native-ogg emms-info-native-opus emms-info-native-flac emms-info-native-vorbis bindat emms-info-exiftool emms-info-tinytag emms-info-metaflac emms-info-opusinfo emms-info-ogginfo emms-info-mp3info emms-player-vlc emms-player-mpv emms-playing-time emms-player-mplayer emms-setup emms-player-mpd emms-url emms-cache emms-info emms-later-do emms-playlist-mode emms-source-playlist emms-source-file locate emms-player-simple emms emms-compat empv back-button nav-flash smartrep rainbow-blocks org-rainbow-tags dired-rainbow dired-hacks-utils dired-aux rainbow-delimiters rainbow-mode modus-themes abyss-theme yaml-mode-expansions yaml-mode julia-snail spinner pulse popup eldoc-box flycheck ox-md org-modern math-delimiters add-tex-envs cdlatex reftex reftex-loaddefs reftex-vars latex-extra preview smartparens-latex latex-mode-expansions latex latex-flymake flymake tex-ispell tex-style tex dbus texmathp auctex mentor url-scgi mentor-rpc mentor-files mentor-data xml-rpc fancy-compilation eshell-vterm em-term esh-ext esh-proc esh-opt esh-io esh-arg esh-module esh-module-loaddefs esh-util vterm tramp trampver tramp-integration files-x tramp-message tramp-compat tramp-loaddefs face-remap term disp-table ehelp vterm-module term/xterm xterm unicode-fonts font-utils dynamic-fonts ztree ztree-diff ztree-diff-model ztree-dir ztree-view ztree-protocol ztree-util yasnippet elgrep async grep dedicated auto-dictionary flyspell ispell all-the-icons-completion all-the-icons-dired all-the-icons all-the-icons-faces data-material data-weathericons data-octicons data-fileicons data-faicons data-alltheicons go-translate gt-text-utility gt-engine-echo gt-engine-libre gt-engine-chatgpt gt-engine-youdao gt-engine-stardict gt-engine-deepl gt-engine-google-rpc gt-engine-google gt-engine-bing gt-extension gt-faces gt-core plz gt-httpx gptel-extensions gptel gptel-org gptel-openai tabgo tab-line dired-quick-sort ls-lisp aggressive-indent visible-mark org-noter-org-roam org-noter org-noter-djvu org-noter-nov org-noter-pdf pdf-tools pdf-view jka-compr pdf-cache pdf-info tq pdf-util pdf-macs image-mode exif org-noter-core ekg-import-subdirectories triples org-roam-export use-package-ensure-system-package system-packages consult-org-roam consult-org-roam-buffer org-ref org-ref-core openalex request org-ref-glossary org-ref-bibtex smartparens-html html-mode-expansions sgml-mode facemenu avy doi-utils url-http url-auth url-gw nsm org-ref-utils org-ref-export citeproc citeproc-itemgetters citeproc-cite citeproc-biblatex citeproc-bibtex ol-bibtex parse-time citeproc-subbibs citeproc-sort citeproc-name citeproc-formatters citeproc-proc citeproc-disamb citeproc-itemdata citeproc-generic-elements citeproc-macro citeproc-choose citeproc-date citeproc-number smartparens-rst smartparens-markdown rst compile citeproc-context citeproc-prange citeproc-style citeproc-locale citeproc-term citeproc-rt citeproc-lib citeproc-s queue ox-pandoc ht ox-org ox-odt rng-loc rng-uri rng-parse rng-match rng-dt rng-util rng-pttrn nxml-parse nxml-ns nxml-enc xmltok nxml-util ox-latex ox-icalendar ox-html table ox-ascii ox-publish ox org-ref-misc-links org-ref-label-link org-ref-ref-links org-ref-citation-links xref project org-ref-bibliography-links hydra lv bibtex-completion parsebib org-roam-migrate org-roam-log org-roam-mode org-roam-capture org-roam-id org-roam-node org-roam-db emacsql-sqlite-builtin sqlite org-roam-utils org-roam-compat org-roam org-capture emacsql-sqlite emacsql emacsql-compiler org-brain picture org-agenda org-attach embark-org smartparens-org the-org-mode-expansions org-element org-persist org-id org-refile org-element-ast inline 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 foldout noutline outline ob-emacs-lisp ob-core ob-eval org-cycle org-table org-keys oc org-loaddefs cal-menu calendar cal-loaddefs ol org-fold org-fold-core org-compat avl-tree generator org-version org-macs biblio biblio-download biblio-dissemin biblio-ieee biblio-hal biblio-dblp biblio-crossref biblio-arxiv timezone biblio-doi biblio-core let-alist url-queue url-file ido bibtex iso8601 cape pass f s password-store auth-source-pass kind-icon svg-lib svg dom xml corfu-prescient vertico-prescient prescient char-fold windsize corfu-terminal popon corfu consult-gh consult-gh-autoloads compat-autoloads seq-autoloads embark-consult consult magit-bookmark bookmark embark marginalia orderless 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 which-func imenu magit-diff smerge-mode diff diff-mode track-changes git-commit log-edit message sendmail yank-media puny rfc822 mml mml-sec epa epg rfc6068 epg-config gnus-util text-property-search time-date mailabbrev mail-utils gmm-utils mailheader pcvs-util add-log magit-core magit-autorevert autorevert filenotify magit-margin magit-transient magit-process with-editor shell pcomplete comint ansi-osc server ansi-color magit-mode transient benchmark magit-git magit-base magit-section format-spec cursor-sensor crm persistent-soft list-utils pcache eieio-base savehist vertico-buffer vertico-mouse vertico compat smartparens-config smartparens-text smartparens loadhist dash expand-region text-mode-expansions er-basic-expansions expand-region-core expand-region-custom easy-kill-extras easy-kill-line-edge easy-kill-buffer easy-kill-to-char easy-kill smart-mark buffer-move windmove anchored-transpose second-sel doremi-frm frame-cmds palette eyedropper crosshairs col-highlight vline hl-line+ hl-line advice misc-cmds rect faces+ thingatpt+ frame-fns avoid hexrgb doremi-cmd cus-theme cus-edit pp wid-edit doremi info-colors winner ring curry-compose rebinder gnus-dired finder-inf dired-du find-dired edmacro auto-install cl ffap thingatpt dired dired-loaddefs straight-autoloads straight quelpa-use-package quelpa mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr lisp-mnt help-fns radix-tree comp comp-cstr cl-extra warnings comp-run comp-common kmacro functions rx use-package use-package-ensure use-package-delight use-package-diminish use-package-bind-key bind-key easy-mmode use-package-core edebug debug backtrace help-mode find-func sanityinc-tomorrow-bright-theme color-theme-sanityinc-tomorrow color allout cus-load Icicles-autoloads abyss-theme-autoloads aggressive-indent-autoloads all-the-icons-completion-autoloads all-the-icons-dired-autoloads auctex-cluttex-autoloads auto-dictionary-autoloads avy-act-autoloads back-button-autoloads backup-walker-autoloads buffer-move-autoloads cape-autoloads cdlatex-autoloads citar-embark-autoloads citar-autoloads color-theme-sanityinc-tomorrow-autoloads consult-flycheck-autoloads consult-lsp-autoloads consult-org-roam-autoloads corfu-prescient-autoloads corfu-terminal-autoloads corfu-autoloads dedicated-autoloads default-text-scale-autoloads diminish-autoloads dired-quick-sort-autoloads dired-rainbow-autoloads dired-hacks-utils-autoloads doremi-autoloads dynamic-fonts-autoloads easy-kill-extras-autoloads eldoc-box-autoloads elgrep-autoloads embark-consult-autoloads consult-autoloads embark-autoloads emms-autoloads empv-autoloads eshell-vterm-autoloads expand-region-autoloads fancy-compilation-autoloads flycheck-package-autoloads flycheck-autoloads forge-autoloads closql-autoloads ghub-autoloads gnuplot-autoloads go-translate-autoloads gptel-autoloads julia-snail-autoloads kind-icon-autoloads latex-extra-autoloads auctex-autoloads tex-site latex-pretty-symbols-autoloads lsp-julia-autoloads julia-mode-autoloads lsp-ui-autoloads lsp-mode-autoloads marginalia-autoloads mentor-autoloads mixed-pitch-autoloads modus-themes-autoloads mood-line-autoloads nav-flash-autoloads orderless-autoloads org-brain-autoloads org-modern-autoloads org-noter-autoloads helm-autoloads helm-core-autoloads async-autoloads org-rainbow-tags-autoloads org-ref-prettify-autoloads org-ref-autoloads citeproc-autoloads htmlize-autoloads org-roam-bibtex-autoloads bibtex-completion-autoloads biblio-autoloads biblio-core-autoloads org-roam-autoloads emacsql-autoloads ox-pandoc-autoloads package-build-autoloads derived package-lint-autoloads paredit-autoloads parsebib-autoloads pass-autoloads f-autoloads password-store-otp-autoloads password-store-autoloads perspective-autoloads plz-autoloads popon-autoloads popup-autoloads quelpa-autoloads rainbow-blocks-autoloads rainbow-mode-autoloads smart-mark-autoloads smartparens-autoloads smartrep-autoloads smudge-autoloads oauth2-autoloads speed-type-autoloads spinner-autoloads sqlite3-autoloads string-inflection-autoloads svg-lib-autoloads swiper-autoloads ivy-autoloads sx-autoloads markdown-mode-autoloads tabgo-autoloads tablist-autoloads telega-autoloads treemacs-all-the-icons-autoloads all-the-icons-autoloads treemacs-icons-dired-autoloads treemacs-magit-autoloads magit-autoloads pcase transient-autoloads magit-section-autoloads treemacs-persp-autoloads persp-mode-autoloads treemacs-projectile-autoloads projectile-autoloads treemacs-tab-bar-autoloads treemacs-autoloads posframe-autoloads avy-autoloads treepy-autoloads triples-autoloads try-autoloads unicode-fonts-autoloads ucs-utils-autoloads font-utils-autoloads persistent-soft-autoloads list-utils-autoloads pcache-autoloads url-scgi-autoloads use-package-ensure-system-package-autoloads system-packages-autoloads vertico-prescient-autoloads vertico-autoloads prescient-autoloads visible-mark-autoloads visual-fill-column-autoloads vterm-autoloads wfnames-autoloads windresize-autoloads windsize-autoloads with-editor-autoloads xml-rpc-autoloads yaml-autoloads yaml-mode-autoloads yasnippet-autoloads zotero-autoloads oauth-autoloads info dash-autoloads ztree-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 dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo gtk x-toolkit xinput2 x multi-tty move-toolbar make-network-process tty-child-frames native-compile emacs) Memory information: ((conses 16 1934237 2454408) (symbols 48 115220 13) (strings 32 483653 150979) (string-bytes 1 14288706) (vectors 16 154921) (vector-slots 8 2655804 546103) (floats 8 2409 9168) (intervals 56 34847 21741) (buffers 992 42))
[killermacro.el (text/plain, attachment)]
[gdb.txt (text/plain, attachment)]
bug-gnu-emacs <at> gnu.org
:bug#75593
; Package emacs
.
(Wed, 15 Jan 2025 20:22:02 GMT) Full text and rfc822 format available.Message #8 received at 75593 <at> debbugs.gnu.org (full text, mbox):
From: Eli Zaretskii <eliz <at> gnu.org> To: Alexander Prähauser <ahprae <at> protonmail.com> Cc: 75593 <at> debbugs.gnu.org Subject: Re: bug#75593: 31.0.50; Faulty macro kills Emacs Date: Wed, 15 Jan 2025 22:21:40 +0200
> Date: Wed, 15 Jan 2025 19:00:01 +0000 > From: Alexander Prähauser via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org> > > A macro I've defined in causes Emacs to crash. The macro is faulty but I > still don't think it should do that. I've attached a file with a > functioning version of the macro, the version that crashes with comments > where it is changed and where it crashes and a configuration that causes > it to crash. Careful, evaluating that buffer will kill Emacs. I've run > `emacs -Q' in gdb and added a logging file. The output of `bt-full' is Could you please show a full recipe for reproducing this? After starting "emacs -Q", what should I type, step by step, to trigger the crash? Thanks.
bug-gnu-emacs <at> gnu.org
:bug#75593
; Package emacs
.
(Wed, 15 Jan 2025 21:39:02 GMT) Full text and rfc822 format available.Message #11 received at 75593 <at> debbugs.gnu.org (full text, mbox):
From: Alexander Prähauser <ahprae <at> protonmail.com> To: Eli Zaretskii <eliz <at> gnu.org> Cc: 75593 <at> debbugs.gnu.org Subject: Re: bug#75593: 31.0.50; Faulty macro kills Emacs Date: Wed, 15 Jan 2025 21:38:18 +0000
"Eli Zaretskii" <eliz <at> gnu.org> writes: emacs -Q killermacro.el (or wherever you saved the file) M-x eval-buffer That should do it. >> Date: Wed, 15 Jan 2025 19:00:01 +0000 >> From: Alexander Prähauser via "Bug reports for GNU Emacs, >> the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org> >> >> A macro I've defined in causes Emacs to crash. The macro is faulty but I >> still don't think it should do that. I've attached a file with a >> functioning version of the macro, the version that crashes with comments >> where it is changed and where it crashes and a configuration that causes >> it to crash. Careful, evaluating that buffer will kill Emacs. I've run >> `emacs -Q' in gdb and added a logging file. The output of `bt-full' is > > Could you please show a full recipe for reproducing this? After > starting "emacs -Q", what should I type, step by step, to trigger the > crash? > > Thanks.
bug-gnu-emacs <at> gnu.org
:bug#75593
; Package emacs
.
(Wed, 15 Jan 2025 22:21:01 GMT) Full text and rfc822 format available.Message #14 received at submit <at> debbugs.gnu.org (full text, mbox):
From: Pip Cet <pipcet <at> protonmail.com> To: Alexander Prähauser via Bug reports for GNU Emacs, the Swiss army knife of text editors <bug-gnu-emacs <at> gnu.org>, Stefan Monnier <monnier <at> iro.umontreal.ca>, Mattias Engdegård <mattiase <at> acm.org> Cc: Alexander Prähauser <ahprae <at> protonmail.com>, Eli Zaretskii <eliz <at> gnu.org>, 75593 <at> debbugs.gnu.org Subject: Re: bug#75593: 31.0.50; Faulty macro kills Emacs Date: Wed, 15 Jan 2025 22:20:42 +0000
Alexander Prähauser via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org> writes: > "Eli Zaretskii" <eliz <at> gnu.org> writes: > > emacs -Q killermacro.el (or wherever you saved the file) > M-x eval-buffer > > That should do it. Reproducible here: the problem is that Feval does not verify its LEXICAL argument is a valid lexical environment. In your case, it's a non-list cons cell. Two ways to fix this: 1. Call Flength on the lexical environment. This will throw an error if the environment is invalid, including when it is circular, which might otherwise result in unquittable infloops (this is currently subject of bug#75520). However, this may slow down a very critical piece of code (OTOH, it can also conceivably speed it up, by ensuring that the lexical environment is in a high-priority cache). 2. Revise all code which assumes Vinternal_interpreter_environment isn't too bad. In particular, this code: for (Lisp_Object p = Vinternal_interpreter_environment; !NILP (p); p = XCDR(p)) { Lisp_Object e = XCAR (p); if (SYMBOLP (e)) dynvars = Fcons(e, dynvars); } should be Lisp_Object p = Vinternal_interpreter_environment; FOR_EACH_TAIL (p) { Lisp_Object e = XCAR (p); if (SYMBOLP (e)) dynvars = Fcons(e, dynvars); } (As virtually all places which used !NILP instead of CONSP were fixed a while ago, my cocci script did not catch this case.) We'll probably have to do both. Here's (1): commit 651362816bd5237b0f5aaea70d72a29aa9b8852e (HEAD) Author: Pip Cet <pipcet <at> protonmail.com> Date: Wed Jan 15 22:17:43 2025 +0000 Ensure Vinternal_interpreter_environment isn't malformed (bug#75593) * src/eval.c (Feval): Call 'Flength' on the lexical environment, ensuring it is a list. diff --git a/src/eval.c b/src/eval.c index 941d121c2fb..2619bd57415 100644 --- a/src/eval.c +++ b/src/eval.c @@ -2446,8 +2446,11 @@ DEFUN ("eval", Feval, Seval, 1, 2, 0, (Lisp_Object form, Lisp_Object lexical) { specpdl_ref count = SPECPDL_INDEX (); - specbind (Qinternal_interpreter_environment, - CONSP (lexical) || NILP (lexical) ? lexical : list_of_t); + if (CONSP (lexical) || NILP (lexical)) + Flength (lexical); + else + lexical = list_of_t; + specbind (Qinternal_interpreter_environment, lexical); return unbind_to (count, eval_sub (form)); }
bug-gnu-emacs <at> gnu.org
:bug#75593
; Package emacs
.
(Wed, 15 Jan 2025 22:21:02 GMT) Full text and rfc822 format available.bug-gnu-emacs <at> gnu.org
:bug#75593
; Package emacs
.
(Thu, 16 Jan 2025 06:51:01 GMT) Full text and rfc822 format available.Message #20 received at 75593 <at> debbugs.gnu.org (full text, mbox):
From: Eli Zaretskii <eliz <at> gnu.org> To: Pip Cet <pipcet <at> protonmail.com> Cc: ahprae <at> protonmail.com, mattiase <at> acm.org, monnier <at> iro.umontreal.ca, 75593 <at> debbugs.gnu.org Subject: Re: bug#75593: 31.0.50; Faulty macro kills Emacs Date: Thu, 16 Jan 2025 08:50:37 +0200
> Date: Wed, 15 Jan 2025 22:20:42 +0000 > From: Pip Cet <pipcet <at> protonmail.com> > Cc: Eli Zaretskii <eliz <at> gnu.org>, Alexander Prähauser <ahprae <at> protonmail.com>, 75593 <at> debbugs.gnu.org > > --- a/src/eval.c > +++ b/src/eval.c > @@ -2446,8 +2446,11 @@ DEFUN ("eval", Feval, Seval, 1, 2, 0, > (Lisp_Object form, Lisp_Object lexical) > { > specpdl_ref count = SPECPDL_INDEX (); > - specbind (Qinternal_interpreter_environment, > - CONSP (lexical) || NILP (lexical) ? lexical : list_of_t); > + if (CONSP (lexical) || NILP (lexical)) > + Flength (lexical); > + else > + lexical = list_of_t; > + specbind (Qinternal_interpreter_environment, lexical); > return unbind_to (count, eval_sub (form)); > } Isn't there a cheaper way of verifying LEXICAL is a list, not a cons cell? How about calling Flength only "#ifdef ENABLE_CHECKING", and otherwise just verifying that LEXICAL is a list? After all, passing a circular list to this function means some Lisp program shoots itself in the foot, so we could tell "don't do that", like in other cases when Emacs gives Lisp programmers enough rope to hang themselves. IOW, can we prevent crashes in a way that is cheap in production builds, since 'eval' is quite a hotspot?
bug-gnu-emacs <at> gnu.org
:bug#75593
; Package emacs
.
(Thu, 16 Jan 2025 10:39:01 GMT) Full text and rfc822 format available.Message #23 received at 75593 <at> debbugs.gnu.org (full text, mbox):
From: Pip Cet <pipcet <at> protonmail.com> To: Eli Zaretskii <eliz <at> gnu.org> Cc: ahprae <at> protonmail.com, mattiase <at> acm.org, monnier <at> iro.umontreal.ca, 75593 <at> debbugs.gnu.org Subject: Re: bug#75593: 31.0.50; Faulty macro kills Emacs Date: Thu, 16 Jan 2025 10:38:21 +0000
"Eli Zaretskii" <eliz <at> gnu.org> writes: >> Date: Wed, 15 Jan 2025 22:20:42 +0000 >> From: Pip Cet <pipcet <at> protonmail.com> >> Cc: Eli Zaretskii <eliz <at> gnu.org>, Alexander Prähauser <ahprae <at> protonmail.com>, 75593 <at> debbugs.gnu.org >> >> --- a/src/eval.c >> +++ b/src/eval.c >> @@ -2446,8 +2446,11 @@ DEFUN ("eval", Feval, Seval, 1, 2, 0, >> (Lisp_Object form, Lisp_Object lexical) >> { >> specpdl_ref count = SPECPDL_INDEX (); >> - specbind (Qinternal_interpreter_environment, >> - CONSP (lexical) || NILP (lexical) ? lexical : list_of_t); >> + if (CONSP (lexical) || NILP (lexical)) >> + Flength (lexical); >> + else >> + lexical = list_of_t; >> + specbind (Qinternal_interpreter_environment, lexical); >> return unbind_to (count, eval_sub (form)); >> } > > Isn't there a cheaper way of verifying LEXICAL is a list, not a cons > cell? I don't think there is, no. As I explained, it's unlikely to be a significant expense: lexical environments are not very large, usually, and all other users of Vinternal_interpreter_environment are optimized for small lists which are scanned until we find the right entry. If we wanted to optimize for large lexical environments, we might be able to, but we've decided not to do that. > How about calling Flength only "#ifdef ENABLE_CHECKING", and otherwise > just verifying that LEXICAL is a list? ENABLE_CHECKING shouldn't affect code behavior in such ways, no. I don't think a crash is acceptable here, but if people end up disabling ENABLE_CHECKING and using XCAR on a non-cons, a crash is the *best* possible outcome: more likely, we'd just be creating nonsensical Lisp_Objects which may cause memory corruption. Making behavior depend on ENABLE_CHECKING in such ways will cause bugs in !ENABLE_CHECKING builds that cannot be debugged because the corresponding ENABLE_CHECKING build will never reach the problematic code. IOW, it'd defeat the purpose of ENABLE_CHECKING. > After all, passing a circular > list to this function means some Lisp program shoots itself in the > foot, so we could tell "don't do that", like in other cases when Emacs > gives Lisp programmers enough rope to hang themselves. Flength does precisely that. If you think a crash, unquittable infloop, or memory corruption is the right way to tell people "don't do that", I disagree completely. It's not what the rest of Emacs does, it's not the right thing to do, and a performance concern that is entirely hypothetical at this point is not a good reason to start doing it. (Also, this is not primarily about circular lists, it's about non-lists in general). > IOW, can we prevent crashes in a way that is cheap in production > builds, since 'eval' is quite a hotspot? If there's any evidence that lexenvs are large enough that scanning them linearly in this one place is a significant expense, we might want to rewrite the entire lexenv code: all of it is O(N) in the size of the environment: it assumes lexenvs are small enough to scan linearly, and so does the fixed Feval. (I think it would be possible to allow a hash table as the non-list final CDR of Feval's lexenv argument, but we'd still end up overriding bindings with an alist, so it'd be a bit of a Frankenstein affair). Pip
bug-gnu-emacs <at> gnu.org
:bug#75593
; Package emacs
.
(Thu, 16 Jan 2025 11:37:02 GMT) Full text and rfc822 format available.Message #26 received at 75593 <at> debbugs.gnu.org (full text, mbox):
From: Eli Zaretskii <eliz <at> gnu.org> To: Pip Cet <pipcet <at> protonmail.com> Cc: ahprae <at> protonmail.com, mattiase <at> acm.org, monnier <at> iro.umontreal.ca, 75593 <at> debbugs.gnu.org Subject: Re: bug#75593: 31.0.50; Faulty macro kills Emacs Date: Thu, 16 Jan 2025 13:36:08 +0200
> Date: Thu, 16 Jan 2025 10:38:21 +0000 > From: Pip Cet <pipcet <at> protonmail.com> > Cc: monnier <at> iro.umontreal.ca, mattiase <at> acm.org, ahprae <at> protonmail.com, 75593 <at> debbugs.gnu.org > > "Eli Zaretskii" <eliz <at> gnu.org> writes: > > >> Date: Wed, 15 Jan 2025 22:20:42 +0000 > >> From: Pip Cet <pipcet <at> protonmail.com> > >> Cc: Eli Zaretskii <eliz <at> gnu.org>, Alexander Prähauser <ahprae <at> protonmail.com>, 75593 <at> debbugs.gnu.org > >> > >> --- a/src/eval.c > >> +++ b/src/eval.c > >> @@ -2446,8 +2446,11 @@ DEFUN ("eval", Feval, Seval, 1, 2, 0, > >> (Lisp_Object form, Lisp_Object lexical) > >> { > >> specpdl_ref count = SPECPDL_INDEX (); > >> - specbind (Qinternal_interpreter_environment, > >> - CONSP (lexical) || NILP (lexical) ? lexical : list_of_t); > >> + if (CONSP (lexical) || NILP (lexical)) > >> + Flength (lexical); > >> + else > >> + lexical = list_of_t; > >> + specbind (Qinternal_interpreter_environment, lexical); > >> return unbind_to (count, eval_sub (form)); > >> } > > > > Isn't there a cheaper way of verifying LEXICAL is a list, not a cons > > cell? > > I don't think there is, no. As I explained, it's unlikely to be a > significant expense: lexical environments are not very large, usually, > and all other users of Vinternal_interpreter_environment are optimized > for small lists which are scanned until we find the right entry. If we > wanted to optimize for large lexical environments, we might be able to, > but we've decided not to do that. OK, so can you then benchmark this? E.g., by byte-compiling all the *.el files in the tree with and without the change? Or maybe there's something appropriate in the benchmark suite? Or both? > > How about calling Flength only "#ifdef ENABLE_CHECKING", and otherwise > > just verifying that LEXICAL is a list? > > ENABLE_CHECKING shouldn't affect code behavior in such ways, no. ?? It already does. We discover problems and bugs earlier all the time when running a build with --enable-checking, because it aborts before it runs into a potentially fatal problem. > I > don't think a crash is acceptable here, but if people end up disabling > ENABLE_CHECKING and using XCAR on a non-cons, a crash is the *best* > possible outcome: more likely, we'd just be creating nonsensical > Lisp_Objects which may cause memory corruption. I think the best outcome is to signal an error, not to crash, if that is feasible. > Making behavior depend on ENABLE_CHECKING in such ways will cause bugs > in !ENABLE_CHECKING builds that cannot be debugged because the > corresponding ENABLE_CHECKING build will never reach the problematic > code. I wrote that under the assumption that we could test for a proper list without calling Flength. If that is not possible/feasible, that point is moot, and IMO we should only see if the run-time price is acceptable. > (Also, this is not primarily about circular lists, it's about non-lists > in general). That should be easy to detect up front, no? I thought the issue was about a cons cell vs a proper list. > > IOW, can we prevent crashes in a way that is cheap in production > > builds, since 'eval' is quite a hotspot? > > If there's any evidence that lexenvs are large enough that scanning them > linearly in this one place is a significant expense I didn't say that; it remains to be established. Thus my suggestion above to benchmark. But if there is a less expensive way, we could take it regardless: one doesn't have to prove that a simple test is less expensive than scanning the entire list structure.
bug-gnu-emacs <at> gnu.org
:bug#75593
; Package emacs
.
(Thu, 16 Jan 2025 12:09:01 GMT) Full text and rfc822 format available.Message #29 received at 75593 <at> debbugs.gnu.org (full text, mbox):
From: Pip Cet <pipcet <at> protonmail.com> To: Eli Zaretskii <eliz <at> gnu.org> Cc: ahprae <at> protonmail.com, mattiase <at> acm.org, monnier <at> iro.umontreal.ca, 75593 <at> debbugs.gnu.org Subject: Re: bug#75593: 31.0.50; Faulty macro kills Emacs Date: Thu, 16 Jan 2025 12:08:37 +0000
"Eli Zaretskii" <eliz <at> gnu.org> writes: >> Date: Thu, 16 Jan 2025 10:38:21 +0000 >> From: Pip Cet <pipcet <at> protonmail.com> >> Cc: monnier <at> iro.umontreal.ca, mattiase <at> acm.org, ahprae <at> protonmail.com, 75593 <at> debbugs.gnu.org >> >> "Eli Zaretskii" <eliz <at> gnu.org> writes: >> >> >> Date: Wed, 15 Jan 2025 22:20:42 +0000 >> >> From: Pip Cet <pipcet <at> protonmail.com> >> >> Cc: Eli Zaretskii <eliz <at> gnu.org>, Alexander Prähauser <ahprae <at> protonmail.com>, 75593 <at> debbugs.gnu.org >> >> >> >> --- a/src/eval.c >> >> +++ b/src/eval.c >> >> @@ -2446,8 +2446,11 @@ DEFUN ("eval", Feval, Seval, 1, 2, 0, >> >> (Lisp_Object form, Lisp_Object lexical) >> >> { >> >> specpdl_ref count = SPECPDL_INDEX (); >> >> - specbind (Qinternal_interpreter_environment, >> >> - CONSP (lexical) || NILP (lexical) ? lexical : list_of_t); >> >> + if (CONSP (lexical) || NILP (lexical)) >> >> + Flength (lexical); >> >> + else >> >> + lexical = list_of_t; >> >> + specbind (Qinternal_interpreter_environment, lexical); >> >> return unbind_to (count, eval_sub (form)); >> >> } >> > >> > Isn't there a cheaper way of verifying LEXICAL is a list, not a cons >> > cell? >> >> I don't think there is, no. As I explained, it's unlikely to be a >> significant expense: lexical environments are not very large, usually, >> and all other users of Vinternal_interpreter_environment are optimized >> for small lists which are scanned until we find the right entry. If we >> wanted to optimize for large lexical environments, we might be able to, >> but we've decided not to do that. > > OK, so can you then benchmark this? E.g., by byte-compiling all the > *.el files in the tree with and without the change? Or maybe there's > something appropriate in the benchmark suite? Or both? I'll see what I can do. The patch certainly can be improved by checking NILP (lexical) first, and only calling Flength if it's a cons cell, and that appears to be the common case: building Emacs only calls Feval with a cons cell only once or twice, and in those cases, it's a single-item list. >> > How about calling Flength only "#ifdef ENABLE_CHECKING", and otherwise >> > just verifying that LEXICAL is a list? >> >> ENABLE_CHECKING shouldn't affect code behavior in such ways, no. > > ?? It already does. We discover problems and bugs earlier all the > time when running a build with --enable-checking, because it aborts > before it runs into a potentially fatal problem. Calling Flength is very different from aborting, IMHO. >> I >> don't think a crash is acceptable here, but if people end up disabling >> ENABLE_CHECKING and using XCAR on a non-cons, a crash is the *best* >> possible outcome: more likely, we'd just be creating nonsensical >> Lisp_Objects which may cause memory corruption. > > I think the best outcome is to signal an error, not to crash, if that > is feasible. Indeed. That's what Flength does. >> Making behavior depend on ENABLE_CHECKING in such ways will cause bugs >> in !ENABLE_CHECKING builds that cannot be debugged because the >> corresponding ENABLE_CHECKING build will never reach the problematic >> code. > > I wrote that under the assumption that we could test for a proper list > without calling Flength. If that is not possible/feasible, that point > is moot, and IMO we should only see if the run-time price is > acceptable. (We can use list_length, not Flength, but the difference won't be significant. Or Fproper_list_p, of course, which might make it clearer that we're not interested in the length at all.) >> (Also, this is not primarily about circular lists, it's about non-lists >> in general). > > That should be easy to detect up front, no? I thought the issue was > about a cons cell vs a proper list. Sorry, but I don't see a way of checking that we're looking at a proper list that's cheaper that list_length: we need to find the last cons cell, so we need to walk the list, and counting cells while we're doing so should not affect performance. >> > IOW, can we prevent crashes in a way that is cheap in production >> > builds, since 'eval' is quite a hotspot? >> >> If there's any evidence that lexenvs are large enough that scanning them >> linearly in this one place is a significant expense > > I didn't say that; it remains to be established. Thus my suggestion > above to benchmark. But if there is a less expensive way, we could > take it regardless: one doesn't have to prove that a simple test is > less expensive than scanning the entire list structure. I don't think there is a simple test. I may be wrong, of course. Pip
bug-gnu-emacs <at> gnu.org
:bug#75593
; Package emacs
.
(Thu, 16 Jan 2025 12:49:02 GMT) Full text and rfc822 format available.Message #32 received at 75593 <at> debbugs.gnu.org (full text, mbox):
From: Eli Zaretskii <eliz <at> gnu.org> To: Pip Cet <pipcet <at> protonmail.com> Cc: ahprae <at> protonmail.com, mattiase <at> acm.org, monnier <at> iro.umontreal.ca, 75593 <at> debbugs.gnu.org Subject: Re: bug#75593: 31.0.50; Faulty macro kills Emacs Date: Thu, 16 Jan 2025 14:47:54 +0200
> Date: Thu, 16 Jan 2025 12:08:37 +0000 > From: Pip Cet <pipcet <at> protonmail.com> > Cc: monnier <at> iro.umontreal.ca, mattiase <at> acm.org, ahprae <at> protonmail.com, 75593 <at> debbugs.gnu.org > > >> (Also, this is not primarily about circular lists, it's about non-lists > >> in general). > > > > That should be easy to detect up front, no? I thought the issue was > > about a cons cell vs a proper list. > > Sorry, but I don't see a way of checking that we're looking at a proper > list that's cheaper that list_length: we need to find the last cons > cell, so we need to walk the list, and counting cells while we're doing > so should not affect performance. No, I meant to detect objects that are not CONSP, but something else: a number, a symbol, a string, etc. I thought this was what you meant by "non-lists".
bug-gnu-emacs <at> gnu.org
:bug#75593
; Package emacs
.
(Thu, 16 Jan 2025 13:07:02 GMT) Full text and rfc822 format available.Message #35 received at 75593 <at> debbugs.gnu.org (full text, mbox):
From: Pip Cet <pipcet <at> protonmail.com> To: Eli Zaretskii <eliz <at> gnu.org> Cc: ahprae <at> protonmail.com, mattiase <at> acm.org, monnier <at> iro.umontreal.ca, 75593 <at> debbugs.gnu.org Subject: Re: bug#75593: 31.0.50; Faulty macro kills Emacs Date: Thu, 16 Jan 2025 13:06:12 +0000
"Eli Zaretskii" <eliz <at> gnu.org> writes: >> Date: Thu, 16 Jan 2025 12:08:37 +0000 >> From: Pip Cet <pipcet <at> protonmail.com> >> Cc: monnier <at> iro.umontreal.ca, mattiase <at> acm.org, ahprae <at> protonmail.com, 75593 <at> debbugs.gnu.org >> >> >> (Also, this is not primarily about circular lists, it's about non-lists >> >> in general). >> > >> > That should be easy to detect up front, no? I thought the issue was >> > about a cons cell vs a proper list. >> >> Sorry, but I don't see a way of checking that we're looking at a proper >> list that's cheaper that list_length: we need to find the last cons >> cell, so we need to walk the list, and counting cells while we're doing >> so should not affect performance. > > No, I meant to detect objects that are not CONSP, but something else: > a number, a symbol, a string, etc. I thought this was what you meant > by "non-lists". Oh, my apologies. I said "non-list" when what I meant was an "improper list", in Emacs jargon. Dotted "lists" caused the crash for the OP; circular "lists" cause infloops, but no crashes. The code already treats !CONSP !NILP objects specially (only Qt as a value is documented, the rest are silently treated like Qt is). Pip
bug-gnu-emacs <at> gnu.org
:bug#75593
; Package emacs
.
(Thu, 16 Jan 2025 18:18:01 GMT) Full text and rfc822 format available.Message #38 received at 75593 <at> debbugs.gnu.org (full text, mbox):
From: Stefan Monnier <monnier <at> iro.umontreal.ca> To: Eli Zaretskii <eliz <at> gnu.org> Cc: ahprae <at> protonmail.com, mattiase <at> acm.org, Pip Cet <pipcet <at> protonmail.com>, 75593 <at> debbugs.gnu.org Subject: Re: bug#75593: 31.0.50; Faulty macro kills Emacs Date: Thu, 16 Jan 2025 13:17:17 -0500
> IOW, can we prevent crashes in a way that is cheap in production > builds, since 'eval' is quite a hotspot? I would actually be surprised if `Feval` is a hotspot. AFAIK `eval_sub` is sometimes a hotspot (tho only when running non-compiled code, which *should* be somewhat infrequent), but I don't think `Feval` is. Stefan
bug-gnu-emacs <at> gnu.org
:bug#75593
; Package emacs
.
(Thu, 16 Jan 2025 18:42:02 GMT) Full text and rfc822 format available.Message #41 received at 75593 <at> debbugs.gnu.org (full text, mbox):
From: Stefan Monnier <monnier <at> iro.umontreal.ca> To: Pip Cet <pipcet <at> protonmail.com> Cc: ahprae <at> protonmail.com, mattiase <at> acm.org, Eli Zaretskii <eliz <at> gnu.org>, 75593 <at> debbugs.gnu.org Subject: Re: bug#75593: 31.0.50; Faulty macro kills Emacs Date: Thu, 16 Jan 2025 13:41:35 -0500
> If we wanted to optimize for large lexical environments, we might be > able to, but we've decided not to do that. Indeed. The lack of optimization is for two reasons: - As you say, we expect lexical envs to be small. - We also expect that performance of interpreted code is not very significant. > If there's any evidence that lexenvs are large enough that scanning them > linearly in this one place is a significant expense, we might want to > rewrite the entire lexenv code: all of it is O(N) in the size of the > environment: it assumes lexenvs are small enough to scan linearly, and > so does the fixed Feval. I suggest to simply compare the time to bootstrap with and without the `Flength` call. This way we can base our decision on actual data rather than just our intuition. > (I think it would be possible to allow a hash table as the non-list > final CDR of Feval's lexenv argument, but we'd still end up overriding > bindings with an alist, so it'd be a bit of a Frankenstein affair). Also, since lexenvs are mostly modified by extending them (without affecting the base env since it might have been captured by a closure) and then later reverting to the unextended base, hash-tables tend to work rather poorly. More common choices to handle large lexical environments are balanced binary trees. Other options generally require first replacing the var names with something else, like small integers (e.g. DeBruijn indices), but that requires a kind of preprocessing which we'd usually call "compilation" (tho it can be simpler than what `bytecomp.el` does). Stefan "who likes «Myers stacks»: like singly-linked lists but with O(log N) time for `nthcdr`"
bug-gnu-emacs <at> gnu.org
:bug#75593
; Package emacs
.
(Thu, 16 Jan 2025 19:24:01 GMT) Full text and rfc822 format available.Message #44 received at 75593 <at> debbugs.gnu.org (full text, mbox):
From: Eli Zaretskii <eliz <at> gnu.org> To: Stefan Monnier <monnier <at> iro.umontreal.ca> Cc: ahprae <at> protonmail.com, mattiase <at> acm.org, pipcet <at> protonmail.com, 75593 <at> debbugs.gnu.org Subject: Re: bug#75593: 31.0.50; Faulty macro kills Emacs Date: Thu, 16 Jan 2025 21:23:19 +0200
> From: Stefan Monnier <monnier <at> iro.umontreal.ca> > Cc: Pip Cet <pipcet <at> protonmail.com>, mattiase <at> acm.org, > ahprae <at> protonmail.com, 75593 <at> debbugs.gnu.org > Date: Thu, 16 Jan 2025 13:17:17 -0500 > > > IOW, can we prevent crashes in a way that is cheap in production > > builds, since 'eval' is quite a hotspot? > > I would actually be surprised if `Feval` is a hotspot. > > AFAIK `eval_sub` is sometimes a hotspot (tho only when running > non-compiled code, which *should* be somewhat infrequent), but I don't > think `Feval` is. I hope you are right. The benchmark should tell us.
bug-gnu-emacs <at> gnu.org
:bug#75593
; Package emacs
.
(Thu, 16 Jan 2025 19:26:02 GMT) Full text and rfc822 format available.Message #47 received at 75593 <at> debbugs.gnu.org (full text, mbox):
From: Eli Zaretskii <eliz <at> gnu.org> To: Stefan Monnier <monnier <at> iro.umontreal.ca> Cc: ahprae <at> protonmail.com, mattiase <at> acm.org, pipcet <at> protonmail.com, 75593 <at> debbugs.gnu.org Subject: Re: bug#75593: 31.0.50; Faulty macro kills Emacs Date: Thu, 16 Jan 2025 21:25:36 +0200
> From: Stefan Monnier <monnier <at> iro.umontreal.ca> > Cc: Eli Zaretskii <eliz <at> gnu.org>, mattiase <at> acm.org, ahprae <at> protonmail.com, > 75593 <at> debbugs.gnu.org > Date: Thu, 16 Jan 2025 13:41:35 -0500 > > I suggest to simply compare the time to bootstrap with and without the > `Flength` call. This way we can base our decision on actual data rather > than just our intuition. I suggested to byte-compile all the Lisp files for that very reason. It should be a better measurement, since "make bootstrap" does some stuff that is utterly unrelated.
bug-gnu-emacs <at> gnu.org
:bug#75593
; Package emacs
.
(Fri, 17 Jan 2025 11:36:01 GMT) Full text and rfc822 format available.Message #50 received at 75593 <at> debbugs.gnu.org (full text, mbox):
From: Pip Cet <pipcet <at> protonmail.com> To: Stefan Monnier <monnier <at> iro.umontreal.ca> Cc: ahprae <at> protonmail.com, mattiase <at> acm.org, Eli Zaretskii <eliz <at> gnu.org>, 75593 <at> debbugs.gnu.org Subject: Re: bug#75593: 31.0.50; Faulty macro kills Emacs Date: Fri, 17 Jan 2025 11:34:58 +0000
"Stefan Monnier" <monnier <at> iro.umontreal.ca> writes: >> IOW, can we prevent crashes in a way that is cheap in production >> builds, since 'eval' is quite a hotspot? > > I would actually be surprised if `Feval` is a hotspot. Do we need to fix the case where the lexenv variable is modified by Lisp code while it is the lexical environment? (defmacro f () x) (let ((l (list (cons 'l nil)))) (setcdr (car l) l) (eval '(progn (setcdr l 3) (f)) l)) crashes (this is the dotted-list case; the circular case causes an unquittable infloop). My original plan was to avoid looking at what Fmake_interpreted_closure does with its lexenv. It currently seems to me that it is simply resurrected as Vinternal_interpreter_environment upon execution. If that's true, maybe we should simply fix the Qmacro code in eval_sub and hope for the best. diff --git a/src/eval.c b/src/eval.c index 941d121c2fb..43a7cb78cb6 100644 --- a/src/eval.c +++ b/src/eval.c @@ -2658,12 +2658,12 @@ eval_sub (Lisp_Object form) /* Make the macro aware of any defvar declarations in scope. */ Lisp_Object dynvars = Vmacroexp__dynvars; - for (Lisp_Object p = Vinternal_interpreter_environment; - !NILP (p); p = XCDR(p)) + Lisp_Object p = Vinternal_interpreter_environment; + FOR_EACH_TAIL (p) { Lisp_Object e = XCAR (p); if (SYMBOLP (e)) - dynvars = Fcons(e, dynvars); + dynvars = Fcons (e, dynvars); } if (!EQ (dynvars, Vmacroexp__dynvars)) specbind (Qmacroexp__dynvars, dynvars);
bug-gnu-emacs <at> gnu.org
:bug#75593
; Package emacs
.
(Fri, 17 Jan 2025 13:50:01 GMT) Full text and rfc822 format available.Message #53 received at 75593 <at> debbugs.gnu.org (full text, mbox):
From: Stefan Monnier <monnier <at> iro.umontreal.ca> To: Pip Cet <pipcet <at> protonmail.com> Cc: ahprae <at> protonmail.com, mattiase <at> acm.org, Eli Zaretskii <eliz <at> gnu.org>, 75593 <at> debbugs.gnu.org Subject: Re: bug#75593: 31.0.50; Faulty macro kills Emacs Date: Fri, 17 Jan 2025 08:49:27 -0500
> Do we need to fix the case where the lexenv variable is modified by Lisp > code while it is the lexical environment? > > (defmacro f () x) > (let ((l (list (cons 'l nil)))) > (setcdr (car l) l) > (eval '(progn > (setcdr l 3) > (f)) > l)) > > crashes (this is the dotted-list case; the circular case causes an > unquittable infloop). 😈 > If that's true, maybe we should simply fix the Qmacro code in eval_sub > and hope for the best. Sounds good to me, Stefan
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.