Spurious recursive trap invocation warning

2019-12-29 Thread Martijn Dekker
The current git version of bash (at least on x86_64-apple-darwin18.7.0) 
gives a spurious warning about a recursive trap invocation when running 
the following more than once on an interactive shell. The trap unsets 
itself before resending the signal, so there should be no recursive 
invocation.


bash-5.0$ echo $BASH_VERSION
5.0.11(1)-maint
bash-5.0$ trap 'echo int; trap - INT; kill -s INT $$' INT; kill -s INT $$
int

bash-5.0$ trap 'echo int; trap - INT; kill -s INT $$' INT; kill -s INT $$
bash: warning: run_pending_traps: recursive invocation while running 
trap for signal 2

int

bash-5.0$ trap 'echo int; trap - INT; kill -s INT $$' INT; kill -s INT $$
bash: warning: run_pending_traps: recursive invocation while running 
trap for signal 2

int

Thanks and happy new year,

- M.

--
modernish -- harness the shell
https://github.com/modernish/modernish



Re: Spurious recursive trap invocation warning

2019-12-29 Thread Chet Ramey
On 12/29/19 2:34 PM, Martijn Dekker wrote:
> The current git version of bash (at least on x86_64-apple-darwin18.7.0)
> gives a spurious warning about a recursive trap invocation when running the
> following more than once on an interactive shell. The trap unsets itself
> before resending the signal, so there should be no recursive invocation.

Thanks for the report.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRUc...@case.eduhttp://tiswww.cwru.edu/~chet/