From: Stephane Chazelas <Stephane_Chazelas@yahoo.fr>
To: Micah Cowan <micah@cowan.name>
Cc: davidpeer@cs.huji.ac.il, zsh-workers@sunsite.dk
Subject: Re: Bug in ulimit ?
Date: Tue, 17 Apr 2007 10:42:44 +0100 [thread overview]
Message-ID: <20070417094244.GA4955@sc.homeunix.net> (raw)
In-Reply-To: <462493C0.20700@cowan.name>
On Tue, Apr 17, 2007 at 02:30:40AM -0700, Micah Cowan wrote:
> David Peer wrote:
> > If the user run: ulimit -t 0, he can run jobs without any cputime
> > limitation:
>
> This sounds more like a kernel problem to me than a zsh bug. I get the
> same behavior on my Ubuntu 7.04 (beta) system, in _bash_.
>
> I note that getrlimit(2) says:
>
> In 2.6.x kernels before 2.6.17, a RLIMIT_CPU limit of 0 is wrongly
> treated as "no limit" (like RLIM_INFINITY). Since kernel 2.6.17, set???
> ting a limit of 0 does have an effect, but is actually treated as a
> limit of 1 second.
>
> However, I'm running 2.6.20(-14-generic), and still experiencing that
> symptom.
[...]
(note that there's a lot a modern CPU can do in 1 second).
Works as I'd expect from your man page quote here:
$ time zsh -c 'ulimit -t 0; while :; do :; done'
zsh: cpu limit exceeded zsh -c 'ulimit -t 0; while :; do :; done'
zsh -c 'ulimit -t 0; while :; do :; done' 0.72s user 0.28s system 95% cpu 1.050 total
$ time bash -c 'ulimit -t 0; while :; do :; done'
zsh: killed bash -c 'ulimit -t 0; while :; do :; done'
bash -c 'ulimit -t 0; while :; do :; done' 1.00s user 0.00s system 95% cpu 1.047 total
$ uname -a
Linux sc.homeunix.net 2.6.21-rc4 #1 PREEMPT Sun Mar 25 15:39:31 BST 2007 i686 GNU/Linux
~$ uname -rs
Linux 2.6.21-rc4
The abnormally high system time with zsh seems to be due to (according to
strace):
rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
rt_sigprocmask(SIG_BLOCK, [CHLD], [CHLD], 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [CHLD], [CHLD], 8) = 0
rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
rt_sigprocmask(SIG_BLOCK, [CHLD], [CHLD], 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [CHLD], [CHLD], 8) = 0
[...]
--
Stéphane
next prev parent reply other threads:[~2007-04-17 9:43 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-17 9:00 David Peer
2007-04-17 9:30 ` Micah Cowan
2007-04-17 9:33 ` David Peer
2007-04-17 9:42 ` Stephane Chazelas [this message]
2007-04-17 10:04 ` Micah Cowan
2007-04-17 10:43 ` Stephane Chazelas
2007-04-17 10:55 ` Micah Cowan
2007-04-17 12:53 ` Stephane Chazelas
2007-04-17 13:03 ` Stephane Chazelas
2007-04-17 13:24 ` Stephane Chazelas
2007-04-17 13:34 ` Stephane Chazelas
2007-04-17 13:54 ` David Peer
2007-04-17 13:57 ` David Peer
2007-04-17 15:02 ` [OT] " Stephane Chazelas
2007-04-17 10:49 ` Micah Cowan
2007-04-17 14:15 ` Tom Alsberg
2007-04-17 15:48 ` David Peer
[not found] ` <20070417151501.GH4955@sc.homeunix.net>
2007-04-18 7:46 ` (Off-Topic) " Tom Alsberg
2007-04-18 8:22 ` Stephane Chazelas
2007-04-18 9:23 ` (Off-Topic) Bug in ulimit? Tom Alsberg
2007-04-18 10:10 ` Stephane Chazelas
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=20070417094244.GA4955@sc.homeunix.net \
--to=stephane_chazelas@yahoo.fr \
--cc=davidpeer@cs.huji.ac.il \
--cc=micah@cowan.name \
--cc=zsh-workers@sunsite.dk \
/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).