Subject: bug#76898: 31.0.50; macOS: Intermittent hangs in proced tests

From: Stefan Kangas <[email-masked]>
Date: Sun, 9 Mar 2025 14:45:37 -0400

I see intermittent hangs in proced tests on macOS, with an Emacs running
at 100% CPU.  I have to kill the test manually.

I see this in test/lisp/proced-tests.log:

Running 6 tests (2025-03-09 12:14:54+0100, selector ‘(not (or (tag
:expensive-test) (tag :unstable) (tag :nativecomp)))’)
   passed  1/6  proced-color-test (0.568210 sec)

I can reproduce the hangs using:
    counter=1; while true; do echo "Run #$counter"; \
        make -C test proced-tests; ((counter++)); done

>From trying this three times, I got the below results, which seem to
suggest that the only test that doesn't hang is 'proced-color-test'.

Run #1354
gmake: Entering directory '/Users/skangas/wip/emacs/test'
gmake[1]: Entering directory '/Users/skangas/wip/emacs/test'
  GEN      lisp/proced-tests.log
Running 6 tests (2025-03-09 12:34:13+0100, selector ‘(not (or (tag
:unstable) (tag :nativecomp)))’)
   passed  1/6  proced-color-test (0.905839 sec)
   passed  2/6  proced-format-test (3.870509 sec)
  skipped  3/6  proced-refine-test (0.000048 sec)
  skipped  4/6  proced-refine-with-update-test (0.000033 sec)
   passed  5/6  proced-revert-test (1.235304 sec)

Run #39
gmake: Entering directory '/Users/skangas/wip/emacs/test'
gmake[1]: Entering directory '/Users/skangas/wip/emacs/test'
  GEN      lisp/proced-tests.log
Running 6 tests (2025-03-09 17:37:22+0100, selector ‘(not (or (tag
:unstable) (tag :nativecomp)))’)
   passed  1/6  proced-color-test (0.344444 sec)

Run #144
gmake: Entering directory '/Users/skangas/wip/emacs/test'
gmake[1]: Entering directory '/Users/skangas/wip/emacs/test'
  GEN      lisp/proced-tests.log
Running 6 tests (2025-03-09 17:44:56+0100, selector ‘(not (or (tag
:unstable) (tag :nativecomp)))’)
   passed  1/6  proced-color-test (0.335881 sec)
   passed  2/6  proced-format-test (1.364960 sec)
  skipped  3/6  proced-refine-test (0.000042 sec)
  skipped  4/6  proced-refine-with-update-test (0.000036 sec)

In GNU Emacs 31.0.50 (build 1, aarch64-apple-darwin24.2.0, NS
 appkit-2575.30 Version 15.2 (Build 24C101)) of 2025-03-09 built on
 foo.local
Repository revision: ce03bf252ae9bff28a6def163cb3f4fa102e691a
Repository branch: master
Windowing system distributor 'Apple', version 10.3.2575
System Description:  macOS 15.2

Configured using:
 'configure CFLAGS=-I/opt/homebrew/opt/libmps/include
 LDFLAGS=-L/opt/homebrew/opt/libmps/lib'

Configured features:
ACL DBUS GLIB GNUTLS LCMS2 LIBXML2 MODULES NOTIFY KQUEUE NS PDUMPER PNG
RSVG SQLITE3 THREADS TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM ZLIB

Important settings:
  value of $LC_CTYPE: UTF-8
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  minibuffer-regexp-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:
None found.

Features:
(shadow sort mail-extr emacsbug lisp-mnt message mailcap yank-media puny
dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg
rfc6068 epg-config gnus-util text-property-search time-date subr-x
mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils
mailheader cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils rmc iso-transl tooltip cconv eldoc paren
electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
term/ns-win ns-win ucs-normalize mule-util term/common-win 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 kqueue cocoa ns
lcms2 multi-tty make-network-process tty-child-frames emacs)

Memory information:
((conses 16 39407 8982) (symbols 48 5374 0) (strings 32 12312 1576)
 (string-bytes 1 290076) (vectors 16 9662)
 (vector-slots 8 109925 8633) (floats 8 21 3) (intervals 56 227 0)
 (buffers 992 10))