From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25201 invoked from network); 17 Apr 2007 09:43:18 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,FORGED_RCVD_HELO autolearn=ham version=3.1.8 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 17 Apr 2007 09:43:18 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 14951 invoked from network); 17 Apr 2007 09:43:12 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 17 Apr 2007 09:43:12 -0000 Received: (qmail 13202 invoked by alias); 17 Apr 2007 09:43:09 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 23283 Received: (qmail 13192 invoked from network); 17 Apr 2007 09:43:08 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 17 Apr 2007 09:43:08 -0000 Received: (qmail 14763 invoked from network); 17 Apr 2007 09:43:08 -0000 Received: from smtpout0151.sc1.he.tucows.com (HELO n064.sc1.he.tucows.com) (64.97.136.151) by a.mx.sunsite.dk with SMTP; 17 Apr 2007 09:43:05 -0000 Received: from sc.homeunix.net (82.26.163.82) by n064.sc1.he.tucows.com (7.2.069.1) id 45FC2AFB0022A606; Tue, 17 Apr 2007 09:42:49 +0000 Received: from chazelas by sc.homeunix.net with local (Exim 4.63) (envelope-from ) id 1HdkCy-0003D3-E9; Tue, 17 Apr 2007 10:42:44 +0100 Date: Tue, 17 Apr 2007 10:42:44 +0100 From: Stephane Chazelas To: Micah Cowan Cc: davidpeer@cs.huji.ac.il, zsh-workers@sunsite.dk Subject: Re: Bug in ulimit ? Message-ID: <20070417094244.GA4955@sc.homeunix.net> Mail-Followup-To: Micah Cowan , davidpeer@cs.huji.ac.il, zsh-workers@sunsite.dk References: <46248CC2.4010901@cs.huji.ac.il> <462493C0.20700@cowan.name> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <462493C0.20700@cowan.name> User-Agent: Mutt/1.5.6i 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