Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug in ulimit ?
- X-seq: zsh-workers 23289
- From: Stephane Chazelas <Stephane_Chazelas@xxxxxxxx>
- To: Micah Cowan <micah@xxxxxxxxxx>, zsh-workers@xxxxxxxxxx
- Subject: Re: Bug in ulimit ?
- Date: Tue, 17 Apr 2007 14:03:16 +0100
- In-reply-to: <20070417125355.GC4955@xxxxxxxxxxxxxxx>
- Mail-followup-to: Micah Cowan <micah@xxxxxxxxxx>, zsh-workers@xxxxxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <46248CC2.4010901@xxxxxxxxxxxxx> <462493C0.20700@xxxxxxxxxx> <20070417094244.GA4955@xxxxxxxxxxxxxxx> <46249BC7.8070200@xxxxxxxxxx> <20070417104303.GB4955@xxxxxxxxxxxxxxx> <4624A79F.1020107@xxxxxxxxxx> <20070417125355.GC4955@xxxxxxxxxxxxxxx>
On Tue, Apr 17, 2007 at 01:53:55PM +0100, Stephane Chazelas wrote:
[...]
> The limit doesn't seem to get inherited by the child process:
>
> ~$ perl -MBSD::Resource -le 'setrlimit(RLIMIT_CPU,0,RLIM_INFINITY); print for getrlimit(RLIMIT_CPU); while (1) { ; }'
> 0
> -1
> zsh: cpu limit exceeded perl -MBSD::Resource -le
> (152)~$ perl -MBSD::Resource -le 'setrlimit(RLIMIT_CPU,0,RLIM_INFINITY); print for getrlimit(RLIMIT_CPU); if (fork) {wait} else {while (1) { ; }}'
> 0
> -1
> <Ctrl-C>
[...]
That doesn't explain everything though.
In
zsh -c 'ulimit -t 0; (while :; do :; done)'
we get the SIGXCPU, but that's because of zsh's optimisation not
to fork() for the () that is the last statement of the inline
script.
zsh -c 'ulimit -t 0; (while :; do :; done); :'
lasts more than 1 second.
$ sh -c 'ulimit -t 0; sh -c "ulimit -t"; :'
0
So it would seem that the limit is inherited but not applied in
the child (and I couldn't see any signal being blocked or
ignored). So that's probably not a libc issue, rather a Linux
issue.
--
Stéphane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author