bug-bash
[Top][All Lists]
Advanced

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

Spurious recursive trap invocation warning


From: Martijn Dekker
Subject: Spurious recursive trap invocation warning
Date: Sun, 29 Dec 2019 19:34:46 +0000
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.3.1

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



reply via email to

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