From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from m0.truegem.net (m0.truegem.net [69.55.228.47]) by sourceware.org (Postfix) with ESMTPS id 31AD6385801E for ; Thu, 5 May 2022 23:36:47 +0000 (GMT) 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 Received: from localhost (mark@localhost) by m0.truegem.net (8.12.11/8.12.11) with ESMTP id 245Naj9n098194 for ; Thu, 5 May 2022 16:36:46 -0700 (PDT) (envelope-from mark@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 X-X-Sender: mark@m0.truegem.net To: cygwin@cygwin.com Subject: load average calculation failing Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed 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@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 May 2022 23:36:50 -0000 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 #include 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; }