public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Mark Geisert <mark@maxrnd.com>
To: cygwin@cygwin.com
Subject: load average calculation failing
Date: Thu, 5 May 2022 16:36:45 -0700 (PDT)	[thread overview]
Message-ID: <Pine.BSF.4.63.2205051618470.42373@m0.truegem.net> (raw)

I've recently noticed that the 'xload' I routinely run shows zero load 
even with compute-bound processes running.  This is on both Cygwin 
pre-3.4.0 as well as 3.3.4.  A test program, shown below, indicates that 
getloadavg() is returning with 0 status, i.e. not an error but no elems
of the passed-in array updated.

Stepping with gdb through the test program seems weird within the 
loadavginfo::load_init method.  Single-stepping at line loadavg.cc:68 goes 
to strace.h:52 and then to _sigbe ?!

I had recently updated both Cygwin and Windows 10 to latest at the same 
time so I cannot say when the failure started.  Last day or two at most.

..mark

-------------------
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>

int
main (int argc, char **argv)
{
     double loadavg[3];

     int res = getloadavg (loadavg, 3);
     if (res == -1)
         return 0xFF;
     if (res > 0)
         for (int i = 0; i < res; i++)
             printf ("%f.2 ", loadavg[i]);

     return res;
}

                 reply	other threads:[~2022-05-05 23:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.BSF.4.63.2205051618470.42373@m0.truegem.net \
    --to=mark@maxrnd.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).