[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [hobbit] overflow in netbsd-meminfo.c
- To: hobbit (at) hswn.dk
- Subject: Re: [hobbit] overflow in netbsd-meminfo.c
- From: "Tracy Di Marco White" <gendalia (at) iastate.edu>
- Date: Wed, 12 Nov 2008 22:27:22 -0600
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=lufPmjZnA8vh89Yw3t2ZHBqMOAQoQXum2bSnhHJede0=; b=KjkfWV1tunJ9rpLeQadHbKKAMNit7NHa1GBjy172BUGGqe/HoFhPhNGB19kLVtoFks gbooICuVvVUGDAFcmmUzSDOvjIw5DV5N0txCk7+RLSgVcvCas4B3GkWIP77a99SijZVW dg7s63ZeZuCh5tdkDR7XqdbcvwMvhwvK3BsVA=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=sV+tVRh1NfvigVCc4fdnqb237meLDHnrvlYS9cJyMQ8QJvaJZqG9I24+LfIeExXlGP XaZda1ye2n5lHBfYgVWYrfmamOXdyvBjt8LiIpwWnodxZu1vOSNGxT3UkFYNy0/jThhr 4Lq4Q2KtoaUuEiLu0LyTWWP1+Fw2eM335oneM=
- References: <2193.1226548301 (at) satai.its.iastate.edu> <491BA7B9.8000806 (at) wi.rr.com>
On Wed, Nov 12, 2008 at 10:06 PM, Rich Smrcina <rsmrcina (at) wi.rr.com> wrote:
> Tracy Di Marco White wrote:
>>
>> Hobbit client 4.2.0 shows things like this on machines I have
>> with 4GB of RAM:
>> Memory Used Total Percentage
>> Physical 4294963639M 4294966523M 0%
>> Swap 0M 4098M 0%
>>
>> With this patch it's better:
>> --- client/netbsd-meminfo.c.orig 2008-11-12 19:25:30.000000000
>> -0600
>> +++ client/netbsd-meminfo.c
>> @@ -22,7 +22,7 @@ static char rcsid[] = "$Id: netbsd-memin
>> int main(int argc, char *argv[])
>> {
>> int hw_physmem[] = { CTL_HW, HW_PHYSMEM };
>> - int physmem;
>> + unsigned long physmem;
>> int hw_pagesize[] = { CTL_HW, HW_PAGESIZE };
>> int pagesize;
>>
> That appears to be a bug in netbsd.
This is what it appears as in meminfo for one of my 4GB machines:
[meminfo]
Total:-773
Free:2884
Swaptotal:4098
Swapused:0
Since freebsd-meminfo.c seems to be using unsigned long in the same
place I modified it, I'm not sure it's a bug only in NetBSD.
-Tracy