Subject: bug#32502: 27.0.50; Tramp; C-g during asynchronous remote find-file kills Emacs

From: Gemini Lasswell <[email-masked]>
Date: Wed, 22 Aug 2018 11:19:34 -0700

This bug report is against the feature/tramp-thread-safe branch,
162353c45c.

C-g typed while Tramp is opening multiple remote files asynchronously
will sometimes cause Emacs to abort.

It's probably dependent on the timing of the C-g, and seems to either
happen the first time I try C-g or not at all.  I'm typing C-g fairly
soon after RET, but not as fast as I possibly could.  The remote machine
is on the local network and I'm running Emacs on a laptop with a
wireless network connection.  So far I've reproduced the bug twice in
about 8 attempts.  I currently have it in the debugger.

To reproduce, with emacs -Q and the Emacs source tree stored on a remote
machine:

C-x & C-x C-f /scp:server:src/emacs/lisp/emacs-lisp/*.el RET
C-g

Result:

#0  terminate_due_to_signal (sig=sig@entry=6, backtrace_limit=backtrace_limit@entry=40) at emacs.c:368
#1  0x0000000000511833 in emacs_abort () at sysdep.c:2426
#2  0x000000000057114d in signal_or_quit (error_symbol=XIL(0xaaa0), data=XIL(0), keyboard_quit=keyboard_quit@entry=false) at eval.c:1612
#3  0x000000000057115b in Fsignal (error_symbol=<optimized out>, data=<optimized out>) at eval.c:1582
#4  0x00000000005d5555 in post_acquire_global_lock (self=self@entry=0xc19320 <main_thread>) at thread.c:93
#5  0x00000000005d578a in acquire_global_lock (self=0xc19320 <main_thread>) at thread.c:101
#6  really_call_select (arg=0x7ffe202d8ab0) at thread.c:582
#7  0x00000000005d64e9 in thread_select (func=<optimized out>, max_fds=max_fds@entry=11, rfds=rfds@entry=0x7ffe202d8b90, wfds=<optimized out>, efds=efds@entry=0x0, timeout=timeout@entry=0x7ffe202d91b0, sigmask=0x0) at thread.c:602
#8  0x00000000005f1f44 in xg_select (fds_lim=11, rfds=rfds@entry=0x7ffe202d92b0, wfds=wfds@entry=0x7ffe202d9330, efds=efds@entry=0x0, timeout=timeout@entry=0x7ffe202d91b0, sigmask=sigmask@entry=0x0) at xgselect.c:117
#9  0x00000000005b7328 in wait_reading_process_output (time_limit=time_limit@entry=30, nsecs=nsecs@entry=0, read_kbd=read_kbd@entry=-1, do_display=do_display@entry=true, wait_for_cell=wait_for_cell@entry=XIL(0), wait_proc=wait_proc@entry=0x0, just_wait_proc=0) at process.c:5384
#10 0x0000000000424000 in sit_for (timeout=<optimized out>, reading=reading@entry=true, display_option=display_option@entry=1) at dispnew.c:5801
#11 0x00000000005042c6 in read_char (commandflag=commandflag@entry=1, map=map@entry=XIL(0x4d90c43), prev_event=XIL(0), used_mouse_menu=used_mouse_menu@entry=0x7ffe202d9bab, end_time=end_time@entry=0x0) at keyboard.c:2688
#12 0x000000000050491b in read_key_sequence (keybuf=keybuf@entry=0x7ffe202d9ce0, prompt=prompt@entry=XIL(0), dont_downcase_last=dont_downcase_last@entry=false, can_return_switch_frame=can_return_switch_frame@entry=true, fix_current_buffer=fix_current_buffer@entry=true, prevent_redisplay=prevent_redisplay@entry=false) at keyboard.c:9108
#13 0x00000000005062fa in command_loop_1 () at keyboard.c:1338
#14 0x000000000056f6ef in internal_condition_case (bfun=bfun@entry=0x506100 <command_loop_1>, handlers=handlers@entry=XIL(0x5340), hfun=hfun@entry=0x4fae20 <cmd_error>) at eval.c:1349
#15 0x00000000004f77e8 in command_loop_2 (ignore=ignore@entry=XIL(0)) at keyboard.c:1079
#16 0x000000000056f653 in internal_catch (tag=tag@entry=XIL(0xc990), func=func@entry=0x4f77c0 <command_loop_2>, arg=arg@entry=XIL(0)) at eval.c:1114
#17 0x00000000004f7776 in command_loop () at keyboard.c:1058
#18 0x00000000004faa0f in recursive_edit_1 () at keyboard.c:703
#19 0x00000000004fad48 in Frecursive_edit () at keyboard.c:774
#20 0x000000000041a353 in main (argc=<optimized out>, argv=0x7ffe202da098) at emacs.c:1756

In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.28)
 of 2018-08-21 built on sockeye
Repository revision: 162353c45cf7ae8c5626a5062c247a793e30e7d0
Windowing system distributor 'The X.Org Foundation', version 11.0.11906000
System Description: NixOS 18.03.git.bd06547 (Impala)

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.

Configured using:
 'configure --prefix=/home/gem/src/emacs/tramp/bin --with-modules
 --with-x-toolkit=gtk3 --with-xft --config-cache'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GSETTINGS NOTIFY
LIBSELINUX GNUTLS LIBXML2 FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11
MODULES THREADS LCMS2 GMP

Important settings:
  value of $EMACSLOADPATH: 
  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
  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
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny seq byte-opt gv
bytecomp byte-compile cconv dired dired-loaddefs format-spec rfc822 mml
easymenu mml-sec password-cache epa derived epg epg-config gnus-util
rmail rmail-loaddefs 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 elec-pair time-date
mule-util 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 menu-bar
rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core term/tty-colors frame 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 minibuffer
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
move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 94963 7770)
 (symbols 48 20145 1)
 (strings 32 28303 1519)
 (string-bytes 1 756774)
 (vectors 16 14934)
 (vector-slots 8 508714 14278)
 (floats 8 48 69)
 (intervals 56 208 0)
 (buffers 992 11))