public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@suse.cz>
To: chet@po.cwru.edu, adam@yggdrasil.com
Cc: bug-bash@gnu.org, linux-kernel@vger.kernel.org
Subject: Re: Patch(?): bash-2.05/jobs.c loses interrupts
Date: Tue, 1 May 2001 18:02:22 +0200	[thread overview]
Message-ID: <20010501180222.A18016@bug.ucw.cz> (raw)
In-Reply-To: <010430164417.AA94167.SM@nike.ins.cwru.edu>
In-Reply-To: <010430164417.AA94167.SM@nike.ins.cwru.edu>; from Chet Ramey on Mon, Apr 30, 2001 at 12:44:17PM -0400

Hi!

> > 	Linux-2.4.4 has a change, for which I must accept blame,
> > where fork() runs the child first, reducing unnecessary copy-on-write
> > page duplications, because the child will usually promptly do an
> > exec().  I understand this is pretty standard in most unixes.
> > 
> > 	Peter Osterlund noticed an annoying side effect of this,
> > which I think is a bash bug.  He wrote:
> > 
> > > Another thing is that the bash loop "while true ; do /bin/true ; done" is
> > > not possible to interrupt with ctrl-c.
> > 
> > 	I have reproduced this problem on a single CPU system.
> > I also modified my kernel to sometimes run the fork child first
> > and sometimes not.  In that case, that loop would sometimes
> > abort on a control-C and sometimes ignore it, but ignoring it
> > would not make the loop less likely to abort on another control-C.
> > I'm pretty sure the control-C was being delivered only to the child
> > due to a race condition in bash, which may be mandated by posix.
> 
> Did you reconfigure and rebuild bash on your machine running the 2.4
> kernel, or just use a bash binary built on a previous kernel
> version?

This is nasty race condition. I do not believe you can test for it in
configure. 

This might happen on 2.4.3 (occasionally) too. Kernel is permitted to
do any kind of scheduling!

								Pavel

> Bash has an autoconf test that will, if it detects the need to do so,
> force the job control code to synchronize between parent and child
> when setting up the process group for a new pipeline.  It may be the
> case that you have to reconfigure and rebuild bash to enable that code.
> 
> Look for PGRP_PIPE in config.h.


-- 
I'm pavel@ucw.cz. "In my country we have almost anarchy and I don't care."
Panos Katsaloulis describing me w.r.t. patents at discuss@linmodems.org

  reply	other threads:[~2001-05-01 16:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-30 16:44 Patch(?): bash-2.05/jobs.c loses interrupts Chet Ramey
2001-05-01 16:02 ` Pavel Machek [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-04-30 22:05 Adam J. Richter
2001-04-29  7:14 Adam J. Richter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010501180222.A18016@bug.ucw.cz \
    --to=pavel@suse.cz \
    --cc=adam@yggdrasil.com \
    --cc=bug-bash@gnu.org \
    --cc=chet@po.cwru.edu \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox