bug-bash
[Top][All Lists]
Advanced

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

Re: Large compound commands resulting in a segfault


From: Chet Ramey
Subject: Re: Large compound commands resulting in a segfault
Date: Mon, 1 Jul 2019 15:20:19 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.7.2

On 6/21/19 3:22 PM, kfm@plushkava.net wrote:
> Hi, 
> 
> The following script generates a compound command consisting of many 
> instances of the : command. I have found that it reproducibly induces a 
> segfault in all versions of bash from 2 onwards. I tested various other 
> shells - several more than are implied here - all of which could handle the 
> generated code without issue.

It's an exceeded stack resource limit. Bash uses recursive function calls
to implement command lists, and too many can exceed the stack limit.

-- 
``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]