bug-bash
[Top][All Lists]
Advanced

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

Re: Reproducible SIGSEGV in bash 4.2 caused by alias.


From: Eric Blake
Subject: Re: Reproducible SIGSEGV in bash 4.2 caused by alias.
Date: Thu, 10 Oct 2013 16:22:12 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0

On 10/10/2013 03:40 PM, Piotr Grzybowski wrote:
>  a small correction, if I may; while that was all very sweet, there
> are two issues here:
> 
> 1. recursion_count has to be reset somewhere, or else it is a global
> alias limit :)
> 2. a better place for this limit is acctually eval (probably leaving
> alias recursion limit, before Oliver starts playing with it, is also a
> good idea?):

Why impose an arbitrary recursion limit at all?  One of the GNU coding
philosophies is to avoid arbitrary limits, and instead let you use the
full power of your machine (ie. recurse to the full stack depth, rather
than a hard-coded limit, where depending on available memory and ulimit
settings, different users will want different limits).  One way to do
this is to link to the GNU libsigsegv library, which can be used to give
a graceful error message rather than a core dump upon stack overflow
(although gracefully recovering from overflow is a MUCH harder task,
unless you can prove that overflow will never happen in the middle of a
function such as malloc).

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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