GNU bug report logs - #29370
27.0.50; C-g hang

Previous Next

Package: emacs;

Reported by: rms <at> gnu.org

Date: Mon, 20 Nov 2017 21:53:01 UTC

Severity: normal

Merged with 29347

Found in version 27.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 29370 in the body.
You can then email your comments to 29370 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#29370; Package emacs. (Mon, 20 Nov 2017 21:53:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to rms <at> gnu.org:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 20 Nov 2017 21:53:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Richard Stallman <rms <at> gnu.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.50; C-g hang
Date: Mon, 20 Nov 2017 16:52:00 -0500
It hung again.  I did kill -TSTP and got this backtrace.

I went to frame 4 and type  finish
and it never finished.

I went to frame 10 and typed  return Qnil
and now it is running ok again.

However, now C-g always fails to exit the minibuffer.
It also fails to deactivate the mark.

#0  __lll_lock_wait ()
    at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:135
#1  0x00007ffff2bfe649 in _L_lock_909 ()
   from /lib/x86_64-linux-gnu/libpthread.so.0
#2  0x00007ffff2bfe470 in __GI___pthread_mutex_lock (
    mutex=0xcb3420 <global_lock>) at ../nptl/pthread_mutex_lock.c:79
#3  0x0000000000684676 in sys_mutex_lock (mutex=0xcb3420 <global_lock>)
    at systhread.c:106
#4  0x0000000000682fc3 in acquire_global_lock (self=0xcb3220 <main_thread>)
    at thread.c:100
#5  0x00000000006839b9 in really_call_select (arg=0x7fffffffb010)
    at thread.c:576
#6  0x00000000005e071f in flush_stack_call_func (
    func=0x6838eb <really_call_select>, arg=0x7fffffffb010) at alloc.c:5222
#7  0x0000000000683a3e in thread_select (func=0x413520 <pselect <at> plt>, 
    max_fds=9, rfds=0x7fffffffb110, wfds=0x7fffffffb190, efds=0x0, 
    timeout=0x7fffffffb720, sigmask=0x0) at thread.c:595
#8  0x00000000006ac32e in xg_select (fds_lim=9, rfds=0x7fffffffb770, 
    wfds=0x7fffffffb7f0, efds=0x0, timeout=0x7fffffffb720, sigmask=0x0)
    at xgselect.c:117
#9  0x000000000066090b in wait_reading_process_output (time_limit=2, nsecs=0, 
    read_kbd=1, do_display=true, wait_for_cell=XIL(0), wait_proc=0x0, 
    just_wait_proc=0) at process.c:5375
#10 0x0000000000421acd in sit_for (timeout=make_number(2), reading=false, 
    display_option=2) at dispnew.c:5793
#11 0x000000000055faeb in command_loop_1 () at keyboard.c:1340
#12 0x0000000000604da3 in internal_condition_case (
    bfun=0x55f817 <command_loop_1>, handlers=XIL(0x5250), 
    hfun=0x55efce <cmd_error>) at eval.c:1332
#13 0x000000000055f512 in command_loop_2 (ignore=XIL(0)) at keyboard.c:1110
#14 0x000000000060469b in internal_catch (tag=XIL(0x54f0), 
    func=0x55f4e9 <command_loop_2>, arg=XIL(0)) at eval.c:1097
#15 0x000000000055f449 in command_loop () at keyboard.c:1081
#16 0x000000000055ebb3 in recursive_edit_1 () at keyboard.c:695
#17 0x000000000059fa33 in read_minibuf (map=XIL(0x117aa43), initial=XIL(0), 
    prompt=XIL(0x7fffe8c98344), expflag=false, histvar=XIL(0x577590), 
    histpos=make_number(0), defalt=XIL(0), allow_props=false, 
    inherit_input_method=false) at minibuf.c:685
#18 0x00000000005a051e in Fread_from_minibuffer (prompt=XIL(0x7fffe8c98344), 
    initial_contents=XIL(0), keymap=XIL(0x117aa43), read=XIL(0), 
    hist=XIL(0x577590), default_value=XIL(0), inherit_input_method=XIL(0))
    at minibuf.c:992
#19 0x00000000006087f3 in funcall_subr (subr=0x9314a0 <Sread_from_minibuffer>, 
    numargs=5, args=0x7fffffffc158) at eval.c:2862
#20 0x00000000006082de in Ffuncall (nargs=6, args=0x7fffffffc150)
    at eval.c:2767
#21 0x00000000006072d3 in Fapply (nargs=7, args=0x7fffffffc150) at eval.c:2340
#22 0x00000000006085b4 in funcall_subr (subr=0xc404c0 <Sapply>, numargs=7, 
    args=0x7fffffffc150) at eval.c:2822
#23 0x00000000006082de in Ffuncall (nargs=8, args=0x7fffffffc148)
    at eval.c:2767
#24 0x000000000065198e in exec_byte_code (bytestr=XIL(0x9fa97c), 
    vector=XIL(0x9fa99d), maxdepth=make_number(14), 
    args_template=make_number(897), nargs=3, args=0x7fffffffc630)
    at bytecode.c:629
#25 0x0000000000608cd6 in funcall_lambda (fun=XIL(0x9fa94d), nargs=3, 
    arg_vector=0x7fffffffc618) at eval.c:2968
#26 0x0000000000608322 in Ffuncall (nargs=4, args=0x7fffffffc610)
    at eval.c:2769
#27 0x0000000000607765 in Fapply (nargs=2, args=0x7fffffffc818) at eval.c:2387
#28 0x00000000006085b4 in funcall_subr (subr=0xc404c0 <Sapply>, numargs=2, 
    args=0x7fffffffc818) at eval.c:2822
#29 0x00000000006082de in Ffuncall (nargs=3, args=0x7fffffffc810)
    at eval.c:2767
#30 0x000000000065198e in exec_byte_code (bytestr=XIL(0x16aec44), 
    vector=XIL(0x141f255), maxdepth=make_number(19), 
    args_template=make_number(1156), nargs=7, args=0x7fffffffce08)
    at bytecode.c:629
#31 0x0000000000608cd6 in funcall_lambda (fun=XIL(0x141f385), nargs=7, 
    arg_vector=0x7fffffffcde8) at eval.c:2968
#32 0x0000000000608322 in Ffuncall (nargs=8, args=0x7fffffffcde0)
    at eval.c:2769
#33 0x000000000065198e in exec_byte_code (bytestr=XIL(0x7fffe8c982a4), 
    vector=XIL(0x7fffe9a62f45), maxdepth=make_number(13), 
    args_template=make_number(771), nargs=3, args=0x7fffffffd2f0)
    at bytecode.c:629
#34 0x0000000000608cd6 in funcall_lambda (fun=XIL(0x7fffe9a66da5), nargs=3, 
    arg_vector=0x7fffffffd2d8) at eval.c:2968
#35 0x0000000000608322 in Ffuncall (nargs=4, args=0x7fffffffd2d0)
    at eval.c:2769
#36 0x000000000065198e in exec_byte_code (bytestr=XIL(0x7fffe8ee40b4), 
    vector=XIL(0x7fffea258735), maxdepth=make_number(5), args_template=XIL(0), 
    nargs=0, args=0x0) at bytecode.c:629
#37 0x0000000000650c7a in Fbyte_code (bytestr=XIL(0x7fffe8ee40b4), 
    vector=XIL(0x7fffea258735), maxdepth=make_number(5)) at bytecode.c:321
#38 0x0000000000606e45 in eval_sub (form=XIL(0x7fffe8fcfa13)) at eval.c:2238
#39 0x000000000060641e in Feval (form=XIL(0x7fffe8fcfa13), lexical=XIL(0))
    at eval.c:2052
#40 0x00000000006003d1 in Fcall_interactively (function=XIL(0x9c0020), 
    record_flag=XIL(0), keys=XIL(0x7fffea2c4725)) at callint.c:357
#41 0x00000000006086ce in funcall_subr (subr=0xc3fd00 <Scall_interactively>, 
    numargs=3, args=0x7fffffffdb00) at eval.c:2847
#42 0x00000000006082de in Ffuncall (nargs=4, args=0x7fffffffdaf8)
    at eval.c:2767
#43 0x000000000065198e in exec_byte_code (bytestr=XIL(0x9f7bbc), 
    vector=XIL(0x9f7bdd), maxdepth=make_number(13), 
    args_template=make_number(1025), nargs=1, args=0x7fffffffe040)
    at bytecode.c:629
#44 0x0000000000608cd6 in funcall_lambda (fun=XIL(0x9f7b8d), nargs=1, 
    arg_vector=0x7fffffffe038) at eval.c:2968
#45 0x0000000000608322 in Ffuncall (nargs=2, args=0x7fffffffe030)
    at eval.c:2769
#46 0x0000000000607d03 in call1 (fn=XIL(0x3f00), arg1=XIL(0x9c0020))
    at eval.c:2618
#47 0x000000000055fff2 in command_loop_1 () at keyboard.c:1482
#48 0x0000000000604da3 in internal_condition_case (
    bfun=0x55f817 <command_loop_1>, handlers=XIL(0x5250), 
    hfun=0x55efce <cmd_error>) at eval.c:1332
#49 0x000000000055f512 in command_loop_2 (ignore=XIL(0)) at keyboard.c:1110
#50 0x000000000060469b in internal_catch (tag=XIL(0xc720), 
    func=0x55f4e9 <command_loop_2>, arg=XIL(0)) at eval.c:1097
#51 0x000000000055f4b2 in command_loop () at keyboard.c:1089
#52 0x000000000055ebb3 in recursive_edit_1 () at keyboard.c:695
#53 0x000000000055ed2b in Frecursive_edit () at keyboard.c:766
#54 0x000000000055ca35 in main (argc=3, argv=0x7fffffffe4f8) at emacs.c:1711

Lisp Backtrace:
"read-from-minibuffer" (0xffffc158)
"apply" (0xffffc150)
"read-shell-command" (0xffffc618)
"apply" (0xffffc818)
"dired-mark-pop-up" (0xffffcde8)
"dired-read-shell-command" (0xffffd2d8)
"byte-code" (0xffffd740)
"call-interactively" (0xffffdb00)
"command-execute" (0xffffe038)



In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 2.24.23)
 of 2017-11-15 built on freetop
Repository revision: 52d822f31bc7cb57694c1e209b2d02e5efb8f48c
System Description:	Trisquel GNU/Linux 7.0, Belenos

Recent messages:
Saving file /home/rms/outgoing/out-73...
Wrote /home/rms/outgoing/out-73
Saving file /home/rms/outgoing/out-65...
Wrote /home/rms/outgoing/out-65
Saving file /home/rms/outgoing/out-60...
Wrote /home/rms/outgoing/out-60
Saving file /home/rms/outgoing/out-59...
Wrote /home/rms/outgoing/out-59
(No changes need to be saved)
delete-backward-char: Text is read-only
Quit
Configured using:
 'configure 'CFLAGS=-O0 -g' --with-gnutls=no'

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND GPM DBUS GSETTINGS NOTIFY LIBXML2
FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK2 X11

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

Major mode: Dired by date

Minor modes in effect:
  diff-auto-refine-mode: t
  shell-dirtrack-mode: t
  gpm-mouse-mode: t
  tooltip-mode: t
  global-eldoc-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
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t
  abbrev-mode: t

Load-path shadows:
None found.

Features:
(shadow emacsbug dired-aux compare-w diff-mode easy-mmode pcmpl-unix
cl-extra parse-time vc-cvs mhtml-mode css-mode smie color eww mm-url
gnus nnheader wid-edit url-queue url url-proxy url-privacy url-expand
url-methods url-history url-cookie url-domsuf mailcap js json map
imenu cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align
cc-engine cc-vars cc-defs sgml-mode flyspell ispell shell pcomplete
thingatpt grep compile comint ansi-color ring url-util shr svg xml dom
browse-url rmailsum rmailout epa-mail rmailkwd misearch multi-isearch
quail help-mode mailalias qp dabbrev mule-util rmailmm message
sendmail rmc puny format-spec rfc822 mml mml-sec epa epg gnus-util
mm-decode mm-bodies mm-encode mailabbrev gmm-utils mailheader
mail-parse rfc2231 rmail rmail-loaddefs rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils dired dired-loaddefs t-mouse term/linux
elec-pair view derived time-date paren cus-start cus-load advice
finder-inf package easymenu epg-config url-handlers url-parse
auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache 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 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
dbusbind inotify dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)

Memory information:
((conses 16 445279 97795)
 (symbols 48 30288 1)
 (miscs 40 2520 3406)
 (strings 32 73497 12094)
 (string-bytes 1 1961437)
 (vectors 16 34747)
 (vector-slots 8 1520040 163484)
 (floats 8 258 628)
 (intervals 56 72924 992)
 (buffers 992 199)
 (heap 1024 42909 12976))
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]


-- 
Dr Richard Stallman
President, Free Software Foundation (https://gnu.org, https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)
Skype: No way! See https://stallman.org/skype.html.





Merged 29347 29370. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 20 Nov 2017 22:03:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29370; Package emacs. (Tue, 21 Nov 2017 15:36:02 GMT) Full text and rfc822 format available.

Message #10 received at 29370 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: rms <at> gnu.org
Cc: 29370 <at> debbugs.gnu.org
Subject: Re: bug#29370: 27.0.50; C-g hang
Date: Tue, 21 Nov 2017 17:34:41 +0200
> From: Richard Stallman <rms <at> gnu.org>
> Date: Mon, 20 Nov 2017 16:52:00 -0500
> 
> It hung again.  I did kill -TSTP and got this backtrace.
> 
> I went to frame 4 and type  finish
> and it never finished.
> 
> I went to frame 10 and typed  return Qnil
> and now it is running ok again.
> 
> However, now C-g always fails to exit the minibuffer.

By "always" you mean even when it doesn't hang Emacs?  If so, can you
show a backtrace in that situation, i.e. Emacs that is not hung, but
with cursor in the minibuffer that would stay there if you type C-g?

> #0  __lll_lock_wait ()
>     at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:135
> #1  0x00007ffff2bfe649 in _L_lock_909 ()
>    from /lib/x86_64-linux-gnu/libpthread.so.0
> #2  0x00007ffff2bfe470 in __GI___pthread_mutex_lock (
>     mutex=0xcb3420 <global_lock>) at ../nptl/pthread_mutex_lock.c:79
> #3  0x0000000000684676 in sys_mutex_lock (mutex=0xcb3420 <global_lock>)
>     at systhread.c:106
> #4  0x0000000000682fc3 in acquire_global_lock (self=0xcb3220 <main_thread>)
>     at thread.c:100
> #5  0x00000000006839b9 in really_call_select (arg=0x7fffffffb010)
>     at thread.c:576
> #6  0x00000000005e071f in flush_stack_call_func (
>     func=0x6838eb <really_call_select>, arg=0x7fffffffb010) at alloc.c:5222
> #7  0x0000000000683a3e in thread_select (func=0x413520 <pselect <at> plt>, 
>     max_fds=9, rfds=0x7fffffffb110, wfds=0x7fffffffb190, efds=0x0, 
>     timeout=0x7fffffffb720, sigmask=0x0) at thread.c:595
> #8  0x00000000006ac32e in xg_select (fds_lim=9, rfds=0x7fffffffb770, 
>     wfds=0x7fffffffb7f0, efds=0x0, timeout=0x7fffffffb720, sigmask=0x0)
>     at xgselect.c:117
> #9  0x000000000066090b in wait_reading_process_output (time_limit=2, nsecs=0, 
>     read_kbd=1, do_display=true, wait_for_cell=XIL(0), wait_proc=0x0, 
>     just_wait_proc=0) at process.c:5375
> #10 0x0000000000421acd in sit_for (timeout=make_number(2), reading=false, 
>     display_option=2) at dispnew.c:5793

Can you show what's in recent_keys, when Emacs is stuck ("hung") like
this?  Also, do you remember if, before "kill -TSTP" you typed C-g
once or more than once?

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29370; Package emacs. (Wed, 22 Nov 2017 22:55:01 GMT) Full text and rfc822 format available.

Message #13 received at 29370 <at> debbugs.gnu.org (full text, mbox):

From: Richard Stallman <rms <at> gnu.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 29370 <at> debbugs.gnu.org
Subject: Re: bug#29370: 27.0.50; C-g hang
Date: Wed, 22 Nov 2017 17:54:11 -0500
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > > However, now C-g always fails to exit the minibuffer.

  > By "always" you mean even when it doesn't hang Emacs?

Correct.
							   If so, can you
  > show a backtrace in that situation, i.e. Emacs that is not hung, but
  > with cursor in the minibuffer that would stay there if you type C-g?

See below.

I have a hunch that the problem is that the signal handler got deactivated.
That makes C-g a no-op for the rest of the session.  But this could be
caused by the way I get Emacs unhung.  I don't think this explains the
original failure.

  >   Also, do you remember if, before "kill -TSTP" you typed C-g
  > once or more than once?

Surely more than once.  It would have been my reflex reaction.

This time I think I typed it just once, and this was the relevant
part of C-h l output.


 SPC [self-insert-command]
 t [self-insert-command]
 h [self-insert-command]
 e [self-insert-command]
 SPC [self-insert-command]
 r [self-insert-command]
 e [self-insert-command]
 l [self-insert-command]
 a [self-insert-command]
 t [self-insert-command]
 ESC / [dabbrev-expand]
 . [self-insert-command]
 ESC k [kill-sentence]
 C-x C-s [save-buffer]
 C-c C-g [nil]
 C-g [abort-recursive-edit]
[This is where it hung]
 C-l [recenter-top-bottom]
 C-h l [view-lossage]

======================================================================
I made this backtrace after stopping Emacs while it was in a minibuffer
and C-g would not exit it.

Program received signal SIGTSTP, Stopped (user).
0x00007ffff265df07 in kill () at ../sysdeps/unix/syscall-template.S:81
81	in ../sysdeps/unix/syscall-template.S
#0  0x00007ffff265df07 in kill () at ../sysdeps/unix/syscall-template.S:81
#1  0x000000000057ebbd in sys_suspend () at sysdep.c:607
#2  0x00000000005722b4 in Fsuspend_emacs (stuffstring=XIL(0))
    at keyboard.c:10249
#3  0x0000000000608678 in funcall_subr (subr=0x92f8a0 <Ssuspend_emacs>, 
    numargs=0, args=0x7fffffffb1b8) at eval.c:2842
#4  0x00000000006082de in Ffuncall (nargs=1, args=0x7fffffffb1b0)
    at eval.c:2767
#5  0x000000000065198e in exec_byte_code (bytestr=XIL(0xa32c74), 
    vector=XIL(0xa32c95), maxdepth=make_number(3), 
    args_template=make_number(0), nargs=0, args=0x7fffffffb980)
    at bytecode.c:629
#6  0x0000000000608cd6 in funcall_lambda (fun=XIL(0xa32c35), nargs=0, 
    arg_vector=0x7fffffffb980) at eval.c:2968
#7  0x0000000000608322 in Ffuncall (nargs=1, args=0x7fffffffb978)
    at eval.c:2769
#8  0x000000000060010b in Ffuncall_interactively (nargs=1, args=0x7fffffffb978)
    at callint.c:252
#9  0x00000000006085b4 in funcall_subr (
    subr=0xc3fcc0 <Sfuncall_interactively>, numargs=1, args=0x7fffffffb978)
    at eval.c:2822
#10 0x00000000006082de in Ffuncall (nargs=2, args=0x7fffffffb970)
    at eval.c:2767
#11 0x00000000006072d3 in Fapply (nargs=3, args=0x7fffffffb970) at eval.c:2340
#12 0x0000000000600586 in Fcall_interactively (function=XIL(0x404130), 
    record_flag=XIL(0), keys=XIL(0x7fffe9a2af85)) at callint.c:389
#13 0x00000000006086ce in funcall_subr (subr=0xc3fd00 <Scall_interactively>, 
    numargs=3, args=0x7fffffffbb20) at eval.c:2847
#14 0x00000000006082de in Ffuncall (nargs=4, args=0x7fffffffbb18)
    at eval.c:2767
#15 0x000000000065198e in exec_byte_code (bytestr=XIL(0x9f7bbc), 
    vector=XIL(0x9f7bdd), maxdepth=make_number(13), 
    args_template=make_number(1025), nargs=1, args=0x7fffffffc060)
    at bytecode.c:629
#16 0x0000000000608cd6 in funcall_lambda (fun=XIL(0x9f7b8d), nargs=1, 
    arg_vector=0x7fffffffc058) at eval.c:2968
#17 0x0000000000608322 in Ffuncall (nargs=2, args=0x7fffffffc050)
    at eval.c:2769
#18 0x0000000000607d03 in call1 (fn=XIL(0x3f00), arg1=XIL(0x404130))
    at eval.c:2618
#19 0x000000000055fff2 in command_loop_1 () at keyboard.c:1482
#20 0x0000000000604da3 in internal_condition_case (
    bfun=0x55f817 <command_loop_1>, handlers=XIL(0x5250), 
    hfun=0x55efce <cmd_error>) at eval.c:1332
#21 0x000000000055f512 in command_loop_2 (ignore=XIL(0)) at keyboard.c:1110
#22 0x000000000060469b in internal_catch (tag=XIL(0x54f0), 
    func=0x55f4e9 <command_loop_2>, arg=XIL(0)) at eval.c:1097
#23 0x000000000055f449 in command_loop () at keyboard.c:1081
#24 0x000000000055ebb3 in recursive_edit_1 () at keyboard.c:695
#25 0x000000000059fa33 in read_minibuf (map=XIL(0x1114c53), initial=XIL(0), 
    prompt=XIL(0x7fffe813a554), expflag=false, histvar=XIL(0x32d0), 
    histpos=make_number(0), defalt=XIL(0x7fffe3ea80d4), allow_props=false, 
    inherit_input_method=false) at minibuf.c:685
#26 0x00000000005a051e in Fread_from_minibuffer (prompt=XIL(0x7fffe813a554), 
    initial_contents=XIL(0), keymap=XIL(0x1114c53), read=XIL(0), 
    hist=XIL(0x32d0), default_value=XIL(0x7fffe3ea80d4), 
    inherit_input_method=XIL(0)) at minibuf.c:992
#27 0x00000000006087f3 in funcall_subr (subr=0x9314a0 <Sread_from_minibuffer>, 
    numargs=7, args=0x7fffffffc640) at eval.c:2862
#28 0x00000000006082de in Ffuncall (nargs=8, args=0x7fffffffc638)
    at eval.c:2767
#29 0x000000000065198e in exec_byte_code (bytestr=XIL(0x9efa3c), 
    vector=XIL(0x9efa5d), maxdepth=make_number(18), 
    args_template=make_number(2050), nargs=8, args=0x7fffffffcb98)
    at bytecode.c:629
#30 0x0000000000608cd6 in funcall_lambda (fun=XIL(0x9efa0d), nargs=8, 
    arg_vector=0x7fffffffcb58) at eval.c:2968
#31 0x0000000000608322 in Ffuncall (nargs=9, args=0x7fffffffcb50)
    at eval.c:2769
#32 0x00000000005a1cce in Fcompleting_read (prompt=XIL(0x7fffe813a554), 
    collection=XIL(0x63d90), predicate=XIL(0), require_match=XIL(0x486aa0), 
    initial_input=XIL(0), hist=XIL(0x32d0), def=XIL(0x7fffe3ea80d4), 
    inherit_input_method=XIL(0)) at minibuf.c:1696
#33 0x00000000005a0b6c in Fread_buffer (prompt=XIL(0x7fffe813a554), 
    def=XIL(0x7fffe3ea80d4), require_match=XIL(0x486aa0), predicate=XIL(0))
    at minibuf.c:1169
#34 0x0000000000608705 in funcall_subr (subr=0x9315e0 <Sread_buffer>, 
    numargs=3, args=0x7fffffffcdc0) at eval.c:2850
#35 0x00000000006082de in Ffuncall (nargs=4, args=0x7fffffffcdb8)
    at eval.c:2767
#36 0x000000000065198e in exec_byte_code (bytestr=XIL(0x98033c), 
    vector=XIL(0x98035d), maxdepth=make_number(12), 
    args_template=make_number(257), nargs=1, args=0x7fffffffd2a0)
    at bytecode.c:629
#37 0x0000000000608cd6 in funcall_lambda (fun=XIL(0x98030d), nargs=1, 
    arg_vector=0x7fffffffd298) at eval.c:2968
#38 0x0000000000608322 in Ffuncall (nargs=2, args=0x7fffffffd290)
    at eval.c:2769
#39 0x000000000065198e in exec_byte_code (bytestr=XIL(0x98098c), 
    vector=XIL(0x9809bd), maxdepth=make_number(4), args_template=XIL(0), 
    nargs=0, args=0x0) at bytecode.c:629
#40 0x0000000000650c7a in Fbyte_code (bytestr=XIL(0x98098c), 
    vector=XIL(0x9809bd), maxdepth=make_number(4)) at bytecode.c:321
#41 0x0000000000606e45 in eval_sub (form=XIL(0x98096b)) at eval.c:2238
#42 0x000000000060641e in Feval (form=XIL(0x98096b), lexical=XIL(0))
    at eval.c:2052
#43 0x00000000006003d1 in Fcall_interactively (function=XIL(0x85420), 
    record_flag=XIL(0), keys=XIL(0x7fffe9a2af85)) at callint.c:357
#44 0x00000000006086ce in funcall_subr (subr=0xc3fd00 <Scall_interactively>, 
    numargs=3, args=0x7fffffffdb00) at eval.c:2847
#45 0x00000000006082de in Ffuncall (nargs=4, args=0x7fffffffdaf8)
    at eval.c:2767
#46 0x000000000065198e in exec_byte_code (bytestr=XIL(0x9f7bbc), 
    vector=XIL(0x9f7bdd), maxdepth=make_number(13), 
    args_template=make_number(1025), nargs=1, args=0x7fffffffe040)
    at bytecode.c:629
#47 0x0000000000608cd6 in funcall_lambda (fun=XIL(0x9f7b8d), nargs=1, 
    arg_vector=0x7fffffffe038) at eval.c:2968
#48 0x0000000000608322 in Ffuncall (nargs=2, args=0x7fffffffe030)
    at eval.c:2769
#49 0x0000000000607d03 in call1 (fn=XIL(0x3f00), arg1=XIL(0x85420))
    at eval.c:2618
#50 0x000000000055fff2 in command_loop_1 () at keyboard.c:1482
#51 0x0000000000604da3 in internal_condition_case (
    bfun=0x55f817 <command_loop_1>, handlers=XIL(0x5250), 
    hfun=0x55efce <cmd_error>) at eval.c:1332
#52 0x000000000055f512 in command_loop_2 (ignore=XIL(0)) at keyboard.c:1110
#53 0x000000000060469b in internal_catch (tag=XIL(0xc720), 
    func=0x55f4e9 <command_loop_2>, arg=XIL(0)) at eval.c:1097
#54 0x000000000055f4b2 in command_loop () at keyboard.c:1089
#55 0x000000000055ebb3 in recursive_edit_1 () at keyboard.c:695
#56 0x000000000055ed2b in Frecursive_edit () at keyboard.c:766
#57 0x000000000055ca35 in main (argc=3, argv=0x7fffffffe4f8) at emacs.c:1711

Lisp Backtrace:
"suspend-emacs" (0xffffb1b8)
"suspend-frame" (0xffffb980)
"funcall-interactively" (0xffffb978)
"call-interactively" (0xffffbb20)
"command-execute" (0xffffc058)
"read-from-minibuffer" (0xffffc640)
"completing-read-default" (0xffffcb58)
"read-buffer" (0xffffcdc0)
"read-buffer-to-switch" (0xffffd298)
"byte-code" (0xffffd740)
"call-interactively" (0xffffdb00)
"command-execute" (0xffffe038)


-- 
Dr Richard Stallman
President, Free Software Foundation (https://gnu.org, https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)
Skype: No way! See https://stallman.org/skype.html.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29370; Package emacs. (Fri, 24 Nov 2017 16:19:02 GMT) Full text and rfc822 format available.

Message #16 received at 29370 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Mike Gerwitz <mtg <at> gnu.org>
Cc: 29370 <at> debbugs.gnu.org, 29347 <at> debbugs.gnu.org, rms <at> gnu.org
Subject: Re: bug#29347: 27.0.50; C-g doesn't quit minibuffer
Date: Fri, 24 Nov 2017 18:17:58 +0200
> From: Mike Gerwitz <mtg <at> gnu.org>
> Cc: rms <at> gnu.org,  29347 <at> debbugs.gnu.org
> Date: Mon, 20 Nov 2017 15:26:36 -0500
> 
> On Mon, Nov 20, 2017 at 20:36:38 +0200, Eli Zaretskii wrote:
> >> I can reproduce it simply with `emacs -Q -nsl -nw' (it must be a TTY;
> >> GUI emacs does not suffer from this bug): quickly press `C-f C-f C-g'.
> >
> > Do you mean "C-x C-f C-g"?
> 
> I'm sorry, I meant `C-x C-f C-x C-f C-g` (attempt a recursive
> minibuffer).  I was in a rush typing the original message.

I think I fixed the problem which caused Emacs to hang in this
particular scenario, but I'm not sure Richard is seeing the same
problem.  The change I installed on the emacs-26 branch is below;
Richard, please try applying it, and see if your problems go away.

diff --git a/src/thread.c b/src/thread.c
index c03cdda..1ded8f5 100644
--- a/src/thread.c
+++ b/src/thread.c
@@ -97,7 +97,12 @@ post_acquire_global_lock (struct thread_state *self)
 static void
 acquire_global_lock (struct thread_state *self)
 {
-  sys_mutex_lock (&global_lock);
+  /* If some Lisp was interrupted by C-g while inside pselect, the
+     signal handler could have called maybe_reacquire_global_lock, in
+     which case we are already holding the lock and shouldn't try
+     taking it again, or else we will hang forever.  */
+  if (!(self && self->not_holding_lock))
+    sys_mutex_lock (&global_lock);
   post_acquire_global_lock (self);
 }
 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29370; Package emacs. (Fri, 24 Nov 2017 21:16:02 GMT) Full text and rfc822 format available.

Message #19 received at 29370 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: mtg <at> gnu.org
Cc: 29370 <at> debbugs.gnu.org, 29347 <at> debbugs.gnu.org, rms <at> gnu.org
Subject: Re: bug#29347: 27.0.50; C-g doesn't quit minibuffer
Date: Fri, 24 Nov 2017 23:14:16 +0200
> Date: Fri, 24 Nov 2017 18:17:58 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 29370 <at> debbugs.gnu.org, 29347 <at> debbugs.gnu.org, rms <at> gnu.org
> 
> I think I fixed the problem which caused Emacs to hang in this
> particular scenario, but I'm not sure Richard is seeing the same
> problem.  The change I installed on the emacs-26 branch is below;
> Richard, please try applying it, and see if your problems go away.

Sorry, wrong patch.  Please use the one below instead.

diff --git a/src/thread.c b/src/thread.c
index c03cdda..1ded8f5 100644
--- a/src/thread.c
+++ b/src/thread.c
@@ -97,7 +97,12 @@ post_acquire_global_lock (struct thread_state *self)
 static void
 acquire_global_lock (struct thread_state *self)
 {
-  sys_mutex_lock (&global_lock);
+  /* If some Lisp was interrupted by C-g while inside pselect, the
+     signal handler could have called maybe_reacquire_global_lock, in
+     which case we are already holding the lock and shouldn't try
+     taking it again, or else we will hang forever.  */
+  if (!(self && !self->not_holding_lock))
+    sys_mutex_lock (&global_lock);
   post_acquire_global_lock (self);
 }
 







Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29370; Package emacs. (Fri, 24 Nov 2017 21:43:02 GMT) Full text and rfc822 format available.

Message #22 received at 29370 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: mtg <at> gnu.org
Cc: 29370 <at> debbugs.gnu.org, 29347 <at> debbugs.gnu.org, rms <at> gnu.org
Subject: Re: bug#29347: 27.0.50; C-g doesn't quit minibuffer
Date: Fri, 24 Nov 2017 23:41:11 +0200
> Date: Fri, 24 Nov 2017 23:14:16 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 29370 <at> debbugs.gnu.org, 29347 <at> debbugs.gnu.org, rms <at> gnu.org
> 
> > Date: Fri, 24 Nov 2017 18:17:58 +0200
> > From: Eli Zaretskii <eliz <at> gnu.org>
> > Cc: 29370 <at> debbugs.gnu.org, 29347 <at> debbugs.gnu.org, rms <at> gnu.org
> > 
> > I think I fixed the problem which caused Emacs to hang in this
> > particular scenario, but I'm not sure Richard is seeing the same
> > problem.  The change I installed on the emacs-26 branch is below;
> > Richard, please try applying it, and see if your problems go away.
> 
> Sorry, wrong patch.  Please use the one below instead.

Sorry again, that was not the best idea.  Here is a better patch:

diff --git a/src/thread.c b/src/thread.c
index 9e799ce..dd46681 100644
--- a/src/thread.c
+++ b/src/thread.c
@@ -578,8 +573,15 @@ really_call_select (void *arg)
 			   sa->timeout, sa->sigmask);
 
   block_interrupt_signal (&oldset);
-  acquire_global_lock (self);
-  self->not_holding_lock = 0;
+  /* If we were interrupted by C-g while inside sa->func above, the
+     signal handler could have called maybe_reacquire_global_lock, in
+     which case we are already holding the lock and shouldn't try
+     taking it again, or else we will hang forever.  */
+  if (self->not_holding_lock)
+    {
+      acquire_global_lock (self);
+      self->not_holding_lock = 0;
+    }
   restore_signal_mask (&oldset);
 }
 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29370; Package emacs. (Sat, 25 Nov 2017 23:17:03 GMT) Full text and rfc822 format available.

Message #25 received at 29370 <at> debbugs.gnu.org (full text, mbox):

From: Richard Stallman <rms <at> gnu.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 29370 <at> debbugs.gnu.org, mtg <at> gnu.org, 29347 <at> debbugs.gnu.org
Subject: Re: bug#29370: bug#29347: 27.0.50; C-g doesn't quit minibuffer
Date: Sat, 25 Nov 2017 18:16:18 -0500
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  >    block_interrupt_signal (&oldset);
  > -  acquire_global_lock (self);
  > -  self->not_holding_lock = 0;
  > +  /* If we were interrupted by C-g while inside sa->func above, the
  > +     signal handler could have called maybe_reacquire_global_lock, in
  > +     which case we are already holding the lock and shouldn't try
  > +     taking it again, or else we will hang forever.  */
  > +  if (self->not_holding_lock)
  > +    {
  > +      acquire_global_lock (self);
  > +      self->not_holding_lock = 0;
  > +    }
  >    restore_signal_mask (&oldset);

I am running with this patch, and I will report the results.

-- 
Dr Richard Stallman
President, Free Software Foundation (https://gnu.org, https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)
Skype: No way! See https://stallman.org/skype.html.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29370; Package emacs. (Mon, 27 Nov 2017 04:50:02 GMT) Full text and rfc822 format available.

Message #28 received at 29370 <at> debbugs.gnu.org (full text, mbox):

From: Mike Gerwitz <mtg <at> gnu.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 29370 <at> debbugs.gnu.org, 29347 <at> debbugs.gnu.org, rms <at> gnu.org
Subject: Re: bug#29347: 27.0.50; C-g doesn't quit minibuffer
Date: Sun, 26 Nov 2017 23:48:51 -0500
[Message part 1 (text/plain, inline)]
On Fri, Nov 24, 2017 at 18:17:58 +0200, Eli Zaretskii wrote:
> I think I fixed the problem which caused Emacs to hang in this
> particular scenario, but I'm not sure Richard is seeing the same
> problem.  The change I installed on the emacs-26 branch is below;
> Richard, please try applying it, and see if your problems go away.

The issue has been fixed on the current emacs-26 branch
(6ec5d49).  Thanks for the quick fix, Eli!

-- 
Mike Gerwitz
Free Software Hacker+Activist | GNU Maintainer & Volunteer
GPG: D6E9 B930 028A 6C38 F43B  2388 FEF6 3574 5E6F 6D05
https://mikegerwitz.com
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29370; Package emacs. (Mon, 27 Nov 2017 16:17:02 GMT) Full text and rfc822 format available.

Message #31 received at 29370 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Mike Gerwitz <mtg <at> gnu.org>
Cc: 29370 <at> debbugs.gnu.org, 29347 <at> debbugs.gnu.org, rms <at> gnu.org
Subject: Re: bug#29347: 27.0.50; C-g doesn't quit minibuffer
Date: Mon, 27 Nov 2017 18:16:11 +0200
> From: Mike Gerwitz <mtg <at> gnu.org>
> Cc: rms <at> gnu.org,  29347 <at> debbugs.gnu.org,  29370 <at> debbugs.gnu.org
> Date: Sun, 26 Nov 2017 23:48:51 -0500
> 
> On Fri, Nov 24, 2017 at 18:17:58 +0200, Eli Zaretskii wrote:
> > I think I fixed the problem which caused Emacs to hang in this
> > particular scenario, but I'm not sure Richard is seeing the same
> > problem.  The change I installed on the emacs-26 branch is below;
> > Richard, please try applying it, and see if your problems go away.
> 
> The issue has been fixed on the current emacs-26 branch
> (6ec5d49).  Thanks for the quick fix, Eli!

Thanks for testing.  This scenario was simple enough to understand
what was wrong.  I just hope this also solves Richard's problems.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29370; Package emacs. (Mon, 27 Nov 2017 23:30:03 GMT) Full text and rfc822 format available.

Message #34 received at 29370 <at> debbugs.gnu.org (full text, mbox):

From: Richard Stallman <rms <at> gnu.org>
To: Mike Gerwitz <mtg <at> gnu.org>
Cc: 29370 <at> debbugs.gnu.org, eliz <at> gnu.org, 29347 <at> debbugs.gnu.org
Subject: Re: bug#29347: 27.0.50; C-g doesn't quit minibuffer
Date: Mon, 27 Nov 2017 18:28:57 -0500
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

I have not noticed that problem since installing the change.

-- 
Dr Richard Stallman
President, Free Software Foundation (https://gnu.org, https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)
Skype: No way! See https://stallman.org/skype.html.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29370; Package emacs. (Tue, 28 Nov 2017 03:35:02 GMT) Full text and rfc822 format available.

Message #37 received at 29370 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: rms <at> gnu.org
Cc: 29370 <at> debbugs.gnu.org, mtg <at> gnu.org, 29347 <at> debbugs.gnu.org
Subject: Re: bug#29347: 27.0.50; C-g doesn't quit minibuffer
Date: Tue, 28 Nov 2017 05:33:46 +0200
> From: Richard Stallman <rms <at> gnu.org>
> CC: eliz <at> gnu.org, 29347 <at> debbugs.gnu.org, 29370 <at> debbugs.gnu.org
> Date: Mon, 27 Nov 2017 18:28:57 -0500
> 
> I have not noticed that problem since installing the change.

Good to know, thanks.  I will close the bug in a few days, if not new
issues like that come up.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29370; Package emacs. (Fri, 01 Dec 2017 08:39:02 GMT) Full text and rfc822 format available.

Message #40 received at 29370-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: rms <at> gnu.org
Cc: 29370-done <at> debbugs.gnu.org, mtg <at> gnu.org, 29347-done <at> debbugs.gnu.org
Subject: Re: bug#29370: bug#29347: 27.0.50; C-g doesn't quit minibuffer
Date: Fri, 01 Dec 2017 10:37:18 +0200
> Date: Tue, 28 Nov 2017 05:33:46 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 29370 <at> debbugs.gnu.org, mtg <at> gnu.org, 29347 <at> debbugs.gnu.org
> 
> > From: Richard Stallman <rms <at> gnu.org>
> > CC: eliz <at> gnu.org, 29347 <at> debbugs.gnu.org, 29370 <at> debbugs.gnu.org
> > Date: Mon, 27 Nov 2017 18:28:57 -0500
> > 
> > I have not noticed that problem since installing the change.
> 
> Good to know, thanks.  I will close the bug in a few days, if not new
> issues like that come up.

Nothing new, so I'm closing these bugs.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 29 Dec 2017 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 232 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.