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 40956
- From: Jérémie Roquet <jroquet@xxxxxxxxxxxxx>
- To: Kamil Dudka <kdudka@xxxxxxxxxx>
- Subject: Re: unbounded recursive call in a shell script crashes zsh
- Date: Tue, 11 Apr 2017 16:01:10 +0200
- Cc: "Zsh Hackers' List" <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=j2E5vrxK1A0yzxDD8yjtUBtpByj7tdJuRzai3pZirtM=; b=tKq0lAcse9xo3I0EVXO5ZMg7hIPD/rx87MGw0UXM/pfyahUbv7iCcYT1i1SFlgU/bd pKxlaPiwrNlU5tdF848YZn0+T+w3v4nNy401l8qLYdXRQu0uQJYyx3vyHViuAmjCp4xT VGlz8ibMxUBJwvnEp/iJMuPrkPKUARnQEHihLftRKqkttAMRq5EWAirJ9wz584Kvtmr7 NPi9ZVk7+3iNvMvEj90aVygozDPT2Lgef1bULc4sL/19+Kv/AtqmKpxIwKPajkwiMz9h XoYOgoyZ7YuB/GplM7tONWJAOv2Ds4Q6FyOnIk7vIGBwFzUm55ZMofXqflf2NTJ7ESdb PFDA==
- In-reply-to: <CAFOazAOTiUu8w9ZHZnhpBBtQ5FHj-Jb1OLxGf6eO4S-9DS7=fQ@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> <CAFOazAOTiUu8w9ZHZnhpBBtQ5FHj-Jb1OLxGf6eO4S-9DS7=fQ@mail.gmail.com>
- Sender: arkanosis@xxxxxxxxx
2017-04-11 15:29 GMT+02:00 Jérémie Roquet <jroquet@xxxxxxxxxxxxx>:
> 2017-04-11 15:00 GMT+02:00 Kamil Dudka <kdudka@xxxxxxxxxx>:
>> The following shell script crashes zsh (tested with zsh-5.3.1-90-g63f086d):
>>
>> function foo() {
>> if true; then
>> foo
>> fi
>> }
>>
>> foo
>
> That's interesting:
>
> $ zsh -c 'foo() { foo }; foo'
> foo: maximum nested function level reached
>
> $ zsh -c 'foo() { if true; then foo; fi }; foo'
> Segmentation fault
That looks like a stack overflow…
Doing either of the following fixed the issue for me:
- recompile after “./configure --enable-max-function-depth=500”
(default is 1000);
- execute after “ulimit -s 16384” (default for me was 8192).
Best regards,
--
Jérémie
Messages sorted by:
Reverse Date,
Date,
Thread,
Author