Path: csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: Martijn Dekker Newsgroups: gnu.bash.bug Subject: Spurious recursive trap invocation warning Date: Sun, 29 Dec 2019 19:34:46 +0000 Lines: 29 Approved: bug-bash@gnu.org Message-ID: References: <672c11dd-cf3c-f903-f222-20b6b06454be@inlv.org> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: usenet.stanford.edu 1577648096 11711 209.51.188.17 (29 Dec 2019 19:34:56 GMT) X-Complaints-To: action@cs.stanford.edu To: Bug reports for the GNU Bourne Again SHell Envelope-to: bug-bash@gnu.org User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 Content-Language: en-CA X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 37.59.109.123 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <672c11dd-cf3c-f903-f222-20b6b06454be@inlv.org> Xref: csiph.com gnu.bash.bug:15787 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