From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from vmicros1.altlinux.org (vmicros1.altlinux.org [194.107.17.57]) by sourceware.org (Postfix) with ESMTP id E083E385840B for ; Tue, 1 Feb 2022 22:14:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E083E385840B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=altlinux.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=altlinux.org Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id 6C93472C8FA for ; Wed, 2 Feb 2022 01:14:56 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id 62A4A7CCAAC; Wed, 2 Feb 2022 01:14:56 +0300 (MSK) Date: Wed, 2 Feb 2022 01:14:56 +0300 From: "Dmitry V. Levin" To: Gleb Fotengauer-Malinovskiy Cc: libc-alpha@sourceware.org Subject: Re: [PATCH] linux: __get_nprocs_sched: initialize cpu_bits array with zeroes [BZ #28850] Message-ID: <20220201221456.GA6227@altlinux.org> References: <20220201215644.473902-1-glebfm@altlinux.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220201215644.473902-1-glebfm@altlinux.org> X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Feb 2022 22:14:57 -0000 On Tue, Feb 01, 2022 at 09:56:44PM +0000, Gleb Fotengauer-Malinovskiy wrote: > --- > sysdeps/unix/sysv/linux/getsysstats.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/sysdeps/unix/sysv/linux/getsysstats.c b/sysdeps/unix/sysv/linux/getsysstats.c > index 4798cc337e..5436bdb507 100644 > --- a/sysdeps/unix/sysv/linux/getsysstats.c > +++ b/sysdeps/unix/sysv/linux/getsysstats.c > @@ -41,6 +41,7 @@ __get_nprocs_sched (void) > > /* This cannot use malloc because it is used on malloc initialization. */ > __cpu_mask cpu_bits[cpu_bits_size / sizeof (__cpu_mask)]; > + CPU_ZERO_S(cpu_bits_size, cpu_bits); Good catch! Please cast cpu_bits to "cpu_set_t*" to make this CPU_ZERO_S invocation consistent with the CPU_COUNT_S invocation below. Also, please add a space between CPU_ZERO_S and the opening parenthesis. -- ldv