delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2022/05/05/19:37:26

X-Recipient: archive-cygwin AT delorie DOT com
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 31AD6385801E
Authentication-Results: sourceware.org;
dmarc=none (p=none dis=none) header.from=maxrnd.com
Authentication-Results: sourceware.org; spf=none smtp.mailfrom=maxrnd.com
X-Authentication-Warning: m0.truegem.net: mark owned process doing -bs
Date: Thu, 5 May 2022 16:36:45 -0700 (PDT)
From: Mark Geisert <mark AT maxrnd DOT com>
X-X-Sender: mark AT m0 DOT truegem DOT net
To: cygwin AT cygwin DOT com
Subject: load average calculation failing
Message-ID: <Pine.BSF.4.63.2205051618470.42373@m0.truegem.net>
MIME-Version: 1.0
X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS,
KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE,
WEIRD_PORT autolearn=no autolearn_force=no version=3.4.4
X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>

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;
}

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019