Subject: bug#75615: 29.4; Corfu+SLY = segmentation fault

From: Alexis Purslane <[email-masked]>
Date: Thu, 16 Jan 2025 21:39:59 +0000

Intermittantly, when writing Common Lisp code using Emacs with both SLY
    and Corfu enabled, always when about to complete a function name,
    Emacs will just segfault. It doesn't happen reproducibly enough to
    show up in the amount of time I can make myself use emacs -Q with
    just SLY and Corfu, since that's very painful for my wrists,
    although I might spend some time trying to come up with a minimal
    config that'll be ergonomic enough for me to do so. But it does
    happen often enough that I can reproduce it while running Emacs from
    inside GDB if that's needed. Here's the stack trace printed out when
    it segfaulted last time:

    Fatal error 11: Segmentation fault
Backtrace:
emacs-pgtk(emacs_backtrace+0x5a) [0x55935bfa3eaa]
emacs-pgtk(terminate_due_to_signal+0x9f) [0x55935be73b17]
emacs-pgtk(+0x128bb) [0x55935be748bb]
emacs-pgtk(+0x2b5d04) [0x55935c117d04]
/lib64/libc.so.6(+0x1a090) [0x7ff9dbec1090]
emacs-pgtk(Fget+0xbb) [0x55935c0368db]
emacs-pgtk(parse_modifiers+0x41) [0x55935bf88011]
emacs-pgtk(+0x13cc88) [0x55935bf9ec88]
emacs-pgtk(read_char+0x214a) [0x55935bf8d8ba]
emacs-pgtk(+0x1f6f42) [0x55935c058f42]
/usr/bin/../lib64/emacs/29.4/native-lisp/29.4-11d60c35/preloaded/subr-13adf6a6-bfb9f448.eln(F7369742d666f72_sit_for_0+0x19f) [0x7ff9d9c7d3af]
emacs-pgtk(Ffuncall+0xfd) [0x55935c030aed]
/var/home/alexispurslane/.emacs.d/eln-cache/29.4-11d60c35/sly-9d0f5020-da231921.eln(F736c792d6576616c_sly_eval_0+0x467) [0x7ff9aa9e69a7]
emacs-pgtk(Ffuncall+0xfd) [0x55935c030aed]
/var/home/alexispurslane/.emacs.d/eln-cache/29.4-11d60c35/sly-completion-dc20ed34-ae35b0dd.eln(F736c792d2d636f6d706c6574696f6e2d726571756573742d636f6d706c6574696f6e73_sly__completion_request_completions_0+0x118) [0x7ff9aa976f68]
emacs-pgtk(Ffuncall+0xfd) [0x55935c030aed]
/var/home/alexispurslane/.emacs.d/eln-cache/29.4-11d60c35/sly-completion-dc20ed34-ae35b0dd.eln(F736c792d666c65782d636f6d706c6574696f6e73_sly_flex_completions_0+0x5e) [0x7ff9aa97728e]
emacs-pgtk(exec_byte_code+0x56c) [0x55935c07bebc]
emacs-pgtk(Ffuncall+0xfd) [0x55935c030aed]
/usr/bin/../lib64/emacs/29.4/native-lisp/29.4-11d60c35/preloaded/minibuffer-1b0f548b-25462d74.eln(F636f6d706c6574696f6e2d626f756e646172696573_completion_boundaries_0+0x6b) [0x7ff9d9c0e37b]
emacs-pgtk(Ffuncall+0xfd) [0x55935c030aed]
/var/home/alexispurslane/.emacs.d/eln-cache/29.4-11d60c35/corfu-dba57511-3e5d62bd.eln(F636f7266752d2d7265636f6d70757465_corfu__recompute_0+0x8a3) [0x7ff9b0138323]
emacs-pgtk(Ffuncall+0xfd) [0x55935c030aed]
/var/home/alexispurslane/.emacs.d/eln-cache/29.4-11d60c35/corfu-dba57511-3e5d62bd.eln(F636f7266752d2d757064617465_corfu__update_0+0x755) [0x7ff9b0138fa5]
emacs-pgtk(exec_byte_code+0x56c) [0x55935c07bebc]
emacs-pgtk(Ffuncall+0xfd) [0x55935c030aed]
emacs-pgtk(Fapply+0x4a2) [0x55935c0314f2]
emacs-pgtk(exec_byte_code+0x56c) [0x55935c07bebc]
emacs-pgtk(Ffuncall+0xfd) [0x55935c030aed]
emacs-pgtk(Fapply+0x4a2) [0x55935c0314f2]
emacs-pgtk(exec_byte_code+0x56c) [0x55935c07bebc]
emacs-pgtk(Ffuncall+0xfd) [0x55935c030aed]
/var/home/alexispurslane/.emacs.d/eln-cache/29.4-11d60c35/corfu-dba57511-3e5d62bd.eln(F636f7266752d2d6175746f2d636f6d706c6574652d6465666572726564_corfu__auto_complete_deferred_0+0x393) [0x7ff9b013c523]
emacs-pgtk(Ffuncall+0xfd) [0x55935c030aed]
emacs-pgtk(Fapply+0x4a2) [0x55935c0314f2]
emacs-pgtk(Ffuncall+0xfd) [0x55935c030aed]
/usr/bin/../lib64/emacs/29.4/native-lisp/29.4-11d60c35/preloaded/timer-3ee7cfd9-226b3dc9.eln(F74696d65722d6576656e742d68616e646c6572_timer_event_handler_0+0x400) [0x7ff9d98aef60]
emacs-pgtk(Ffuncall+0xfd) [0x55935c030aed]
emacs-pgtk(timer_check+0x3f5) [0x55935bf85945]
emacs-pgtk(+0x123f2d) [0x55935bf85f2d]
emacs-pgtk(+0x12eba0) [0x55935bf90ba0]
...
Segmentation fault (core dumped)

In GNU Emacs 29.4 (build 1, x86_64-redhat-linux-gnu, GTK+ Version
 3.24.43, cairo version 1.18.0) of 2024-10-10 built on
 4825182c94fc4195b65c80c30f523a16
System Description: Fedora Linux 41.20241229.0 (Silverblue)

Configured using:
 'configure --build=x86_64-redhat-linux-gnu
 --host=x86_64-redhat-linux-gnu --program-prefix=
 --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr
 --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc
 --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64
 --libexecdir=/usr/libexec --localstatedir=/var --runstatedir=/run
 --sharedstatedir=/var/lib --mandir=/usr/share/man
 --infodir=/usr/share/info --with-cairo --with-dbus --with-gif
 --with-gpm=no --with-harfbuzz --with-jpeg --with-json --with-modules
 --with-native-compilation=aot --with-pgtk --with-png --with-rsvg
 --with-sqlite3 --with-tiff --with-tree-sitter --with-webp --with-xpm
 build_alias=x86_64-redhat-linux-gnu host_alias=x86_64-redhat-linux-gnu
 CC=gcc 'CFLAGS=-DMAIL_USE_LOCKF -O2 -flto=auto -ffat-lto-objects
 -fexceptions -g -grecord-gcc-switches -pipe -Wall
 -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3
 -Wp,-D_GLIBCXX_ASSERTIONS
 -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong
 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64
 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection
 -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer
 -mno-omit-leaf-frame-pointer ' 'LDFLAGS=-Wl,-z,relro -Wl,--as-needed
 -Wl,-z,pack-relative-relocs -Wl,-z,now
 -specs=/usr/lib/rpm/redhat/redhat-hardened-ld
 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1
 -specs=/usr/lib/rpm/redhat/redhat-package-notes '
 PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig CXX=g++
 'CXXFLAGS=-O2 -flto=auto -ffat-lto-objects -fexceptions -g
 -grecord-gcc-switches -pipe -Wall -Werror=format-security
 -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS
 -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong
 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64
 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection
 -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer
 -mno-omit-leaf-frame-pointer ''

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON
LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY
PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM GTK3 ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Fundamental

Minor modes in effect:
  recentf-mode: t
  nerd-icons-completion-mode: t
  marginalia-mode: t
  icomplete-vertical-mode: t
  icomplete-mode: t
  which-key-mode: t
  spacious-padding-mode: t
  global-visual-fill-column-mode: t
  global-treesit-auto-mode: t
  electric-pair-mode: t
  repeat-mode: t
  delete-selection-mode: t
  motion-selection-mode: t
  god-local-mode: t
  windmove-mode: t
  winner-mode: t
  savehist-mode: t
  pixel-scroll-precision-mode: t
  minibuffer-depth-indicate-mode: t
  global-auto-revert-mode: t
  override-global-mode: t
  display-time-mode: t
  display-battery-mode: t
  gcmh-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  column-number-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:
/var/home/alexispurslane/.emacs.d/elpa/transient-20241203.2154/transient hides /usr/share/emacs/29.4/lisp/transient
/var/home/alexispurslane/.emacs.d/elpa/jsonrpc-1.0.25/jsonrpc hides /usr/share/emacs/29.4/lisp/jsonrpc

Features:
(shadow sort smtpmail-async smtpmail noutline outline mail-extr emacsbug
message yank-media dired-subtree dired-hacks-utils dired-aux dired
dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config
gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils mule-util recentf tree-widget orderless
nerd-icons-completion marginalia icomplete which-key comp comp-cstr
ement ement-notifications ement-notify notifications ement-room
transient bookmark face-remap shr text-property-search pixel-fill
kinsoku url-file puny svg dom ewoc ement-lib ement-api ement-structs
ement-macros magit-section cursor-sensor dash compat compat-30 plz
warnings color dns nerd-icons nerd-icons-faces nerd-icons-data
nerd-icons-data-mdicon nerd-icons-data-flicon nerd-icons-data-codicon
nerd-icons-data-devicon nerd-icons-data-sucicon nerd-icons-data-wicon
nerd-icons-data-faicon nerd-icons-data-powerline nerd-icons-data-octicon
nerd-icons-data-pomicon nerd-icons-data-ipsicon spacious-padding
almost-mono-black-theme doom-themes doom-themes-base visual-fill-column
treesit-auto treesit elec-pair repeat delsel motion-selection-mode
god-mode-isearch god-mode time-date async disp-table windmove winner
savehist pixel-scroll cua-base ring mb-depth autorevert filenotify
cus-edit pp cus-load icons wid-edit pcase finder-inf almost-mono-themes
edmacro kmacro use-package-bind-key bind-key easy-mmode time format-spec
battery dbus xml gcmh cl-extra help-mode use-package-ensure
use-package-core package browse-url 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 password-cache json subr-x map byte-opt gv bytecomp
byte-compile url-vars rx profiler cl-loaddefs cl-lib info
almost-mono-themes-autoloads apheleia-autoloads async-autoloads
breadcrumb-autoloads calibredb-autoloads centered-window-autoloads
clojure-ts-mode-autoloads common-lisp-snippets-autoloads
consult-gnome-search-autoloads consult-notes-autoloads corfu-autoloads
dape-autoloads darkroom-autoloads devdocs-autoloads diff-hl-autoloads
dired-sidebar-autoloads dired-subtree-autoloads
dired-hacks-utils-autoloads docker-autoloads aio-autoloads
doom-themes-autoloads eat-autoloads editorconfig-autoloads
eldoc-box-autoloads elisp-def-autoloads elisp-demos-autoloads
embark-consult-autoloads consult-autoloads embark-autoloads
ement-autoloads enlight-autoloads esh-autosuggest-autoloads
company-autoloads esh-help-autoloads eshell-prompt-extras-autoloads
eshell-syntax-highlighting-autoloads evil-cleverparens-autoloads
evil-collection-autoloads annalist-autoloads evil-god-state-autoloads
evil-org-autoloads evil-textobj-tree-sitter-autoloads expreg-autoloads
exwm-autoloads fish-completion-autoloads flymake-proselint-autoloads
flymake-vale-autoloads forge-autoloads closql-autoloads
emacsql-autoloads gcmh-autoloads ghub-autoloads glsl-mode-autoloads
gnuplot-autoloads gnuplot-mode-autoloads gnus-desktop-notify-autoloads
god-mode-autoloads helpful-autoloads elisp-refs-autoloads f-autoloads
highlight-defined-autoloads hl-todo-autoloads htmlize-autoloads
hungry-delete-autoloads jsonrpc-autoloads keycast-autoloads
latex-preview-pane-autoloads ligature-autoloads
lisp-extra-font-lock-autoloads magit-autoloads marginalia-autoloads
markdown-mode-autoloads mathjax-autoloads mood-line-autoloads
motion-selection-mode-autoloads nerd-icons-completion-autoloads
nerd-icons-corfu-autoloads nerd-icons-dired-autoloads
nerd-icons-autoloads nov-autoloads esxml-autoloads kv-autoloads
orderless-autoloads org-mime-autoloads orgtbl-ascii-plot-autoloads
ox-rss-autoloads package-lint-flymake-autoloads package-lint-autoloads
pandoc-mode-autoloads paredit-autoloads persist-autoloads plz-autoloads
poet-theme-autoloads puni-autoloads request-autoloads shrface-autoloads
language-detection-autoloads sly-autoloads smartparens-autoloads
spacious-padding-autoloads svg-lib-autoloads syncthing-autoloads
tablist-autoloads taxy-magit-section-autoloads taxy-autoloads
magit-section-autoloads theme-anchor-autoloads toc-org-autoloads
transient-autoloads treemacs-evil-autoloads treemacs-autoloads
cfrs-autoloads posframe-autoloads ht-autoloads hydra-autoloads
lv-autoloads pfuture-autoloads ace-window-autoloads avy-autoloads
s-autoloads dash-autoloads evil-autoloads goto-chg-autoloads
treepy-autoloads treesit-auto-autoloads vimgolf-autoloads
visual-fill-column-autoloads wgrep-autoloads which-key-autoloads
whole-line-or-region-autoloads with-editor-autoloads xelb-autoloads
compat-autoloads yaml-autoloads yasnippet-capf-autoloads
yasnippet-autoloads rmc iso-transl tooltip cconv eldoc paren electric
uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
term/pgtk-win pgtk-win term/common-win pgtk-dnd 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
dynamic-setting system-font-setting font-render-setting cairo gtk pgtk
multi-tty make-network-process native-compile emacs)

Memory information:
((conses 16 273610 81441)
 (symbols 48 20433 1)
 (strings 32 83397 13912)
 (string-bytes 1 2773781)
 (vectors 16 56375)
 (vector-slots 8 1177365 100891)
 (floats 8 553 390)
 (intervals 56 789 81)
 (buffers 984 12))