Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

RE: zsh hangs sometimes continued.



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@xxxxxxxxxxxxxxxx]
Sent: Friday 1 April 2011 16:18
To: zsh-workers@xxxxxxx
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@xxxxxxxxxxxxxxx> 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.



Messages sorted by: Reverse Date, Date, Thread, Author