Subject: 29.0.50; cc-mode based uninterruptible infloop

From: Michael Welsh Duggan <[email-masked]>
Date: Thu, 02 Jun 2022 14:26:08 -0400

Create a directory containing the following two files:

.dir-locals.el

bug.el

>From that directory, run "emacs -Q bug.hpp".

The result is an inflooping emacs from which `C-g' and `ESC ESC ESC'
seem to do nothing useful.

I stopped it in the debugger and ran `fin' several times, interspersing
with `xbacktrace' calls until `fin` did not return.  The result is
copied herein:

Starting program: /home/md5i/src/emacs/build/src/emacs -Q bug.hpp
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffee55e640 (LWP 3028629)]
[New Thread 0x7fffedcf5640 (LWP 3028636)]
[New Thread 0x7fffed4f4640 (LWP 3028637)]

Thread 1 "emacs" received signal SIGTSTP, Stopped (user).
process_mark_stack (base_sp=0) at ../../md5i/src/alloc.c:6735
6735	      void *po = XPNTR (obj);
"Automatic GC" (0x0)
0x5658b1c0 PVEC_COMPILED
"c-forward-sws" (0xffff7740)
"c-forward-over-token-and-ws" (0xffff7898)
"c-forward-token-2" (0xffff79e8)
"c-forward-noise-clause" (0xffff7b40)
"c-forward-declarator" (0xffff7ca8)
"c-fl-decl-end" (0xffff7de8)
"c-context-expand-fl-region" (0xee5920a8)
0x56429cf0 PVEC_COMPILED
"c-before-context-fl-expand-region" (0xffff82a8)
"c-font-lock-fontify-region" (0xffff8438)
"font-lock-fontify-region" (0xee592040)
0x55e86658 PVEC_COMPILED
"jit-lock--run-functions" (0xffff88b8)
"jit-lock-fontify-now" (0xffff8a58)
"jit-lock-function" (0xffff8ba8)
"redisplay_internal (C function)" (0x0)
Run till exit from #0  process_mark_stack (base_sp=0)
    at ../../md5i/src/alloc.c:6735
0x0000555555730efa in mark_object (obj=XIL(0x7d40)) at ../../md5i/src/alloc.c:7025
7025	}
Run till exit from #0  0x0000555555730efa in mark_object (obj=XIL(0x7d40))
    at ../../md5i/src/alloc.c:7025
0x00005555557310ca in mark_object_root_visitor (root_ptr=<optimized out>, type=<optimized out>, data=<optimized out>) at ../../md5i/src/alloc.c:5978
5978	}
Run till exit from #0  0x00005555557310ca in mark_object_root_visitor (
    root_ptr=<optimized out>, type=<optimized out>, data=<optimized out>)
    at ../../md5i/src/alloc.c:5978
visit_vectorlike_root (visitor=..., ptr=0x555555c57c00 <buffer_defaults>, type=GC_ROOT_BUFFER_LOCAL_DEFAULT) at ../../md5i/src/alloc.c:5927
5927	  for (i = 0; i < size; i++)
Run till exit from #0  visit_vectorlike_root (visitor=..., 
    ptr=0x555555c57c00 <buffer_defaults>, type=GC_ROOT_BUFFER_LOCAL_DEFAULT)
    at ../../md5i/src/alloc.c:5927
0x000055555572aed3 in visit_buffer_root (visitor=..., buffer=<optimized out>, type=<optimized out>) at ../../md5i/src/alloc.c:5944
5944	}
Run till exit from #0  0x000055555572aed3 in visit_buffer_root (visitor=..., 
    buffer=<optimized out>, type=<optimized out>)
    at ../../md5i/src/alloc.c:5944
visit_static_gc_roots (visitor=...) at ../../md5i/src/alloc.c:5958
5958	  visit_buffer_root (visitor,
Run till exit from #0  visit_static_gc_roots (visitor=...)
    at ../../md5i/src/alloc.c:5958
garbage_collect () at ../../md5i/src/alloc.c:6181
6181	  mark_pinned_objects ();
Run till exit from #0  garbage_collect () at ../../md5i/src/alloc.c:6181
0x00005555557316b1 in maybe_garbage_collect () at ../../md5i/src/alloc.c:6089
6089	}
Run till exit from #0  0x00005555557316b1 in maybe_garbage_collect ()
    at ../../md5i/src/alloc.c:6089
0x0000555555754fa1 in maybe_gc () at ../../md5i/src/lisp.h:5530
5530	    maybe_garbage_collect ();
Run till exit from #0  0x0000555555754fa1 in maybe_gc ()
    at ../../md5i/src/lisp.h:5530
Ffuncall (nargs=nargs@entry=1, args=args@entry=0x7fffffff74f8) at ../../md5i/src/eval.c:2940
2940	  if (debug_on_next_call)
Run till exit from #0  Ffuncall (nargs=nargs@entry=1, 
    args=args@entry=0x7fffffff74f8) at ../../md5i/src/eval.c:2940
0x000055555579fc3b in bcall0 (f=<optimized out>) at ../../md5i/src/comp.c:844
844	}
Value returned is $1 = (struct Lisp_X *) 0x0
Run till exit from #0  0x000055555579fc3b in bcall0 (f=<optimized out>)
    at ../../md5i/src/comp.c:844
do_one_unbind (this_binding=this_binding@entry=0x7fffffff7540, unwinding=unwinding@entry=true, bindflag=bindflag@entry=SET_INTERNAL_UNBIND) at ../../md5i/src/eval.c:3570
3570	      break;
Run till exit from #0  do_one_unbind (
    this_binding=this_binding@entry=0x7fffffff7540, 
    unwinding=unwinding@entry=true, 
    bindflag=bindflag@entry=SET_INTERNAL_UNBIND) at ../../md5i/src/eval.c:3570
unbind_to (count=..., value=value@entry=XIL(0)) at ../../md5i/src/eval.c:3698
3698	  while (specpdl_ptr != specpdl_ref_to_ptr (count))
Run till exit from #0  unbind_to (count=..., value=value@entry=XIL(0))
    at ../../md5i/src/eval.c:3698
0x00005555557a1017 in helper_unbind_n (n=<optimized out>) at ../../md5i/src/comp.c:4988
4988	}
Value returned is $2 = (struct Lisp_X *) 0x0
Run till exit from #0  0x00005555557a1017 in helper_unbind_n (
    n=<optimized out>) at ../../md5i/src/comp.c:4988
0x00007fffec8e8345 in F632d666f72776172642d737773_c_forward_sws_0 () from /home/md5i/.config/emacs/eln-cache/29.0.50-0e65c843/cc-engine-ccfcb170-09002edc.eln
Value returned is $3 = (struct Lisp_X *) 0x0
Run till exit from #0  0x00007fffec8e8345 in F632d666f72776172642d737773_c_forward_sws_0 ()
   from /home/md5i/.config/emacs/eln-cache/29.0.50-0e65c843/cc-engine-ccfcb170-09002edc.eln
0x0000555555756b79 in funcall_subr (subr=0x5555562f6aa0, numargs=numargs@entry=0, args=args@entry=0x7fffffff7740) at ../../md5i/src/eval.c:2979
2979		      return subr->function.a0 ();
"c-forward-sws" (0xffff7740)
"c-forward-over-token-and-ws" (0xffff7898)
"c-forward-token-2" (0xffff79e8)
"c-forward-noise-clause" (0xffff7b40)
"c-forward-declarator" (0xffff7ca8)
"c-fl-decl-end" (0xffff7de8)
"c-context-expand-fl-region" (0xee5920a8)
0x56429cf0 PVEC_COMPILED
"c-before-context-fl-expand-region" (0xffff82a8)
"c-font-lock-fontify-region" (0xffff8438)
"font-lock-fontify-region" (0xee592040)
0x55e86658 PVEC_COMPILED
"jit-lock--run-functions" (0xffff88b8)
"jit-lock-fontify-now" (0xffff8a58)
"jit-lock-function" (0xffff8ba8)
"redisplay_internal (C function)" (0x0)
Run till exit from #0  0x0000555555756b79 in funcall_subr (
    subr=0x5555562f6aa0, numargs=numargs@entry=0, 
    args=args@entry=0x7fffffff7740) at ../../md5i/src/eval.c:2979
0x0000555555754a9e in funcall_general (fun=<optimized out>, numargs=numargs@entry=0, args=args@entry=0x7fffffff7740) at ../../md5i/src/eval.c:2889
2889	    return funcall_subr (XSUBR (fun), numargs, args);
Value returned is $4 = (struct Lisp_X *) 0x0
Run till exit from #0  0x0000555555754a9e in funcall_general (
    fun=<optimized out>, numargs=numargs@entry=0, 
    args=args@entry=0x7fffffff7740) at ../../md5i/src/eval.c:2889
Ffuncall (nargs=1, args=0x7fffffff7738) at ../../md5i/src/eval.c:2945
2945	  lisp_eval_depth--;
Value returned is $5 = (struct Lisp_X *) 0x0
Run till exit from #0  Ffuncall (nargs=1, args=0x7fffffff7738)
    at ../../md5i/src/eval.c:2945
0x00007fffec8f9b11 in F632d666f72776172642d6f7665722d746f6b656e2d616e642d7773_c_forward_over_token_and_ws_0 () from /home/md5i/.config/emacs/eln-cache/29.0.50-0e65c843/cc-engine-ccfcb170-09002edc.eln
Value returned is $6 = (struct Lisp_X *) 0x0
Run till exit from #0  0x00007fffec8f9b11 in F632d666f72776172642d6f7665722d746f6b656e2d616e642d7773_c_forward_over_token_and_ws_0 ()
   from /home/md5i/.config/emacs/eln-cache/29.0.50-0e65c843/cc-engine-ccfcb170-09002edc.eln
0x0000555555756b84 in funcall_subr (subr=0x5555560c2418, numargs=numargs@entry=1, args=args@entry=0x7fffffff7898) at ../../md5i/src/eval.c:2981
2981		      return subr->function.a1 (a[0]);
Run till exit from #0  0x0000555555756b84 in funcall_subr (
    subr=0x5555560c2418, numargs=numargs@entry=1, 
    args=args@entry=0x7fffffff7898) at ../../md5i/src/eval.c:2981
0x0000555555754a9e in funcall_general (fun=<optimized out>, numargs=numargs@entry=1, args=args@entry=0x7fffffff7898) at ../../md5i/src/eval.c:2889
2889	    return funcall_subr (XSUBR (fun), numargs, args);
Value returned is $7 = (struct Lisp_X *) 0x30
Run till exit from #0  0x0000555555754a9e in funcall_general (
    fun=<optimized out>, numargs=numargs@entry=1, 
    args=args@entry=0x7fffffff7898) at ../../md5i/src/eval.c:2889
Ffuncall (nargs=2, args=0x7fffffff7890) at ../../md5i/src/eval.c:2945
2945	  lisp_eval_depth--;
Value returned is $8 = (struct Lisp_X *) 0x30
Run till exit from #0  Ffuncall (nargs=2, args=0x7fffffff7890)
    at ../../md5i/src/eval.c:2945
0x00007fffec8f9e06 in F632d666f72776172642d746f6b656e2d32_c_forward_token_2_0 () from /home/md5i/.config/emacs/eln-cache/29.0.50-0e65c843/cc-engine-ccfcb170-09002edc.eln
Value returned is $9 = (struct Lisp_X *) 0x30
Run till exit from #0  0x00007fffec8f9e06 in F632d666f72776172642d746f6b656e2d32_c_forward_token_2_0 ()
   from /home/md5i/.config/emacs/eln-cache/29.0.50-0e65c843/cc-engine-ccfcb170-09002edc.eln
0x0000555555756ba6 in funcall_subr (subr=0x5555560c2470, numargs=numargs@entry=0, args=args@entry=0x7fffffff79e8) at ../../md5i/src/eval.c:2985
2985		      return subr->function.a3 (a[0], a[1], a[2]);
"c-forward-token-2" (0xffff79e8)
"c-forward-noise-clause" (0xffff7b40)
"c-forward-declarator" (0xffff7ca8)
"c-fl-decl-end" (0xffff7de8)
"c-context-expand-fl-region" (0xee5920a8)
0x56429cf0 PVEC_COMPILED
"c-before-context-fl-expand-region" (0xffff82a8)
"c-font-lock-fontify-region" (0xffff8438)
"font-lock-fontify-region" (0xee592040)
0x55e86658 PVEC_COMPILED
"jit-lock--run-functions" (0xffff88b8)
"jit-lock-fontify-now" (0xffff8a58)
"jit-lock-function" (0xffff8ba8)
"redisplay_internal (C function)" (0x0)
Run till exit from #0  0x0000555555756ba6 in funcall_subr (
    subr=0x5555560c2470, numargs=numargs@entry=0, 
    args=args@entry=0x7fffffff79e8) at ../../md5i/src/eval.c:2985
0x0000555555754a9e in funcall_general (fun=<optimized out>, numargs=numargs@entry=0, args=args@entry=0x7fffffff79e8) at ../../md5i/src/eval.c:2889
2889	    return funcall_subr (XSUBR (fun), numargs, args);
Value returned is $10 = (struct Lisp_X *) 0x6
Run till exit from #0  0x0000555555754a9e in funcall_general (
    fun=<optimized out>, numargs=numargs@entry=0, 
    args=args@entry=0x7fffffff79e8) at ../../md5i/src/eval.c:2889
Ffuncall (nargs=1, args=0x7fffffff79e0) at ../../md5i/src/eval.c:2945
2945	  lisp_eval_depth--;
Value returned is $11 = (struct Lisp_X *) 0x6
Run till exit from #0  Ffuncall (nargs=1, args=0x7fffffff79e0)
    at ../../md5i/src/eval.c:2945
0x00007fffec91187a in F632d666f72776172642d6e6f6973652d636c61757365_c_forward_noise_clause_0 () from /home/md5i/.config/emacs/eln-cache/29.0.50-0e65c843/cc-engine-ccfcb170-09002edc.eln
Value returned is $12 = (struct Lisp_X *) 0x6
Run till exit from #0  0x00007fffec91187a in F632d666f72776172642d6e6f6973652d636c61757365_c_forward_noise_clause_0 ()
   from /home/md5i/.config/emacs/eln-cache/29.0.50-0e65c843/cc-engine-ccfcb170-09002edc.eln
0x0000555555756b79 in funcall_subr (subr=0x555555ec5660, numargs=numargs@entry=0, args=args@entry=0x7fffffff7b40) at ../../md5i/src/eval.c:2979
2979		      return subr->function.a0 ();
"c-forward-noise-clause" (0xffff7b40)
"c-forward-declarator" (0xffff7ca8)
"c-fl-decl-end" (0xffff7de8)
"c-context-expand-fl-region" (0xee5920a8)
0x56429cf0 PVEC_COMPILED
"c-before-context-fl-expand-region" (0xffff82a8)
"c-font-lock-fontify-region" (0xffff8438)
"font-lock-fontify-region" (0xee592040)
0x55e86658 PVEC_COMPILED
"jit-lock--run-functions" (0xffff88b8)
"jit-lock-fontify-now" (0xffff8a58)
"jit-lock-function" (0xffff8ba8)
"redisplay_internal (C function)" (0x0)
Run till exit from #0  0x0000555555756b79 in funcall_subr (
    subr=0x555555ec5660, numargs=numargs@entry=0, 
    args=args@entry=0x7fffffff7b40) at ../../md5i/src/eval.c:2979
0x0000555555754a9e in funcall_general (fun=<optimized out>, numargs=numargs@entry=0, args=args@entry=0x7fffffff7b40) at ../../md5i/src/eval.c:2889
2889	    return funcall_subr (XSUBR (fun), numargs, args);
Value returned is $13 = (struct Lisp_X *) 0x30
Run till exit from #0  0x0000555555754a9e in funcall_general (
    fun=<optimized out>, numargs=numargs@entry=0, 
    args=args@entry=0x7fffffff7b40) at ../../md5i/src/eval.c:2889
Ffuncall (nargs=1, args=0x7fffffff7b38) at ../../md5i/src/eval.c:2945
2945	  lisp_eval_depth--;
Value returned is $14 = (struct Lisp_X *) 0x30
Run till exit from #0  Ffuncall (nargs=1, args=0x7fffffff7b38)
    at ../../md5i/src/eval.c:2945
0x00007fffec91d397 in F632d666f72776172642d6465636c617261746f72_c_forward_declarator_0 () from /home/md5i/.config/emacs/eln-cache/29.0.50-0e65c843/cc-engine-ccfcb170-09002edc.eln
Value returned is $15 = (struct Lisp_X *) 0x30
Run till exit from #0  0x00007fffec91d397 in F632d666f72776172642d6465636c617261746f72_c_forward_declarator_0 ()
   from /home/md5i/.config/emacs/eln-cache/29.0.50-0e65c843/cc-engine-ccfcb170-09002edc.eln

In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0)
 of 2022-06-02 built on miko
Repository revision: 8f279c8666dc642ed1f8f49aa709530fcea47374
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12004000
System Description: Debian GNU/Linux bookworm/sid

Configured using:
 'configure --without-toolkit-scroll-bars --with-x-toolkit=lucid
 --with-native-compilation --with-xinput2 'CFLAGS=-Og -ggdb''

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

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

Major mode: Lisp Interaction

Minor modes in effect:
  flyspell-mode: t
  display-time-mode: t
  magit-wip-initial-backup-mode: t
  magit-wip-before-change-mode: t
  magit-wip-after-apply-mode: t
  magit-wip-after-save-mode: t
  magit-wip-mode: t
  global-git-commit-mode: t
  magit-auto-revert-mode: t
  shell-dirtrack-mode: t
  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
  line-number-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
/home/md5i/.config/emacs/elpa/transient-20220514.945/transient hides /home/md5i/src/emacs/md5i/lisp/transient

Features:
(shadow sort mail-extr gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime
smime gnutls dig gnus-sum shr pixel-fill kinsoku url-file url-dired svg
gnus-group gnus-undo gnus-start gnus-dbus gnus-cloud gnus-spec gnus-win
emacsbug flyspell ispell view pacproxy descr-text tramp tramp-loaddefs
trampver tramp-integration cus-edit pp cus-load files-x tramp-compat
parse-time iso8601 ls-lisp time sieve-manage sasl sasl-anonymous
sasl-login sasl-plain rng-loc rng-uri rng-parse rng-match rng-dt
rng-util rng-pttrn nxml-parse nxml-ns nxml-enc xmltok nxml-util
sgml-mode facemenu dom python ps-print ps-print-loaddefs ps-def lpr
picture nm dbus xml magit-submodule magit-obsolete 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 easy-mmode git-commit log-edit pcvs-util add-log magit-core
magit-autorevert autorevert filenotify magit-margin magit-transient
magit-process with-editor shell pcomplete server magit-mode transient
comp comp-cstr warnings rx cl-extra edmacro kmacro help-mode magit-git
magit-base magit-section format-spec crm dash compat-27 compat-26 compat
nnimap nnmail gnus-int mail-source gnus-range message sendmail
yank-media rfc822 mml mml-sec epa mm-decode mm-bodies mm-encode
mailabbrev gmm-utils mailheader utf7 netrc nnoo gnus wid-edit nnheader
gnus-util time-date mail-utils range gnus-o365-oauth2 oauth2 url-http
url-auth mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums
mail-prsvr url-gw nsm rmc puny plstore generated generic-x epg rfc6068
epg-config ediff ediff-merg ediff-mult ediff-wind ediff-diff ediff-help
ediff-init ediff-util dired-x dired dired-loaddefs compile
text-property-search comint ring ansi-color cc-mode cc-fonts cc-guess
cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs derived
debian-el info package browse-url url url-proxy url-privacy url-expand
url-methods url-history url-cookie url-domsuf url-util mailcap
url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache json map url-vars seq gv subr-x byte-opt
bytecomp byte-compile cconv cl-loaddefs cl-lib iso-transl tooltip eldoc
paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode
mwheel term/x-win x-win term/common-win x-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 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 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 x-toolkit xinput2 x multi-tty
make-network-process native-compile emacs)

Memory information:
((conses 16 447554 18766)
 (symbols 48 26788 2)
 (strings 32 133201 15134)
 (string-bytes 1 4589077)
 (vectors 16 85150)
 (vector-slots 8 1194859 35646)
 (floats 8 907 430)
 (intervals 56 433 53)
 (buffers 992 15))

-- 
Michael Welsh Duggan
([email-masked])