bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Infinite recursion makes bash segfault


From: Chet Ramey
Subject: Re: Infinite recursion makes bash segfault
Date: Thu, 5 May 2022 11:19:20 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.8.1

On 5/5/22 7:10 AM, Judicaël Courant wrote:
Hi,

I found bash segfaults when running into an infinite recursion (details below). I would expect it to either stop (or possibly exit) with a clear error message instead. Here are the details (as given by bashbug). The problem also happens with the latest bash version (5.2.0(1)-beta).

Yes. If you recurse indefinitely, you will eventually exceed your stack
size resource limit and get the prescribed fatal signal.

Description:
         Infinite recursion causes bash to segfault.
         The problem happens in interactive mode as well as in scripts.

Repeat-By:
         ~$ bash
         ~$ foo () { foo; }; foo
         Segmentation fault (core dumped)
         ~$

If you are worried about this, set the FUNCNEST shell variable to an
appropriate value.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]