Subject: bug#76538: 31.0.50; 31.0.50; 31.0.50; feature/igc: using magit-section-cycle-global (S-TAB) and magit-section-toggle (TAB) in some random ways blocks GNU Emacs.

From: João Moreira <[email-masked]>
Date: Mon, 24 Feb 2025 21:52:45 -0300

HAPPENED

Using magit-section-cycle-global (S-TAB) and magit-section-toggle (TAB) in some random ways blocks GNU Emacs while using feature/igc.

EXPECTED

Magit does not block GNU Emacs.

REPRODUCE

1. On a non-customized GNU Emacs feature/igc 48909543bdc7cfb605034398f2757e8d01004aca, eval
```emacs-lisp
;;;; PACKAGES

(require 'package)
(require 'package-vc)
(require 'use-package)

(defmacro my-package-install (package &optional feature &rest body)
  "Set up PACKAGE from an Elisp archive, with rest BODY; require
FEATURE instead of PACKAGE if given.

PACKAGE is a quoted symbol, FEATURE is a quoted symbol, while BODY
consists of balanced expressions.

Try to install the package if it is missing.

  (declare (indent 1))
  `(progn
     ;; replace when not with unless?
     (unless (package-installed-p ,package)
       (unless package-archive-contents
         (package-refresh-contents))
       (package-install ,package))))

;; Set archives.
(dolist (package-archive '(("melpa" . "https://melpa.org/packages/"))
                         package-archives)
  (unless (assoc-default (car package-archive) package-archives)
    (add-to-list 'package-archives package-archive t)))

;; Initialize.
(package-initialize)

;;;; INSTALL
(my-package-install 'magit)

;;;; CONFIG

(use-package magit
  :custom
  (magit-git-executable (executable-find "git"))
  (magit-perl-executable (executable-find "perl")))
```

2. `git clone https://github.com/joaoymoreira/joao.edu.uni.pi22019208901.real-review.git`

3. `cd real-review && rm -rf .git`

4. `git init`

3. Open magit, press S to stage files.

4. On Staged changes, press magit-section-cycle-global (S-TAB) and magit-section-toggle (TAB) randomly until it blocks GNU Emacs in showing white screen (all frames).

SYSTEM INFORMATION

In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo
version 1.18.2, Xaw3d scroll bars)
Repository revision: 48909543bdc7cfb605034398f2757e8d01004aca
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101014
System Description: NixOS 25.05 (Warbler)

Configured using:
 'configure
 --prefix=/nix/store/ji21vqsmpbnqsrq0l2rfvxaxpvpr0b7q-emacs-igc-20250217.0
 --disable-build-details --with-modules --with-x-toolkit=lucid
 --with-cairo --with-xft --with-compress-install
 --with-toolkit-scroll-bars --with-native-compilation
 --without-imagemagick --with-mailutils --without-small-ja-dic
 --with-tree-sitter --with-xinput2 --without-xwidgets --with-dbus
 --with-selinux --with-mps=yes'

Configured features:
CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES MPS NATIVE_COMP
NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XAW3D XDBE XIM XINPUT2 XPM
LUCID ZLIB

Important settings:
  value of $EMACSLOADPATH:
  value of $EMACSNATIVELOADPATH:
  value of $LC_CTYPE: pt_BR.UTF-8
  value of $LC_TIME: en_DK.UTF-8
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Fundamental

Minor modes in effect:
  global-git-commit-mode: t
  magit-auto-revert-mode: t
  override-global-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  blink-cursor-mode: t
  minibuffer-regexp-mode: t
  buffer-read-only: 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:
/etc/profiles/per-user/joao/share/emacs/site-lisp/elpa/compat-30.0.2.0/compat hides /nix/store/nbi6gy4n0w8h13fna2fqp7a29cdn0km9-emacs-packages-deps/share/emacs/site-lisp/elpa/compat-30.0.2.0/compat
/etc/profiles/per-user/joao/share/emacs/site-lisp/elpa/compat-30.0.2.0/compat-30 hides /nix/store/nbi6gy4n0w8h13fna2fqp7a29cdn0km9-emacs-packages-deps/share/emacs/site-lisp/elpa/compat-30.0.2.0/compat-30
/etc/profiles/per-user/joao/share/emacs/site-lisp/elpa/compat-30.0.2.0/compat-29 hides /nix/store/nbi6gy4n0w8h13fna2fqp7a29cdn0km9-emacs-packages-deps/share/emacs/site-lisp/elpa/compat-30.0.2.0/compat-29
/etc/profiles/per-user/joao/share/emacs/site-lisp/elpa/compat-30.0.2.0/compat-28 hides /nix/store/nbi6gy4n0w8h13fna2fqp7a29cdn0km9-emacs-packages-deps/share/emacs/site-lisp/elpa/compat-30.0.2.0/compat-28
/etc/profiles/per-user/joao/share/emacs/site-lisp/elpa/compat-30.0.2.0/compat-27 hides /nix/store/nbi6gy4n0w8h13fna2fqp7a29cdn0km9-emacs-packages-deps/share/emacs/site-lisp/elpa/compat-30.0.2.0/compat-27
/etc/profiles/per-user/joao/share/emacs/site-lisp/elpa/compat-30.0.2.0/compat-26 hides /nix/store/nbi6gy4n0w8h13fna2fqp7a29cdn0km9-emacs-packages-deps/share/emacs/site-lisp/elpa/compat-30.0.2.0/compat-26
/etc/profiles/per-user/joao/share/emacs/site-lisp/elpa/compat-30.0.2.0/compat-25 hides /nix/store/nbi6gy4n0w8h13fna2fqp7a29cdn0km9-emacs-packages-deps/share/emacs/site-lisp/elpa/compat-30.0.2.0/compat-25
/etc/profiles/per-user/joao/share/emacs/site-lisp/elpa/compat-30.0.2.0/compat-autoloads hides /nix/store/nbi6gy4n0w8h13fna2fqp7a29cdn0km9-emacs-packages-deps/share/emacs/site-lisp/elpa/compat-30.0.2.0/compat-autoloads
/etc/profiles/per-user/joao/share/emacs/site-lisp/elpa/compat-30.0.2.0/compat-pkg hides /nix/store/nbi6gy4n0w8h13fna2fqp7a29cdn0km9-emacs-packages-deps/share/emacs/site-lisp/elpa/compat-30.0.2.0/compat-pkg
/etc/profiles/per-user/joao/share/emacs/site-lisp/elpa/compat-30.0.2.0/compat-macs hides /nix/store/nbi6gy4n0w8h13fna2fqp7a29cdn0km9-emacs-packages-deps/share/emacs/site-lisp/elpa/compat-30.0.2.0/compat-macs
/etc/profiles/per-user/joao/share/emacs/site-lisp/elpa/dash-20240510.1327/dash-autoloads hides /nix/store/nbi6gy4n0w8h13fna2fqp7a29cdn0km9-emacs-packages-deps/share/emacs/site-lisp/elpa/dash-20240510.1327/dash-autoloads
/etc/profiles/per-user/joao/share/emacs/site-lisp/elpa/dash-20240510.1327/dash hides /nix/store/nbi6gy4n0w8h13fna2fqp7a29cdn0km9-emacs-packages-deps/share/emacs/site-lisp/elpa/dash-20240510.1327/dash
/etc/profiles/per-user/joao/share/emacs/site-lisp/elpa/dash-20240510.1327/dash-pkg hides /nix/store/nbi6gy4n0w8h13fna2fqp7a29cdn0km9-emacs-packages-deps/share/emacs/site-lisp/elpa/dash-20240510.1327/dash-pkg
/etc/profiles/per-user/joao/share/emacs/site-lisp/elpa/seq-2.24/seq hides /nix/store/nbi6gy4n0w8h13fna2fqp7a29cdn0km9-emacs-packages-deps/share/emacs/site-lisp/elpa/seq-2.24/seq
/etc/profiles/per-user/joao/share/emacs/site-lisp/elpa/seq-2.24/seq-autoloads hides /nix/store/nbi6gy4n0w8h13fna2fqp7a29cdn0km9-emacs-packages-deps/share/emacs/site-lisp/elpa/seq-2.24/seq-autoloads
/etc/profiles/per-user/joao/share/emacs/site-lisp/elpa/seq-2.24/seq-25 hides /nix/store/nbi6gy4n0w8h13fna2fqp7a29cdn0km9-emacs-packages-deps/share/emacs/site-lisp/elpa/seq-2.24/seq-25
/etc/profiles/per-user/joao/share/emacs/site-lisp/elpa/seq-2.24/seq-pkg hides /nix/store/nbi6gy4n0w8h13fna2fqp7a29cdn0km9-emacs-packages-deps/share/emacs/site-lisp/elpa/seq-2.24/seq-pkg
/etc/profiles/per-user/joao/share/emacs/site-lisp/elpa/seq-2.24/seq-24 hides /nix/store/nbi6gy4n0w8h13fna2fqp7a29cdn0km9-emacs-packages-deps/share/emacs/site-lisp/elpa/seq-2.24/seq-24
/nix/store/nbi6gy4n0w8h13fna2fqp7a29cdn0km9-emacs-packages-deps/share/emacs/site-lisp/site-start hides /nix/store/ji21vqsmpbnqsrq0l2rfvxaxpvpr0b7q-emacs-igc-20250217.0/share/emacs/site-lisp/site-start
/etc/profiles/per-user/joao/share/emacs/site-lisp/elpa/compat-30.0.2.0/compat hides /nix/store/ji21vqsmpbnqsrq0l2rfvxaxpvpr0b7q-emacs-igc-20250217.0/share/emacs/31.0.50/lisp/emacs-lisp/compat
/nix/store/nbi6gy4n0w8h13fna2fqp7a29cdn0km9-emacs-packages-deps/share/emacs/site-lisp/elpa/let-alist-1.0.6/let-alist hides /nix/store/ji21vqsmpbnqsrq0l2rfvxaxpvpr0b7q-emacs-igc-20250217.0/share/emacs/31.0.50/lisp/emacs-lisp/let-alist
/etc/profiles/per-user/joao/share/emacs/site-lisp/elpa/seq-2.24/seq hides /nix/store/ji21vqsmpbnqsrq0l2rfvxaxpvpr0b7q-emacs-igc-20250217.0/share/emacs/31.0.50/lisp/emacs-lisp/seq
/etc/profiles/per-user/joao/share/emacs/site-lisp/elpa/cl-generic-0.3/cl-generic hides /nix/store/ji21vqsmpbnqsrq0l2rfvxaxpvpr0b7q-emacs-igc-20250217.0/share/emacs/31.0.50/lisp/emacs-lisp/cl-generic

Features:
(shadow sort mail-extr emacsbug cus-edit cus-start cus-load wid-edit
ediff ediff-merg ediff-mult ediff-wind ediff-diff ediff-help ediff-init
ediff-util let-alist magit-bookmark 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 magit-diff smerge-mode diff git-commit magit-core
magit-autorevert autorevert filenotify magit-margin magit-transient
log-edit pcvs-util add-log magit-process with-editor magit-mode elp
transient pp edmacro kmacro magit-git magit-base which-func imenu vc-git
diff-mode track-changes files-x magit-section crm magit-autoloads
benchmark format-spec cursor-sensor llama comp comp-cstr cl-extra
help-mode magit-section-autoloads llama-autoloads pcase warnings shell
pcomplete server compat compat-30 with-editor-autoloads loaddefs-gen
radix-tree tar-mode arc-mode archive-mode mm-archive message sendmail
yank-media dired dired-loaddefs rfc822 mml mml-sec epa derived gnus-util
time-date mailabbrev gmm-utils mailheader mm-decode mm-bodies mm-encode
mail-utils gnutls network-stream url-cache url-http url-auth mail-parse
rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr url-gw nsm puny
compile text-property-search comint ansi-osc ansi-color ring comp-run
comp-common rx epg rfc6068 epg-config finder-inf use-package
use-package-ensure use-package-delight use-package-diminish
use-package-bind-key bind-key easy-mmode use-package-core package-vc vc
vc-dispatcher lisp-mnt emacsql-sqlite-autoloads emojify-logos-autoloads
emojify-autoloads ht-autoloads info dash-autoloads jinx-autoloads
pdf-tools-autoloads tablist-autoloads vterm-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
dynamic-setting system-font-setting font-render-setting cairo x-toolkit
xinput2 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 1000 0))