unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#33252: 27.0.50; Recursive password prompt takes over
@ 2018-11-03 23:41 Juri Linkov
  2019-07-10 13:24 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 2+ messages in thread
From: Juri Linkov @ 2018-11-03 23:41 UTC (permalink / raw)
  To: 33252

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.





^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#33252: 27.0.50; Recursive password prompt takes over
  2018-11-03 23:41 bug#33252: 27.0.50; Recursive password prompt takes over Juri Linkov
@ 2019-07-10 13:24 ` Lars Ingebrigtsen
  0 siblings, 0 replies; 2+ messages in thread
From: Lars Ingebrigtsen @ 2019-07-10 13:24 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 33252

Juri Linkov <juri@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





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-10 13:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-03 23:41 bug#33252: 27.0.50; Recursive password prompt takes over Juri Linkov
2019-07-10 13:24 ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).