Subject: bug#74383: 29.4; Emacs PGTK crashes on Void Linux

From: Taha Aziz Ben Ali <[email-masked]>
Date: Sat, 16 Nov 2024 13:42:39 +0100

Hello,

I've been failing to get Emacs to launch under Sway on Void Linux, the
configuration I'm using was working fine on Arch Linux (using the same
Emacs version). Note that `emacs -Q' also segfaults, but `emacs -nw' is
able to launch emacs with all of my configuration without a single
warning.

You can find the backtrace leading up to this error in this paste:

  https://paste.sr.ht/~grtcdr/c39dad4913262557228d1158680f52613b728c6a

I tracked the issue down to a cairo_surface_create_similar_image() call
that results in the crash.

Before the program crashes, a warning about the "xpm" image type not
being supported is shown which may be relevant:

  (emacs:8670): GdkPixbuf-WARNING **: 13:38:44.606: Error loading XPM
  image loader: Image type “xpm” is not supported

In GNU Emacs 29.4 (build 2, x86_64-unknown-linux-musl, GTK+ Version
 3.24.43, cairo version 1.18.0) of 2024-10-13 built on
 void-buildbot-worker-musl
System Description: Void Linux

Configured using:
 'configure --with-pgtk --prefix=/usr --sysconfdir=/etc
 --sbindir=/usr/bin --bindir=/usr/bin --mandir=/usr/share/man
 --infodir=/usr/share/info --localstatedir=/var
 --host=x86_64-unknown-linux-musl --build=x86_64-unknown-linux-musl
 '--libdir=${exec_prefix}/lib64' --with-file-notification=inotify
 --with-modules --with-jpeg --with-tiff --with-gif --with-png
 --with-webp --with-xpm --with-rsvg --without-imagemagick --with-xml2
 --with-gnutls --with-sound --with-m17n-flt --with-json --with-harfbuzz
 --with-cairo --with-libgmp --with-sqlite3 --with-tree-sitter
 --with-native-compilation=aot 'CFLAGS=-fno-PIE -mtune=generic -O2 -pipe
 -g -ffile-prefix-map=/builddir/emacs-29.4=.' 'CPPFLAGS= '
 'LDFLAGS=-no-pie -Wl,--as-needed ''

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON
LCMS2 LIBOTF 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 $LC_COLLATE: C
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: ERC

Minor modes in effect:
  global-git-commit-mode: t
  magit-auto-revert-mode: t
  shell-dirtrack-mode: t
  erc-list-mode: t
  erc-menu-mode: t
  erc-autojoin-mode: t
  erc-ring-mode: t
  erc-pcomplete-mode: t
  erc-track-mode: t
  erc-track-minor-mode: t
  erc-match-mode: t
  erc-button-mode: t
  erc-fill-mode: t
  erc-stamp-mode: t
  erc-netsplit-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-move-to-prompt-mode: t
  erc-readonly-mode: t
  erc-networks-mode: t
  server-mode: t
  eros-mode: t
  which-key-mode: t
  vertico-multiform-mode: t
  vertico-mode: t
  global-corfu-mode: t
  corfu-mode: t
  marginalia-mode: t
  envrc-global-mode: t
  my/global-dired-omit-mode: t
  pixel-scroll-precision-mode: t
  delete-selection-mode: t
  auto-insert-mode: t
  electric-pair-mode: t
  savehist-mode: t
  repeat-mode: t
  global-auto-revert-mode: t
  auto-compile-on-load-mode: t
  auto-compile-on-save-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  context-menu-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  window-divider-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
/home/grtcdr/.config/emacs/package/transient/lisp/transient hides /usr/share/emacs/29.4/lisp/transient
/home/grtcdr/.config/emacs/package/modus-themes/theme-loaddefs hides /usr/share/emacs/29.4/lisp/theme-loaddefs

Features:
(shadow sort mail-extr emacsbug term/screen magit-bookmark
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 git-commit log-edit pcvs-util add-log magit-core
magit-autorevert magit-margin magit-transient magit-process with-editor
shell magit-mode transient benchmark magit-git magit-base magit-section
dash network-stream epa-file url-http url-auth url-gw nsm erc-list
erc-menu erc-join erc-ring erc-pcomplete erc-track erc-match erc-button
erc-fill erc-stamp erc-netsplit my-erc erc-goodies erc erc-backend
erc-networks erc-common erc-compat erc-loaddefs tabify mule-util
orderless dired-aux cursor-sensor vertico-buffer term/xterm xterm
parse-time server exec-path-from-shell my-mode-line my-giornata
giornata-calendar iso8601 giornata giornata-lib my-engine my-email
notmuch notmuch-tree notmuch-jump notmuch-hello notmuch-show
notmuch-print notmuch-crypto notmuch-mua notmuch-message notmuch-draft
notmuch-maildir-fcc notmuch-address notmuch-company notmuch-parser
notmuch-wash coolj goto-addr icalendar diary-lib diary-loaddefs
notmuch-tag crm notmuch-lib notmuch-version notmuch-compat hl-line
mm-view mml-smime smime gnutls dig my-elfeed mpv tq org-timer org-clock
elfeed-show elfeed-search vc-git vc-dispatcher paredit edmacro kmacro
eros bookmark message sendmail yank-media rfc822 mml mml-sec epa derived
epg rfc6068 epg-config gnus-util mm-decode mm-bodies mm-encode
mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr
mailabbrev mail-utils gmm-utils mailheader shr text-property-search
pixel-fill kinsoku puny svg dom elfeed-csv elfeed elfeed-curl elfeed-log
elfeed-db elfeed-lib thingatpt url-queue url-file xml-query my-denote
my-cv cus-start org-protocol my-blog modus-operandi-theme modus-themes
org-agenda org-element org-persist org-id avl-tree generator org-refile
org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-src
ob-comint org-pcomplete pcomplete comint ansi-osc org-list org-footnote
org-faces org-entities time-date noutline outline ob-emacs-lisp ob-core
ob-eval org-cycle org-table org-keys oc org-loaddefs find-func cal-menu
calendar cal-loaddefs ol org-fold org-fold-core org-compat org-version
org-macs format-spec dbus xml which-key vertico-multiform vertico corfu
marginalia envrc inheritenv diff-mode ansi-color easy-mmode dired-x
dired dired-loaddefs pixel-scroll cua-base ring delsel autoinsert
elec-pair savehist repeat autorevert filenotify auth-source-pass xdg
no-littering compat compat-30 jka-compr auto-compile yaml-mode-autoloads
yaml-autoloads with-editor-autoloads which-key-autoloads
vertico-autoloads treepy-autoloads transient-autoloads tempel-autoloads
s-autoloads rust-mode-autoloads rainbow-mode-autoloads paredit-autoloads
orderless-autoloads olivetti-autoloads no-littering-autoloads
mpv-autoloads modus-themes-autoloads markdown-mode-autoloads
marginalia-autoloads magit-autoloads lua-mode-autoloads logos-autoloads
llama-autoloads iwd-autoloads inheritenv-autoloads
graphviz-dot-mode-autoloads git-modes-autoloads giornata-autoloads
ghub-autoloads geiser-guile-autoloads geiser-autoloads forge-autoloads
f-autoloads exec-path-from-shell-autoloads eros-autoloads epkg-autoloads
envrc-autoloads emacsql-autoloads elfeed-autoloads
edit-indirect-autoloads denote-autoloads dash-autoloads corfu-autoloads
compat-autoloads closql-autoloads borg-autoloads avy-autoloads
auto-compile-autoloads auctex-autoloads borg loaddefs-gen lisp-mnt
radix-tree pcase info comp comp-cstr warnings rx cl-extra help-mode
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 cus-edit pp cus-load icons wid-edit cl-loaddefs cl-lib 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 lcms2 multi-tty make-network-process
native-compile emacs)

Memory information:
((conses 16 494694 158548)
 (symbols 48 32975 0)
 (strings 32 150241 53925)
 (string-bytes 1 5640984)
 (vectors 16 69977)
 (vector-slots 8 1152542 171527)
 (floats 8 2999 1038)
 (intervals 56 3162 626)
 (buffers 984 21))