Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Crashing the Linux System
- X-seq: zsh-workers 51868
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: LitHack <lithack0@xxxxxxxxx>
- Cc: zsh-workers@xxxxxxx
- Subject: Re: Crashing the Linux System
- Date: Fri, 16 Jun 2023 21:43:02 -0700
- Archived-at: <https://zsh.org/workers/51868>
- In-reply-to: <CADc_fS3jvV1Go9qWU4g=LSObLqwmC_Pg2ZcxVgSNTkvjxL-eOw@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CADc_fS3oAhtidGr5bSZ1_26DXPYWkkMy_4O94FKUtMMxRHKYHw@mail.gmail.com> <CADc_fS3jvV1Go9qWU4g=LSObLqwmC_Pg2ZcxVgSNTkvjxL-eOw@mail.gmail.com>
On Fri, Jun 16, 2023 at 8:38 PM LitHack <lithack0@xxxxxxxxx> wrote:
>
> Running the yes command in command substitution will crash the linux shell. According to me inside command the substitution it is creating multiple process(fork). Command: `yes` or $(yes)
The "yes" command is defined to produce an unending stream of output.
The $(...) substitution is defined to capture all the output from a
command and substitute it as a string. "All the output" of "yes" is
impossible to capture in finite memory. The error I get from zsh is
the expected one:
zsh: fatal error: out of heap memory
There definitely are not multiple forks happening.
This is not a bug except in the sense that it was user error to use
$(yes) in the first place. It's no different than deliberately
writing an infinite loop such as $(while true; do echo y; done).
Messages sorted by:
Reverse Date,
Date,
Thread,
Author