using loadavg function in sysinfo.c errors out sometimes
Bug #1618009 reported by
Lily Rivers
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
procps (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Lines 379 - 383 in sysinfo.c have the following code:
if (sscanf(buf, "%lf %lf %lf", &avg_1, &avg_5, &avg_15) < 3) {
fputs("bad data in " LOADAVG_FILE "\n", stderr);
free(savelocale);
exit(1);
}
At random, a program will exit when calling this function. If the function succeeds the first time, it will succeed in all other attempts to read /proc/loadavg. The file /proc/loadavg contains 5 numbers so maybe only the first 3 should be read and the rest should just be discarded.
To post a comment you must log in.