Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Sep 2008 09:53:11 +0400 (MSD)
From:      Yuriy Tsibizov <Yuriy.Tsibizov@gfk.ru>
To:        Manfred Antar <null@pozo.com>
Cc:        ports@freebsd.org, Yuriy.Tsibizov@gfk.ru, freebsd-current@freebsd.org, Claus Guttesen <kometen@gmail.com>
Subject:   /usr/bin/limits (WAS: Re: Apache.sh on current)
Message-ID:  <20080902095229.Y1605@atwork.home.local>
In-Reply-To: <200809011436.m81Eaq2v040141@pozo.com>
References:  <200809011335.m81DZW8b006033@pozo.com> <b41c75520809010719pe5a8e19nb32a925f44a80a47@mail.gmail.com> <200809011436.m81Eaq2v040141@pozo.com>

next in thread | previous in thread | raw e-mail | index | archive | help

On Mon, 1 Sep 2008, Manfred Antar wrote:

> At 07:19 AM 9/1/2008, Claus Guttesen wrote:
>>> /usr/local/etc/rc.d/apache.sh :
>>> /usr/bin/limits -e -U www
>>> dumps core when starting apache on current
>>> This something new, not sure when it started as I have been out of the Country for the past month.
>>> Kernel and usr are current
>>> Also /usr/local/sbin/apachect :
>>> eval `limits -e -C daemon`
>>> also dumps core
>>
>> Are you using apache and php?
>>
>> --
>> regards
>> Claus
>>
>> When lenity and cruelty play for a kingdom,
>> the gentler gamester is the soonest winner.
>>
>> Shakespeare
>
> Yes
> But if I just do limits -e -U root I get a core dump.
> I don't think the problem is with apache.
> limits -e -U (Any User) dumps core

It's not apache problem. There was new limit added to kernel, and 
/usr/src/usr.bin/limits was not updated.

looking in limits core (lines are a bit different, I had some debug 
printfs in .c file):

(gdb) bt
#0  0x00000000 in ?? ()
#1  0x0804937d in main (argc=3, argv=0xbfbfed44)
      at /usr/src/usr.bin/limits/limits.c:341
   (gdb) l
341		    val = resources[rcswhich].func(lc, resources[rcswhich].cap, limits[rcswhich].rlim_cur, limits[rcswhich].rlim_cur);
342		    limits[rcswhich].rlim_cur = resources[rcswhich].func(lc, str, val, val);
343		    /* maximum value overridden by resourcename or resourcename-max */
344		    sprintf(str, "%s-max", resources[rcswhich].cap);
345		    val = resources[rcswhich].func(lc, resources[rcswhich].cap, limits[rcswhich].rlim_max, limits[rcswhich].rlim_max);
346		    limits[rcswhich].rlim_max = resources[rcswhich].func(lc, str, val, val);
347		}
348		}
349	    }
350
   (gdb) p resources
$1 = {{cap = 0x804adc2 "cputime", func = 0x8048c84 <login_getcaptime>}, {
      cap = 0x804adca "filesize", func = 0x8048c34 <login_getcapsize>}, {
      cap = 0x804add3 "datasize", func = 0x8048c34 <login_getcapsize>}, {
      cap = 0x804addc "stacksize", func = 0x8048c34 <login_getcapsize>}, {
      cap = 0x804ade6 "coredumpsize", func = 0x8048c34 <login_getcapsize>},{
      cap = 0x804adf3 "memoryuse", func = 0x8048c34 <login_getcapsize>}, {
      cap = 0x804adfd "memorylocked", func = 0x8048c34 <login_getcapsize>},{
      cap = 0x804ae0a "maxproc", func = 0x8048c94 <login_getcapnum>}, {
      cap = 0x804ae12 "openfiles", func = 0x8048c94 <login_getcapnum>}, {
      cap = 0x804ae1c "sbsize", func = 0x8048c34 <login_getcapsize>}, {
      cap = 0x804ae23 "vmemoryuse", func = 0x8048c34 <login_getcapsize>}, {
      cap = 0x0, func = 0}}

And limits dies when processing last limit.

Yuriy Tsibizov,
GfK RUS Network Administrator

p.s. Please keep me in CC.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080902095229.Y1605>