Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp4210863rwo; Tue, 25 Jul 2023 02:23:05 -0700 (PDT) X-Google-Smtp-Source: APBJJlEqAfdSmHDnX74RYtSPWQK6ZBT+Is8ZXwDnfQUkZP8ANHBqxIyDVM/EPT6YbZJZwuOfafWT X-Received: by 2002:a17:906:cc49:b0:982:8c28:c50d with SMTP id mm9-20020a170906cc4900b009828c28c50dmr11804132ejb.58.1690276984836; Tue, 25 Jul 2023 02:23:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690276984; cv=none; d=google.com; s=arc-20160816; b=zdoZ3l7s1gF8qCCuDV9CRxr1KOBUmvgSMFVSyeRzeDr7i76bIY9NHzcFCKNbAMhh0t ZbnueKczVBjj9jlz/36rnXMfPqF48e4W7X9u3PCfzChkGFbNMxgQaqvAWJmbPwFgUzdC 5o5Fqpi2XYyK/4ZPKkyNCoNEV/KTwhqeGnUVJ9juEA9vu9GqtPdpldpjBPVDift3J6TE xjKaSqkFoKG9qD9tNLVNss0TpWqIKdUoPtsvBDYjfl52UWhuVADt/mNl1+d1ss0RY2HR cnVdqrpnYANq+nZwAA7JCufVC3bnXdnf43Qab6H9YVVjauGpM0DvZux4vN1xwCLOfjAc TSOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=uKMqOPw73x4a2SKftYow4OU4BGnMo7ooXpjYWDj8Gno=; fh=O7RiSVu809sp+MCI0CNTqqZaV9lP7v74HKbFQncyFyQ=; b=k5y2CCFhobC44lSTuYp/wi4Rzzc4sMI2nbb+ELPpvwfAg7WQ51dbeqTj9AQRznU9qL SOMrIOb6jJsLAKH+vg3MzR0xo8JpWlrw3tR9q8d7VI4m1RHSLifnEYH5vN7cEOYY77Ih hIVS6KjERfmnpFk+cGlgBROcErtINyUwZFh1Da0/cx6FApoAbea/gafj24ARtBqaByqW WxOV/14OMczCQswhltUsFptcIg9aFz5sZ13c+biiZsvtmPGTIjwFcOpn56Qp7kuhuLS+ 8vKvnc97imQaVpsoXh3xLyrchedpK1wehr4CtrgglB1s+iXLzjh9eymKmPl9g5zsYwjE 5JOg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x10-20020a170906134a00b00988e89079fesi7649483ejb.167.2023.07.25.02.22.40; Tue, 25 Jul 2023 02:23:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232306AbjGYI4T (ORCPT + 99 others); Tue, 25 Jul 2023 04:56:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231906AbjGYIz7 (ORCPT ); Tue, 25 Jul 2023 04:55:59 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4378B270E; Tue, 25 Jul 2023 01:55:30 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7FBF615BF; Tue, 25 Jul 2023 01:55:51 -0700 (PDT) Received: from [192.168.1.3] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DB1D83F6C4; Tue, 25 Jul 2023 01:55:06 -0700 (PDT) Message-ID: <6c99392f-6189-1835-3090-d5c7f95edaf9@arm.com> Date: Tue, 25 Jul 2023 09:54:57 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH] scripts/kallsyms: Fix build failure by setting errno before calling getline() Content-Language: en-US To: Miguel Ojeda Cc: linux-kbuild@vger.kernel.org, masahiroy@kernel.org, linux-kernel@vger.kernel.org, Kees Cook , Greg Kroah-Hartman , Zhen Lei , Miguel Ojeda , Boqun Feng , Arnd Bergmann , Nicolas Schier References: <20230724131741.954624-1-james.clark@arm.com> From: James Clark In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25/07/2023 01:41, Miguel Ojeda wrote: > On Mon, Jul 24, 2023 at 3:18 PM James Clark wrote: >> >> This fixes the following build failure if scripts/kallsyms launches with >> a non-zero errno value: > > The code change sounds good to me, but could you please describe the > situation where you found the build failure? > > Cheers, > Miguel I assumed it was something to do with one of the wrappers I'm using but didn't get to the bottom of it because I'm using quite a few. But I just checked now and it's just bear [1] that causes the issue. Maybe it sets errno before forking and that persists in the child processes? Not 100% sure how it works. I did debug scripts/kallsyms and errno was already set on the first line of main(), so it's not some other library call in kallsyms that is setting it but not being checked. The minimal reproducer for me looks like this: bear -- make ARCH=arm64 LLVM=1 O=../build/ [1]: https://manpages.ubuntu.com/manpages/focal/en/man1/bear.1.html