elvish icon indicating copy to clipboard operation
elvish copied to clipboard

Crash when combining pipe and redirection

Open hanche opened this issue 1 year ago • 0 comments

What happened, and what did you expect to happen?

Elvish crashes when I run this command:

nop | nop < /dev/null

While the double redirection of stdin would clearly be a mistake, a crash is not the expected outcome. Instead, I would expect either an error message or that the second command in the pipeline gets its input either from the pipe or the named pipe. (I discovered this by wondering what would happen – the code above distills my test down to the bare minimum.)

Incidentally, nop | { nop < /dev/null } does not result in a crash, I presume since the ambiguity is now removed by the syntax.

I attach the crash output, on the off chance that others can't reproduce the crash.

crash.txt

Output of "elvish -version"

0.21.0-dev.0.20240809001233-bc247bb5e17c-dirty

Code of Conduct

hanche avatar Sep 27 '24 15:09 hanche