[Bug 1618009] [NEW] using loadavg function in sysinfo.c errors out sometimes

Lily Rivers LilyRivers48 at gmail.com
Mon Aug 29 12:36:31 UTC 2016


Public bug reported:

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.

** Affects: procps (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to procps in Ubuntu.
https://bugs.launchpad.net/bugs/1618009

Title:
  using loadavg function in sysinfo.c errors out sometimes

Status in procps package in Ubuntu:
  New

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 manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/procps/+bug/1618009/+subscriptions



More information about the foundations-bugs mailing list