Subject: Re: bug#60796: 27.1; Opening file ending in .sh inside a directory ending in .deb causes hang/100% thread usage

From: Ruijie Yu <[email-masked]>
Date: Fri, 13 Jan 2023 21:15:00 -0600

Casey Connor via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <[email-masked]> writes:

> When I do this:
>
> $ mkdir test.deb
> $ cd test.deb
> $ emacs -Q test.sh
>
> ...emacs opens but is hung: 100% usage of a core, apparently
> indefinitely. So far it seems to be the case that the directory must end
> in ".deb" and the file edited must end in ".sh".
>
>
> In GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.30, cairo
> version 1.16.0)
> of 2022-01-24, modified by Debian built on lgw01-amd64-048
> System Description: Ubuntu 22.10
>
> Recent messages:
> Package autoconf removed but not purged. Skipping setup.
> Loading /etc/emacs/site-start.d/50autoconf.el (source)...done
> Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
> Loading debian-ispell...
> Loading /var/cache/dictionaries-common/emacsen-ispell-default.el (source)...done
> Loading debian-ispell...done
> Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...done
> Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...done
> For information about GNU Emacs and the GNU system, type C-h C-a.
> Making completion list...
>
> Configured using:
> 'configure --build x86_64-linux-gnu --prefix=/usr
> --sharedstatedir=/var/lib --libexecdir=/usr/lib
> --localstatedir=/var/lib --infodir=/usr/share/info
> --mandir=/usr/share/man --enable-libsystemd --with-pop=yes
> --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/27.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/27.1/site-lisp:/usr/share/emacs/site-lisp
>   --with-sound=alsa --without-gconf --with-mailutils --build
> x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib
> --libexecdir=/usr/lib --localstatedir=/var/lib
> --infodir=/usr/share/info --mandir=/usr/share/man --enable-libsystemd
> --with-pop=yes
> --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/27.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/27.1/site-lisp:/usr/share/emacs/site-lisp
>   --with-sound=alsa --without-gconf --with-mailutils --with-cairo
> --with-x=yes --with-x-toolkit=gtk3 --with-toolkit-scroll-bars
> 'CFLAGS=-g -O2
> -ffile-prefix-map=/build/emacs-NbbgEv/emacs-27.1+1=. -fstack-protector-strong
> -Wformat -Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time
> -D_FORTIFY_SOURCE=2' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro''
>
> Configured features:
> XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB NOTIFY
> INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF
> ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS LIBSYSTEMD
> JSON PDUMPER LCMS2 GMP
>
> Important settings:
> value of $LANG: en_US.UTF-8
> locale-coding-system: utf-8-unix
>
> Major mode: Lisp Interaction
>
> Minor modes in effect:
> cl-old-struct-compat-mode: t
> tooltip-mode: t
> global-eldoc-mode: t
> eldoc-mode: t
> mouse-wheel-mode: t
> tool-bar-mode: t
> file-name-shadow-mode: t
> global-font-lock-mode: t
> font-lock-mode: t
> auto-composition-mode: t
> auto-encryption-mode: t
> auto-compression-mode: t
> column-number-mode: t
> line-number-mode: t
> transient-mark-mode: t
>
> Load-path shadows:
> /usr/share/emacs/site-lisp/elpa/cmake-mode-3.24.2/cmake-mode-pkg hides
> /usr/share/emacs/site-lisp/elpa-src/cmake-mode-3.24.2/cmake-mode-pkg
> /usr/share/emacs/site-lisp/elpa/cmake-mode-3.24.2/cmake-mode hides
> /usr/share/emacs/site-lisp/elpa-src/cmake-mode-3.24.2/cmake-mode
> /usr/share/emacs/site-lisp/elpa/cmake-mode-3.24.2/cmake-mode-autoloads hides
> /usr/share/emacs/site-lisp/elpa-src/cmake-mode-3.24.2/cmake-mode-autoloads
>
> Features:
> (shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
> format-spec rfc822 mml mml-sec epa derived epg epg-config gnus-util
> rmail rmail-loaddefs text-property-search time-date mm-decode mm-bodies
> mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
> rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils term/xterm
> xterm cus-edit cus-start cus-load wid-edit darktooth-theme autothemer
> dash finder-inf edmacro kmacro package easymenu browse-url url-handlers
> url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
> password-cache json subr-x map url-vars seq byte-opt gv bytecomp
> byte-compile cconv cl-loaddefs cl-lib tooltip eldoc electric uniquify
> ediff-hook vc-hooks lisp-float-type 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 elisp-mode lisp-mode
> prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer
> select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
> term/tty-colors frame minibuffer cl-generic 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 charscript charprop case-table epa-hook
> jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice loaddefs
> button faces cus-face macroexp files text-properties overlay sha1 md5
> base64 format env code-pages mule custom widget hashtable-print-readable
> backquote threads dbusbind inotify lcms2 dynamic-setting
> system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit
> x multi-tty make-network-process emacs)
>
> Memory information:
> ((conses 16 170009 7221)
> (symbols 48 14131 1)
> (strings 32 48178 1329)
> (string-bytes 1 1318531)
> (vectors 16 16147)
> (vector-slots 8 204540 7548)
> (floats 8 36 561)
> (intervals 56 262 0)
> (buffers 1000 12))

This issue seems to have gone away for my emacs 29 build.  Will try and
see if 27.2 has this issue.

------------------------------------------------------------------------
In GNU Emacs 29.0.60 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.36, cairo version 1.17.6) of 2023-01-05 built on ruijie
Repository revision: 8a18369afdc3a873881e7b19b75e94ca96791c84
Repository branch: makepkg
System Description: Arch Linux

Configured using:
 'configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
 --localstatedir=/var --mandir=/usr/share/man --with-gameuser=:games
 --with-modules --without-libotf --without-m17n-flt --without-gconf
 --with-native-compilation=yes --with-xinput2 --with-pgtk
 --without-xaw3d --with-sound=no --with-tree-sitter --without-gpm
 --without-compress-install
 '--program-transform-name=s/\([ec]tags\)/\1.emacs/'
 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions
 -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security
 -fstack-clash-protection -fcf-protection'
 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'

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

Best,

RY