Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14689

Re: Segfault on recursive trap/kill

From Chet Ramey <chet.ramey@case.edu>
Newsgroups gnu.bash.bug
Subject Re: Segfault on recursive trap/kill
Date 2018-10-06 12:33 -0400
Organization ITS, Case Western Reserve University
Message-ID <mailman.1763.1538843614.1284.bug-bash@gnu.org> (permalink)
References <8736tj3llu.fsf@gnu.org>

Show all headers | View raw


On 10/5/18 9:33 PM, Mike Gerwitz wrote:
> The following code will cause a segfault on bash-4.4.19(1) on
> GNU Guix.  I reproduced the issue on an old Ubuntu 14.04 LTS running
> bash-4.3.11(1) as well as a Trisquel system running the same version.
> 
>   bash -c 'trap "kill 0" TERM; kill 0'
> 
> Also segfaults when replacing `0' with `$$', and presumably in any other
> situation that would trigger the trap recursively.

Yes. Bash has allowed recursive trap handlers since early 2014 (pre-4.3)
due to requests for the feature and compatibility with other shells that
allow it.

If you manage to create infinite recursion, bash won't stop you.

Chet
-- 
``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/

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: Segfault on recursive trap/kill Chet Ramey <chet.ramey@case.edu> - 2018-10-06 12:33 -0400

csiph-web