From: Bart Schaefer <schaefer@brasslantern.com>
To: LitHack <lithack0@gmail.com>
Cc: zsh-workers@zsh.org
Subject: Re: Crashing the Linux System
Date: Fri, 16 Jun 2023 21:43:02 -0700 [thread overview]
Message-ID: <CAH+w=7biUDjCp4MSqE2C5Ja_V09XQwBG=LDE89Rk7puHrJjB-A@mail.gmail.com> (raw)
In-Reply-To: <CADc_fS3jvV1Go9qWU4g=LSObLqwmC_Pg2ZcxVgSNTkvjxL-eOw@mail.gmail.com>
On Fri, Jun 16, 2023 at 8:38 PM LitHack <lithack0@gmail.com> 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).
prev parent reply other threads:[~2023-06-17 4:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CADc_fS3oAhtidGr5bSZ1_26DXPYWkkMy_4O94FKUtMMxRHKYHw@mail.gmail.com>
2023-06-17 3:38 ` Fwd: " LitHack
2023-06-17 3:42 ` Ellenor Bjornsdottir
2023-06-17 4:43 ` Bart Schaefer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAH+w=7biUDjCp4MSqE2C5Ja_V09XQwBG=LDE89Rk7puHrJjB-A@mail.gmail.com' \
--to=schaefer@brasslantern.com \
--cc=lithack0@gmail.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).