From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id ae7ea359 for ; Mon, 16 Dec 2019 05:27:54 +0000 (UTC) Received: (qmail 27437 invoked by alias); 16 Dec 2019 05:27:50 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 45045 Received: (qmail 20824 invoked by uid 1010); 16 Dec 2019 05:27:50 -0000 X-Qmail-Scanner-Diagnostics: from wout1-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.1/25663. spamassassin: 3.4.2. Clear:RC:0(64.147.123.24):SA:0(-2.6/5.0):. Processed in 0.707186 secs); 16 Dec 2019 05:27:50 -0000 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at daniel.shahaf.name does not designate permitted sender hosts) X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrvddtgedgkedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjfgesthdttddttdervdenucfhrhhomhepffgrnhhi vghlucfuhhgrhhgrfhcuoegurdhssegurghnihgvlhdrshhhrghhrghfrdhnrghmvgeqne cukfhppeejledrudektddrheejrdduudelnecurfgrrhgrmhepmhgrihhlfhhrohhmpegu rdhssegurghnihgvlhdrshhhrghhrghfrdhnrghmvgenucevlhhushhtvghrufhiiigvpe dt X-ME-Proxy: Date: Mon, 16 Dec 2019 05:27:13 +0000 From: Daniel Shahaf To: Martijn Dekker Cc: zsh-workers@zsh.org Subject: The bug from workers/44922 (was: Re: Bug with traps and exit Message-ID: <20191216052713.zuhf22nqzgdjz4z4@tarpaulin.shahaf.local2> References: <3859b4bf-08ba-62d5-f00a-3ec4e67caf95@inlv.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Good morning Martijn, Martijn Dekker wrote on Sun, Nov 24, 2019 at 06:54:18 +0100: > Op 22-01-19 om 00:00 schreef Martijn Dekker: > > Found a strange issue with traps and 'exit'. > > > > Test script: > > > > trap 'printf $1; exit; printf $2' USR1 > > fn() { > > printf 1 > > kill -s usr1 $$ > > printf 2 > > } > > printf 0 > > fn A B > > printf 3 > > > > Every shell outputs 01A, except zsh, which outputs 01A2. > > > > This means the execution of the fn() function is not interrupted. The > > USR1 trap executes 'exit' and does not execute the rest of the trap > > action, but instead of exiting the shell, zsh continues to execute fn() > > and then exits. > > > > Confirmed down to zsh 5.0.8 (didn't test earlier versions). > > A related issue (possibly the same?) with a much simpler test case: > > trap 'echo SIGINT; trap - INT; kill -s INT $$; echo woops' INT > kill -s INT $$ > > zsh prints 'woops', but shouldn't. As Peter observed in 45037, could you elaborate on why the inner 'kill' should abort execution of the trap? Cheers, Daniel