GNU bug report logs - #33252
27.0.50; Recursive password prompt takes over

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Sun, 4 Nov 2018 00:38:02 UTC

Severity: normal

Tags: confirmed, fixed

Found in version 27.0.50

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.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 33252 in the body.
You can then email your comments to 33252 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#33252; Package emacs. (Sun, 04 Nov 2018 00:38:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juri Linkov <juri <at> linkov.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 04 Nov 2018 00:38:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.50; Recursive password prompt takes over
Date: Sun, 04 Nov 2018 01:41:41 +0200
A bug in a shell script caused an infinitive stream of the same output lines:

Password: sh: 1: read: Illegal option -s

Password: sh: 1: read: Illegal option -s

Password: sh: 1: read: Illegal option -s

Password: sh: 1: read: Illegal option -s

Password: sh: 1: read: Illegal option -s

...

Currently Emacs handles such shell output very poorly and fails
with the following backtrace:

Debugger entered--Lisp error: (error "Variable binding depth exceeds max-specpdl-size")
  read-string("(In buffer *shell*) Password: sh: 1: read: Ill..." nil t nil)
  read-passwd("(In buffer *shell*) Password: sh: 1: read: Ill...")
  comint-send-invisible("Password: sh: 1: read: Illegal option -s\nPassword:...")
  comint-watch-for-password-prompt("Password: sh: 1: read: Illegal option -s\n\nPassword...")
  run-hook-with-args(comint-watch-for-password-prompt "Password: sh: 1: read: Illegal option -s\n\nPassword...")
  comint-output-filter(#<process shell<1>> "Password: sh: 1: read: Illegal option -s\n\nPassword...")
  ...
  read-string("(In buffer *shell*) sh: 1: read: Illegal optio..." nil t nil)
  read-passwd("(In buffer *shell*) sh: 1: read: Illegal optio...")
  comint-send-invisible("sh: 1: read: Illegal option -s\nPassword: sh: 1: re...")
  comint-watch-for-password-prompt("sh: 1: read: Illegal option -s\n\nPassword: sh: 1: r...")
  run-hook-with-args(comint-watch-for-password-prompt "sh: 1: read: Illegal option -s\n\nPassword: sh: 1: r...")
  comint-output-filter(#<process shell<1>> "sh: 1: read: Illegal option -s\n\nPassword: sh: 1: r...")
  ...
  read-string("(In buffer *shell*) sh: 1: read: Illegal optio..." nil t nil)
  read-passwd("(In buffer *shell*) sh: 1: read: Illegal optio...")
  comint-send-invisible("sh: 1: read: Illegal option -s\nPassword: sh: 1: re...")
  comint-watch-for-password-prompt("sh: 1: read: Illegal option -s\n\nPassword: sh: 1: r...")
  run-hook-with-args(comint-watch-for-password-prompt "sh: 1: read: Illegal option -s\n\nPassword: sh: 1: r...")
  comint-output-filter(#<process shell<1>> "sh: 1: read: Illegal option -s\n\nPassword: sh: 1: r...")
  ...

A reproducible short test case:

0. emacs -Q

1. M-&
   while true; do echo -n "Password: "; sleep 1; done
   RET

After 42 seconds Emacs session becomes completely unusable, and control
can be regained only after killing the shell script from outside Emacs.




Added tag(s) confirmed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 10 Jul 2019 13:15:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33252; Package emacs. (Wed, 10 Jul 2019 13:25:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 33252 <at> debbugs.gnu.org
Subject: Re: bug#33252: 27.0.50; Recursive password prompt takes over
Date: Wed, 10 Jul 2019 15:24:26 +0200
Juri Linkov <juri <at> linkov.net> writes:

> A reproducible short test case:
>
> 0. emacs -Q
>
> 1. M-&
>    while true; do echo -n "Password: "; sleep 1; done
>    RET
>
> After 42 seconds Emacs session becomes completely unusable, and control
> can be regained only after killing the shell script from outside Emacs.

I've now added a recursion check to the comint prompting, and it'll stop
adding new prompts when it's ten layers deep, which will allow the user
to kill the shell script.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 10 Jul 2019 13:25:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 27.1, send any further explanations to 33252 <at> debbugs.gnu.org and Juri Linkov <juri <at> linkov.net> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 10 Jul 2019 13:25:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 08 Aug 2019 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 262 days ago.

Previous Next


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