Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #15874 > unrolled thread

Re: AW: Bizarre interaction bug involving bash w/ lastpipe + Almquist 'wait'

Started byMartijn Dekker <martijn@inlv.org>
First post2020-02-07 14:33 +0000
Last post2020-02-07 14:33 +0000
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: AW: Bizarre interaction bug involving bash w/ lastpipe + Almquist 'wait' Martijn Dekker <martijn@inlv.org> - 2020-02-07 14:33 +0000

#15874 — Re: AW: Bizarre interaction bug involving bash w/ lastpipe + Almquist 'wait'

FromMartijn Dekker <martijn@inlv.org>
Date2020-02-07 14:33 +0000
SubjectRe: AW: Bizarre interaction bug involving bash w/ lastpipe + Almquist 'wait'
Message-ID<mailman.432.1581086040.2412.bug-bash@gnu.org>
Op 07-02-20 om 12:19 schreef Walter Harms:
> IMHO is the bug on bash side. ash can assume to get an "healthy"
> environment from the caller. You can simply not fix everything that
> can possible go wrong.

That is a rather fallacious argument. Of course you cannot fix 
*everything* that could possibly go wrong. You can certainly fix *this* 
thing, though. I know, because every non-Almquist shell does it.

These days, no program can realistically assume a "healthy" environment. 
Computers have become unimaginably complex machines, built on thousands 
of interdependent abstraction layers, each as fallible as the humans 
that designed and implemented them. So "unhealthy" environments happen 
all the time, due to all sorts of unforeseen causes.

It's well past time to accept that the 1980s are behind us. In 2020, 
systems have to be programmed robustly and defensively.

> Obviously it should not segfault but so far i understand it is bsd as
> that does, not busybox ash.

True. But instead, it simply gets stuck forever, with no message or 
other indicator of what went wrong. How is that better?

(Going slightly off-topic below...)

Segfaulting is actually a good thing: it's one form of failing reliably. 
And failing reliably is vastly better than what often happens instead, 
especially in shell scripts: subtle breakage, which can take a lot of 
detective work to trace, and in some cases can cause serious damage due 
to the program functioning inconsistently and incorrectly (instead of 
not at all).

Failing reliably is something the shell is ATROCIOUSLY bad at, and it's 
one of the first things modernish aims to fix.

- Martijn

-- 
modernish -- harness the shell
https://github.com/modernish/modernish

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web