Re: totally weirdass problem, Squid-2.3-4 and FreeBSD

2001-08-24 Thread mki

Try recompiling squid *after* you have your local shell's ulimit's 
unlimited, so that the higher limits get set by configure.

Steps:
1. fix up your /etc/rc.sysctl to up kern.maxfilesperproc and kern.maxfiles
2. ulimit -n 1 (or if in csh/tcsh, type unlimit)
   * you may have to force the hardlimits up as well
3. recompile squid (ie. rerun configure so it picks up the new values)
4. install squid

this should address the problems you see..  good luck..

-mohan

On Fri, Aug 24, 2001 at 01:18:39PM -0400, Jim Mercer wrote:
> this is because we have:
> 
> /etc/rc (with default limits)
>   /etc/rc.sysclt (ups some of the limits)
>   /usr/local/etc/rc.d/squid.sh (inherits /etc/rc limits)
>  /usr/local/bin/RunCache (squid wrapper, inherits rc.d/squid.sh limits)
>/usr/local/sbin/squid (inherits RunCache limits)
> 
> so, if i just kill squid, it re-ineherits the limits effectively from /etc/rc.
> 
> if i kill RunCache and squid, then restart, it gets the sysctl.conf limits.
> 
> is there a work-around for this, other than killing/restarting squid after
> each reboot?

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



4.4-stable, savecore and integer overflow in get_dumpsize()

2001-10-04 Thread mki

It appears that get_dumpsize is b0rked in that the following
returns a negative number for systems with large memory/swap 
configs:

void
get_dumpsize()
{
int kdumpsize;

/* Read the dump size. */
DumpRead(dumpfd, &kdumpsize, sizeof(kdumpsize),
(off_t)(dumplo + ok(dump_nl[X_DUMPSIZE].n_value)), L_SET);
dumpsize = kdumpsize * getpagesize();
}


the dumpsize = kdumpsize * getpagesize() produces a negative
number when kdumpsize = 1032192; resulting in savecore exiting without
actually performing the dump in save_core().

Here's the patch to address it:

--- savecore.c.old  Thu Oct  4 16:22:16 2001
+++ savecore.c  Thu Oct  4 16:25:07 2001
@@ -601,7 +601,7 @@
/* Read the dump size. */
DumpRead(dumpfd, &kdumpsize, sizeof(kdumpsize),
(off_t)(dumplo + ok(dump_nl[X_DUMPSIZE].n_value)), L_SET);
-   dumpsize = kdumpsize * getpagesize();
+   dumpsize = (off_t) kdumpsize * (off_t) getpagesize();
 }
 
 /*

can someone please commit this fix?  

thanks
-mohan


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



regcomp, bounds overrun in computematchjumps

2001-10-13 Thread mki

Here's a wierd problem i ran into with regcomp, using the attached
test program linked against libefence.  Am I missing something obvious,
other than the fact that it is a "not-so-correct" regex?  Also, the
stranger part is that when the /10 is replaced with /11 (YMMV) the
problem doesn't occur.

#include 
#include 
#include 

int main(int argc, char **argv) {
  regex_t   preg;
  int   r;
  char  errbuf[512];

  r = regcomp(&preg, "127.0.0.1/10", REG_NOSUB|REG_EXTENDED|REG_ICASE);
  if ( r != 0 ) {
regerror(r, &preg, errbuf, sizeof(errbuf));
printf("couldn't compile regex pattern, %s\n", errbuf);
return -1;
  }

  return 0;
}

Program received signal SIGBUS, Bus error.
0x804c5d5 in computematchjumps (p=0xbfbff46c, g=0x28104ea0) at regcomp.c:2048
2048ssuffix = pmatches[ssuffix];
(gdb) where
#0  0x804c5d5 in computematchjumps (p=0xbfbff46c, g=0x28104ea0) at regcomp.c:2048
#1  0x8048fe8 in regcomp (preg=0xbfbff70c, pattern=0x804da20 "127.0.0.1/10", cflags=7) 
at regcomp.c:281
#2  0x8048d08 in main (argc=1, argv=0xbfbff770) at test.c:10
#3  0x8048c5d in _start ()
(gdb) frame 0
#0  0x804c5d5 in computematchjumps (p=0xbfbff46c, g=0x28104ea0) at regcomp.c:2048
2048ssuffix = pmatches[ssuffix];
(gdb) l
2043while (suffix <= ssuffix && suffix < g->mlen) {
2044g->matchjump[suffix] = MIN(g->matchjump[suffix],
2045g->mlen + ssuffix - suffix);
2046suffix++;
2047}
2048ssuffix = pmatches[ssuffix];
2049}
2050
2051free(pmatches);
2052}
(gdb) print ssuffix
$1 = 4
(gdb) l 2000
1995
1996/* Avoid making errors worse */
1997if (p->error != 0)
1998return;
1999
2000pmatches = (int*) malloc(g->mlen * sizeof(unsigned int));
2001if (pmatches == NULL) {
2002g->matchjump = NULL;
2003return;
2004}
(gdb) print g->mlen
$2 = 4
(gdb) print pmatches[0]
$3 = 3
(gdb) print pmatches[1]
$4 = 3
(gdb) print pmatches[2]
$5 = 3
(gdb) print pmatches[3]
$6 = 4
(gdb) print pmatches[4]
Error accessing memory address 0x2810d000: Bad address.
(gdb) print ssuffix
$7 = 4
(gdb) 

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



request for %busy feature in iostat

2001-12-18 Thread mki

Any possiblity of incorporating the %busy stats in iostat for 4.5, I
know that it's available in systat, but it would be great if iostat 
would show this detailed info as well.  If it makes things easier, I
submitted a patch against -stable back on Aug 27th:

- Date: Mon, 27 Aug 2001 22:28:06 -0700
- To: [EMAIL PROTECTED]
- Subject: thoughts on %busy in iostat
- Message-ID: <[EMAIL PROTECTED]>

Thanks much in advance,
-mohan

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message