Re: Segfault when SIGPIPE and SIGINT used together
From:
Chet Ramey
Subject:
Re: Segfault when SIGPIPE and SIGINT used together
Date:
Sat, 7 Oct 2017 17:48:41 -0400
User-agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.3.0
On 10/6/17 6:58 PM, ANDERSON, CRAIG wrote:
> Repeat-By:
> Running the following script:
>
> #!/bin/bash
>
> exec >& >(while read line; do echo "$line"; done)
>
> trap 'echo sigpipe' SIGPIPE
> trap 'echo sigint' SIGINT
>
> echo 'Sleeping 60 seconds, press Ctrl+C to segfault!'
> sleep 60
You have created a situation where you will get SIGPIPE over and over
again, running the SIGPIPE trap handler (each invocation of which generates
a SIGPIPE because the pipe to the process substitution is broken), until
the shell runs out of stack space.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/