Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re:Re: job control problem
- X-seq: zsh-users 16858
- From: hanpingtian <hanpingtian@xxxxxxx>
- To: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re:Re: job control problem
- Date: Wed, 7 Mar 2012 17:16:52 +0800 (CST)
- Cc: zsh-users@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=Received:Date:From:To:Cc:Message-ID:In-Reply-To: References:Subject:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=Q8wsHNDPJkXr+LApxDfkU1tr27TErUJ1Xo IpaIaSva4=; b=MfQqJesn8HUp6n7/5j2ym1ooBF8e2ONJK7+vbCWX1G8TjgJW4m Wc4SfyU1+ktlabiGKwKG/XDwAnTMzRrSDpBKW4pBbm0yRlwiwjC9/4sRuAdhttGq 9lItfiehqiLCFW8kAGYszImpVbbxABiwxZhXwe/SvUnMohS3B0RscQlXQ=
- In-reply-to: <120306214608.ZM11429@torch.brasslantern.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <120306214608.ZM11429@torch.brasslantern.com> <2c45df49.32a93.135e774fca6.Coremail.hanpingtian@163.com>
On Tue, Mar 06, 2012 at 09:46:08PM -0800, Bart Schaefer wrote:
> On Mar 6, 6:01pm, hanpingtian wrote:
> }
> } And I noticed that when trying to run a lot of jobs in background can
> } cause zsh quit or frozen.
>
> Hmm.
>
> Zsh is attempting to reclaim job table space during the SIGCLD handler.
> I did a quick test and somewhere after a few hundred jobs the child
> handler gets called during a free(), and the handler then calls free()
> again and ends up deadlocked on a system mutex in the guts of glibc.
I noticed that sometimes zsh scripts hangs up at futex(), after run some
background jobs.
>
> This is especially likely with "zsh -x" because the PS4 prompt is
> allocated and freed each time it's printed. If I leave off the -x,
> the whole loop to 10000 runs to completion.
>
> However, if I try to reproduce this with bash by frobbing "ulimit -u",
> bash exits for me at exactly the same point as zsh. In fact we just
> had a whole discussion on zsh-workers [*] about bash exiting on fork
> failure, and how zsh either did not but ought to, or exited success
> when it should probably exit with failure.
>
> I modified t.sh to echo the loop counter so I cound run it without -x
> and still see how many iterations it made.
>
> schaefer[501] bash --version
> GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin11)
> Copyright (C) 2007 Free Software Foundation, Inc.
> schaefer[502] bash /tmp/t.sh
> 1
> ...
> 67
> /tmp/t.sh: fork: Resource temporarily unavailable
> schaefer[503] echo $?
> 128
>
> No "retry" mentioned. What am I missing?
I was using bash 4.2.10 to do this testing:
% bash --version
GNU bash, version 4.2.10(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
Looks like the bash will retry again and again.
>
>
> [*] http://www.zsh.org/mla/workers/2012/msg00187.html thread up to
> http://www.zsh.org/mla/workers/2012/msg00201.html or so
Messages sorted by:
Reverse Date,
Date,
Thread,
Author