Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #11504

SIGINT handling

Path csiph.com!xmission!news.glorb.com!usenet.stanford.edu!not-for-mail
From Stephane Chazelas <stephane.chazelas@gmail.com>
Newsgroups gnu.bash.bug
Subject SIGINT handling
Date Fri, 18 Sep 2015 16:14:39 +0100
Lines 39
Approved bug-bash@gnu.org
Message-ID <mailman.1355.1442589288.19560.bug-bash@gnu.org> (permalink)
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
X-Trace usenet.stanford.edu 1442589288 11931 208.118.235.17 (18 Sep 2015 15:14:48 GMT)
X-Complaints-To action@cs.stanford.edu
To bug-bash <bug-bash@gnu.org>
Envelope-to bug-bash@gnu.org
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=ZI3ED9UdaFVnvJMbty4dqqMl9hwUbQS9+Uh+2E3vWy8=; b=zCha8JctfVL99wbYFXub5ogcRdZd7zBMd4BIgDfj6GAN5p7pB64WNswAHg8RosV82U J4DXRKbTJQjtGeb62ud/y67bWgl4Tfa+Fz91Mt8R7cAQ6FJUZseV3m7T+Dqv6zMhTw+h ZVmX3lLnVknZtv+QOg6oxi4cZBSW1LbVjODL2JdxWs6W5Ne6jr0GJL0G6zv9n3/r6jlh tUTkOZ5YzQiWX06Mvw2s9Wb0s/l/yiylpnCJ42AgeYVctcI9q8HZSqIQVZDHg+n66Dk4 obHTbRFehrdmcD4tBc1jhy7ZQpxBwrg5kxiwy3WbnSq2QHIm2yGkky7Fv4CwhGeOyOJd z1zg==
X-Received by 10.194.175.232 with SMTP id cd8mr8341626wjc.45.1442589280684; Fri, 18 Sep 2015 08:14:40 -0700 (PDT)
Content-Disposition inline
User-Agent Mutt/1.5.21 (2010-09-15)
X-detected-operating-system by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value).
X-Received-From 2a00:1450:400c:c05::232
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.14
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <http://lists.gnu.org/archive/html/bug-bash>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
Xref csiph.com gnu.bash.bug:11504

Show key headers only | View raw


Hello.

In:

bash -c 'sh -c "trap exit INT; sleep 10; :"; echo hi'

If I press Ctrl-C, I still see "hi".

On Solaris with 4.1.11(2)-release (i386-pc-solaris2.11), that
seems to be consistent.

On Debian with 4.3.42(1)-release (x86_64-pc-linux-gnu), that
seems to happen only in something like 80% of the time.

For bash to exit upon receiving that SIGINT, the currently
running process has to die itself as well of SIGINT (or the
currently running command to be builtin).

That sounds like a bad idea, especially considering that it
doesn't exit either if the process returns with exit code 130
upon receiving that SIGINT. For instance:

For instance, in:

bash -c 'mksh -c "sleep 10; :"; echo hi'

Upon pressing Ctrl-C, mksh handles the SIGINT and exits with
130 (as opposed to dying of a SIGINT), so bash doesn't exit
(sometimes only on Debian).

ksh93 seems to be doing something similar (even worse).
http://unix.stackexchange.com/a/230568/22565

Why? What's the rational behind that. It seems it's not
documented and contradicts the documentation.

-- 
Stephane

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

SIGINT handling Stephane Chazelas <stephane.chazelas@gmail.com> - 2015-09-18 16:14 +0100

csiph-web