Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Aug 2000 19:25:43 -0400 (EDT)
From:      Brian Fundakowski Feldman <green@FreeBSD.org>
To:        Don Lewis <Don.Lewis@tsc.tdk.com>
Cc:        freebsd-stable@FreeBSD.ORG
Subject:   Re: 4.1 STABLE broken since today!
Message-ID:  <Pine.BSF.4.21.0008311915530.17114-100000@green.dyndns.org>
In-Reply-To: <200008311321.GAA09415@salsa.gv.tsc.tdk.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 31 Aug 2000, Don Lewis wrote:

> On Aug 31,  6:11am, Tor.Egge@fast.no wrote:
> } Subject: Re: 4.1 STABLE broken since today!
> } > 
> } > As commented on freebsd-current, this seems to have hit the -CURRENT
> } > kernel at the same time.  Someone should *not* have MFC'd some change
> } > immediately.  Not clear who yet.  I'm suspicious of the sbappend() changes
> } > that have been going in recently.
> } 
> } 
> } 1.  The value of diff in chgsbsize was always positive
> }     (unsigned - unsigned results in an unsigned value).
> }     This causes bogus values in ui_sbsize.
> 
> [ snip ]
> 
> } The following patch works for me.
> } 
> } Index: sys/kern/kern_proc.c
> } ===================================================================
> } RCS file: /home/ncvs/src/sys/kern/kern_proc.c,v
> } retrieving revision 1.72
> } diff -u -r1.72 kern_proc.c
> } --- sys/kern/kern_proc.c	2000/08/30 04:49:07	1.72
> } +++ sys/kern/kern_proc.c	2000/08/31 03:56:30
> } @@ -210,7 +211,7 @@
> }  	if (uip == NULL)
> }  		uip = uicreate(uid);
> }  	s = splnet();
> } -	diff = to - *hiwat;
> } +	diff = (rlim_t) to - (rlim_t) *hiwat;
> }  	/* don't allow them to exceed max, but allow subtraction */
> }  	if (diff > 0 && uip->ui_sbsize + diff > max) {
> }  		(void)uifree(uip);
> 
> This depends on rlim_t being a signed type (which is happens to be).
> Also, if "to" is the same width as rlim_t, then this code could break
> if the difference was greater than the maximum positive value of rlim_t
> (not likely in this particular case).  Changing the test from
> 	diff > 0
> to
> 	to > *hiwat
> is much safer.

Well, rlim_t isn't going to change in the foreseeable future.  Also,
we don't support any architectures that support nearly 2^63 bytes of
physical memory; it's fair to say that there's no way for it to cause
a problem, but if you don't like it, cleanups can be done at leisure
:)

> I prefer the following patch to kern_proc.c, which also pulls uifree()
> out of splnet(), and eliminates some duplicate code.  I'm not yet running
> 4-stable, so I can't test this patch other than to see if it compiles
> without error.

We'll see, then; since this isn't critical, it can wait, right?

--
 Brian Fundakowski Feldman           \  FreeBSD: The Power to Serve!  /
 green@FreeBSD.org                    `------------------------------'



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0008311915530.17114-100000>