Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: unbounded recursive call in a shell script crashes zsh
- X-seq: zsh-workers 40966
- From: Jérémie Roquet <jroquet@xxxxxxxxxxxxx>
- To: Kamil Dudka <kdudka@xxxxxxxxxx>
- Subject: Re: unbounded recursive call in a shell script crashes zsh
- Date: Thu, 13 Apr 2017 18:01:13 +0200
- Cc: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, "zsh-workers@xxxxxxx" <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=UCw9EbEBUXiDGYrPglQpUn+34Oat4MvsXJnFaOoOwc8=; b=qP0vBgjlJICqfiLoeMEVE4XLxc0JfyKOHMO5Wmir3kYGUmP6mSX+K+mfDZraBv2mJ9 BNwDe21WC4FxU/g0R68BqF+h+cYx7atjIeXbkmNnlQUWbihEVZEIJ23etoNlthAWNG5g LL6IgANPRRbJSfpRmzcgu4pCQiJJzhp1x+kq7SFqvzuQNsdRI+3C1+lcUvkF/+TkNeys 3stRhPYriJSBTPjpUM1UVgYKD7a12Tpwo/j2QoJ5rafUtlx7bHnVpr7nnhRQLULge4Sz 4aCRV5D8hvPcuU5eysKF/U+MTFSu3CrnQgQJObUrPOOmCy3oYAOBqrVM817YVoq+JF1s nluA==
- In-reply-to: <CAFOazAO2jcj+zPpJuHXtykUE4yGR0FnYA5+-xHgH4nu_gDZgbw@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <2960832.nVDpiBkaWZ@kdudka-nb> <2420758.31stuSQeAV@kdudka-nb> <CAH+w=7atHK+_7fdzxCB4gRkWiKW8zCcTvW-qHM-0fUjH=OsPDQ@mail.gmail.com> <2350280.olGvC23INb@kdudka-nb> <CAFOazAO2jcj+zPpJuHXtykUE4yGR0FnYA5+-xHgH4nu_gDZgbw@mail.gmail.com>
- Sender: arkanosis@xxxxxxxxx
2017-04-13 17:21 GMT+02:00 Jérémie Roquet <jroquet@xxxxxxxxxxxxx>:
> Hence a total of 5856 bytes per recursion, or 5719 kiB for 10000 recursions.
Sorry, I meant 1000 recursions, obviously.
Here are the numbers when compiling using -O3 instead of -O0 -ggdb —
probably more useful for optimization:
execlist: 400 bytes
execpline: 416 bytes
execpline2: 224 bytes
execcmd_exec: 4864 bytes
execshfunc: 336 bytes
doshfunc: 704 bytes
runshfunc: 336 bytes
execode: 80 bytes
execlist: 400 bytes
execpline: 416 bytes
execpline2: 224 bytes
execcmd_exec: 4864 bytes
execif: 80 bytes
Aggregated:
execlist: 800 bytes
execpline: 832 bytes
execpline2: 448 bytes
execcmd_exec: 9728 bytes
execshfunc: 336 bytes
doshfunc: 704 bytes
runshfunc: 336 bytes
execode: 80 bytes
execif: 80 bytes
Hence an even higher total of 13344 bytes per recursion, or 13032 kiB
for 1000 recursions.
If I'm not mistaken, execcmd_exec seems to account for 73% of the stack usage.
--
Jérémie
Messages sorted by:
Reverse Date,
Date,
Thread,
Author