zsh-workers
 help / color / mirror / code / Atom feed
From: "VAN VLIERBERGHE Stef" <stef.van-vlierberghe@eurocontrol.int>
To: "Bart Schaefer" <schaefer@brasslantern.com>, <zsh-workers@zsh.org>
Subject: RE: zsh hangs sometimes continued.
Date: Fri, 1 Apr 2011 23:33:06 +0200	[thread overview]
Message-ID: <1B2B2EF98D55CB41BD16F13B18B9B0080EA2086B@FFBRUE001.cfmu.corp.eurocontrol.int> (raw)
In-Reply-To: <110401071802.ZM3412@torch.brasslantern.com>

Thanks for fixing, Peter.

Bart, the kernel will not re-use a pid until the parent process collects
the
state change by a wait system call (zsh uses wait4()) so it is
impossible for
a process with the same pid to exist when the wait returns. As long as
the
parent process (usually inside the zhandler catching the SIGCHLD)
updates the
job table and pid state before the process forks a new child there is no
additional problem I believe. A new process with the same pid could
appear before
the job table update is complete, but it won't be a child of this same
parent
process.

-----Original Message-----
From: Bart Schaefer [mailto:schaefer@brasslantern.com]
Sent: Friday 1 April 2011 16:18
To: zsh-workers@zsh.org
Subject: Re: zsh hangs sometimes continued.

On Apr 1, 10:28am, Peter Stephenson wrote:
} Subject: Re: zsh hangs sometimes continued.
}
} On Thu, 31 Mar 2011 20:32:58 +0200
} VAN VLIERBERGHE Stef <stef.van-vlierberghe@eurocontrol.int> wrote:
} > After adding more and more debug info to the zsh-4.3.10 sources I
} > figured out that the problem is in the findjob returning the pid of
} > a terminated process.
}
} Thanks for the investigation and the explanation.  I agree the uses of
} findproc() all appear to assume the process is still marked
as running,
} since they are all about to update it.  Here's the patch I'll apply.

Reading the explanation left me wondering whether there's an additional
problem in the event that the shell is spawning processes fast enough
for the PID of a terminated-but-not-yet-reaped job to have been re-used
in a new still-running job?

____
 
This message and any files transmitted with it are legally privileged and intended for the sole use of the individual(s) or entity to whom they are addressed. If you are not the intended recipient, please notify the sender by reply and delete the message and any attachments from your system. Any unauthorised use or disclosure of the content of this message is strictly prohibited and may be unlawful.
 
Nothing in this e-mail message amounts to a contractual or legal commitment on the part of EUROCONTROL, unless it is confirmed by appropriately signed hard copy.
 
Any views expressed in this message are those of the sender.


  reply	other threads:[~2011-04-01 22:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1301593035.6016.ezmlm@zsh.org>
2011-03-31 18:32 ` VAN VLIERBERGHE Stef
2011-04-01  9:28   ` Peter Stephenson
2011-04-01 14:18     ` Bart Schaefer
2011-04-01 21:33       ` VAN VLIERBERGHE Stef [this message]
2011-04-01 21:48       ` Phil Pennock
2011-04-01 23:40         ` Bart Schaefer

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=1B2B2EF98D55CB41BD16F13B18B9B0080EA2086B@FFBRUE001.cfmu.corp.eurocontrol.int \
    --to=stef.van-vlierberghe@eurocontrol.int \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).