You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This easily reproduces by running something like declare | wc -l. Here's what's happening:
We synchronously invoke the declare built-in, with its stdout mapped to the writer end of a pipe we allocate.
declare writes quite a bit and, presumably, fills up the pipe's internal buffer. This causes declare to block on its next write.
wc -l hasn't yet been invoked, so nothing is reading from the reader end of the pipe. This means nothing is freeing up space in the pipe's internal buffer and nothing will unblock declare.
In the case above, wc needs to be spawned before the declare built-in has completed.
The text was updated successfully, but these errors were encountered:
This easily reproduces by running something like
declare | wc -l
. Here's what's happening:declare
built-in, with its stdout mapped to the writer end of a pipe we allocate.declare
writes quite a bit and, presumably, fills up the pipe's internal buffer. This causesdeclare
to block on its next write.wc -l
hasn't yet been invoked, so nothing is reading from the reader end of the pipe. This means nothing is freeing up space in the pipe's internal buffer and nothing will unblockdeclare
.In the case above,
wc
needs to be spawned before thedeclare
built-in has completed.The text was updated successfully, but these errors were encountered: