zsh-workers
 help / color / mirror / code / Atom feed
* 'while do done' hangs interactive zsh
@ 2021-05-16  9:16 Arseny Maslennikov
  2021-05-16 14:28 ` Bart Schaefer
  2021-05-16 16:43 ` 'while do done' hangs interactive zsh Stephane Chazelas
  0 siblings, 2 replies; 14+ messages in thread
From: Arseny Maslennikov @ 2021-05-16  9:16 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 718 bytes --]

Hi everyone!

When zsh tries to execute "while do; done", it enters a busy loop:

% dash -c 'while do; done'
dash: 1: Syntax error: "do" unexpected
% bash -c 'while do; done'
bash: -c: line 1: syntax error near unexpected token `do'
bash: -c: line 1: `while do; done'
% zsh -c 'while do; done' 	# never finishes/prompts by itself
^C
zsh -c 'while do; done'  27,73s user 0,00s system 99% cpu 27,732 total 4k maxrss

Even more, if the user enters "while do; done" in an interactive zsh
instance, the busy loop is not interruptible by ^C, ^\ or ^Z; the shell
has to be killed via some external means.

To be fair, I have discovered the bug with the semicolon omitted ("while do done").

Could we do something about this?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2021-05-16 23:40 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-16  9:16 'while do done' hangs interactive zsh Arseny Maslennikov
2021-05-16 14:28 ` Bart Schaefer
2021-05-16 15:46   ` Bart Schaefer
2021-05-16 16:15     ` Mikael Magnusson
2021-05-16 16:22       ` Lawrence Velázquez
2021-05-16 17:47       ` Bart Schaefer
2021-05-16 18:23         ` Martijn Dekker
2021-05-16 19:59           ` Bart Schaefer
2021-05-16 20:34             ` Peter Stephenson
2021-05-16 21:19               ` [PATCH] volatile declarations (was Re: 'while do done' hangs interactive zsh) Bart Schaefer
2021-05-16 23:40                 ` Martijn Dekker
2021-05-16 16:43 ` 'while do done' hangs interactive zsh Stephane Chazelas
2021-05-16 18:02   ` Bart Schaefer
2021-05-16 18:25     ` Martijn Dekker

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

	https://git.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).