[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Question: is this a bug in BASh (pre-exec trap)
From: |
Chet Ramey |
Subject: |
Re: Question: is this a bug in BASh (pre-exec trap) |
Date: |
Sat, 10 Sep 2016 18:31:34 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 |
On 9/9/16 2:00 PM, Matthew Giassa wrote:
> Good day,
>
> I've been doing some testing with the bash-prexec script which uses a
> DEBUG trap to issue user-supplied functions before executing each
> command (https://github.com/rcaloras/bash-preexec).
>
> Here is a minimal working example
> (https://github.com/rcaloras/bash-preexec/issues/25) which causes
> background subshells to kill the current session:
>
> # Causes login shells to logout
> # Look like bash versions > 4.2.46
> set -o functrace > /dev/null 2>&1
> no_op() { :;}
> trap 'no_op' DEBUG;
> # Any command in a subshell and background
> ( pwd ) &
>
> Is this a bug or issue in BASh itself, or is it simply a limitation of
> using pre-exec functionality?
I will look at this after bash-4.4 is released. If it's a bug with bash,
it's probably bash setting the terminal process group incorrectly when
running the DEBUG trap.
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://cnswww.cns.cwru.edu/~chet/