This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/11432] getsysstat.c returns erroneous results
- From: "rsa at us dot ibm dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 25 Mar 2010 16:04:46 -0000
- Subject: [Bug libc/11432] getsysstat.c returns erroneous results
- References: <20100325160221.11432.rsa@us.ibm.com>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From rsa at us dot ibm dot com 2010-03-25 16:04 -------
Created an attachment (id=4680)
--> (http://sourceware.org/bugzilla/attachment.cgi?id=4680&action=view)
example /proc/stat file which shows the error
The following test case:
#include<stdio.h>
#include<sys/sysinfo.h>
int main()
{
int lcpus=get_nprocs();
printf("logical cpus = %d\n",lcpus);
return 0;
}
Can be run against the attached /proc/stat file which is known to reproduce the
problem:
This stat file can be used with the testcase by bind mounting it over
/proc/stat:
cp stat /dev/shm/stat
mount --bind /dev/shm/stat /proc/stat
When run this should show:
logical cpus = 1024
since cpu1024 is high cpu number. But it shows something like (which may vary
based on the size of the 'buffer' in the next_line algorithm):
logical cpus = 137
--
http://sourceware.org/bugzilla/show_bug.cgi?id=11432
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.