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


Groups > gnu.bash.bug > #11557

Re: SIGINT handling

Path csiph.com!au2pb.net!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nntp.club.cc.cmu.edu!169.228.66.3.MISMATCH!ihnp4.UCSD.Edu!usenet.stanford.edu!not-for-mail
From Stephane Chazelas <stephane.chazelas@gmail.com>
Newsgroups gnu.bash.bug
Subject Re: SIGINT handling
Date Thu, 24 Sep 2015 14:57:56 +0100
Lines 37
Approved bug-bash@gnu.org
Message-ID <mailman.1719.1443103085.19560.bug-bash@gnu.org> (permalink)
References <20150918151439.GA16455@chaz.gmail.com> <55FDC8B4.4000505@case.edu> <20150919213101.GA4393@chaz.gmail.com> <56035164.30105@case.edu> <20150924060122.GA4338@chaz.gmail.com> <20150924062044.GA5756@chaz.gmail.com>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
X-Trace usenet.stanford.edu 1443103085 19573 208.118.235.17 (24 Sep 2015 13:58:05 GMT)
X-Complaints-To action@cs.stanford.edu
Cc bug-bash <bug-bash@gnu.org>
To Chet Ramey <chet.ramey@case.edu>
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:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=3BZcjMmxw4n4+NS+AuxFH98hqeARjHv501sbNceXiVc=; b=T8Vq76d/cPw61N7qwJGWvScvFNlfgRB9YN03slwn3eGKvd6eVw7HIlYPBJgXeu4rts ZS9EuxvOg+fco8K+3JSeMG1awvW6XK4Nqts77wTsu0LY/pGBQMWuRTGpqJ2ClGRVeHFn KKQq5tIc3+2j/VL0m2iV7wCNMT3vH/Cr7gPqG87Nk04kTJIqaApD8wdczbN2NXDES/l9 CleY7XfBZaVN/xLmghV4mH+GT072SWjzQCRJihKljQPHRbEo5wDTeg9BQS+J/XyMKH2n f9BbXrqBd0nGvk0H0fnW9w6VFAogpqjZ5q7qjcQOnyoPGLXjSA0eZDJ98OtzVvd3Giyo bEug==
X-Received by 10.194.121.100 with SMTP id lj4mr41877308wjb.104.1443103077875; Thu, 24 Sep 2015 06:57:57 -0700 (PDT)
Content-Disposition inline
In-Reply-To <20150924062044.GA5756@chaz.gmail.com>
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::234
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>
X-Received-Bytes 4043
X-Received-Body-CRC 2579338469
Xref csiph.com gnu.bash.bug:11557

Show key headers only | View raw


Given that the bug was introduced by Linus' patch (to fix a bug
that anyway is in all shell implementations that do WCE) and
that it's caused by a behaviour that seems to be specific to the
Linux kernel (that the kernel seems to be messing up with the
order of delivery of the SIGCHLD (or return from waitpid()) and
SIGINT), we may want to bring the issue up to him.

Here, the behaviour could be seen as a kernel bug, since the
child should clearly die *after* the SIGINT has been issued to
the parent (since the ^C should insert the SIGINT in the signal
queue of both parent and child processes at the same time) so
it's wrong for SIGINT to be handled *after* waitpid() returns.

But of course one can also argue that the order of signal
delivery is not guaranteed in general anyway.

IMO, the best approach would be to give up on WCE altogether
which is more source of frustration anyway than it has ever
helped. I live very well with a /bin/sh (dash) and interactive
shell (zsh) that don't do it.

WCE may be good in a perfect world where everything does it
(everything that calls waitpid() without using system(3)), but
if not, I hardly see the point.

What's the point of bash doing it when sh, find -exec, xargs,
watch, git (like in that emacs bug report) don't do it.

it seems to me that finding another way to address it (like
emacs approach of putting itself on its own in a new forground
job if it's not already a process group leader) for the rare
cases where it's useful (like the vi -> :! case) would be
better.

-- 
Stephane

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


Thread

Re: SIGINT handling Stephane Chazelas <stephane.chazelas@gmail.com> - 2015-09-24 14:57 +0100

csiph-web