This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/11432] getsysstat.c returns erroneous results


------- 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]