From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796248754; b=5mc7Onr303EXeR95lmqWxP4tyO86r3gp5kFAkQNtZHMZenQ7M1jawXXXJbMA5Wc6F6Xw ZLipzI0cvIutwopcSJgJLi7qwkXqeMQHOMzR6MDYEbxTJVkz7b4oqukvueUZGn1MvFKu2 //QPx0a/zpPtWZ6lV3kyIK/s1LkH3k6TQtab65w/AxzGWuEIx5F0juYTrdKZa3uJT2MWt zg1Pgkbkx+hsvL5/wtCviRUAjzzhZo4g/Ll+wWQTgfKFy9REaf682mvBFVA6uZNa6lU2M TEmQ7cuhsYAbXxLSvCFCHWeyj4ZRvIno3aCp0wEB3/U+unEhXdQ4rC3D1fJlmplxMRQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796248754; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=YGHJcyyFykswrs3byTaELZBa1RVsWFf3flWhHXtisEw=; b=Kw5k4IqPvHZM0pZsPcFtzmvGJXiyZPHbN9W0sGyW4K1412z+9dfCS/jTfDpqshVTuZJO zcJ5Il5RzkxpE4MtZ6szFHtL4O/rx/bD9kCENePkIYh5HWeWKpkctuazdc32Y7J2Qaqdr b36jZc2/4+8caI9fcOcVoQ/Y4X6dCiZPF/lf6LcmhaDsYFoBSbH2hMJSW7V8WetM82PfD 9lT9Pw7MhBxg+bkC/lNacgfr9gGD/8qvs9XvvI/B2JvxAPZ8zUlvK+g/RWwM0Er5z00Gz gssPJn1yrRxMJZpsXePOVta3hfMrWIzPD9a6brbi6uE26d7RzPt7SJ6nHihSCHe8zTA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=aEh0J4AN; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 85A5B606A32C; Wed, 2 Dec 2026 21:59:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=aEh0J4AN Received: by smtp.kernel.org (Postfix) with ESMTPSA id 715D01F008A0; Wed, 2 Dec 2026 21:59:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796248754; bh=YGHJcyyFykswrs3byTaELZBa1RVsWFf3flWhHXtisEw=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=aEh0J4AN87TmmzNDvSq2Yc/ljmEQ6CVm7ofRtbiZWq+3A2umomY5ZcD2d/UFyMIZS uuYWXBierANLgAFkFXJM90eFk19ocgsgX/lrc5aXq4zNPgx+8VnUlfFHIVqY9ij/rW E45B6bjC1+fYEC+ZoGSyj0G9ihJ/FXSvJuS1B9zxBpV12BlYqYKJuiQl1eKjbgem95 aoAiR7X2RWFnc/7c9rUk5Xlk/0FcSD+oBRTRdw3vud9Qm/4hUET21na4JUgMy/dXFT mIN++78lOwaYVbt/WOsgB6rGY2EKXLqwjICi7JF35BmLgn1L2S8MEIgCtMHMtXY9nT cFKt2LqA0HmLg== Date: Wed, 2 Dec 2026 14:59:09 -0700 From: Nathan Chancellor To: Hamdy Abou El Anein Cc: nsc@kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, irogers@google.com, tglx@kernel.org, peterz@infradead.org Subject: Re: [PATCH] kbuild: reject nonzero checker exit status in checker-valid.sh Message-ID: <20261202215909.GA2468262@ax162> References: <20261201220057.12323-1-info@daylightlinux.ch> X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261201220057.12323-1-info@daylightlinux.ch> On Tue, Dec 01, 2026 at 11:00:57PM +0100, Hamdy Abou El Anein wrote: > The checker validation script only examines the output for the word > "error". If the checker fails without printing that word, the pipeline > still reports 1, and Kbuild treats the checker as functional. Is this actually a problem in practice? All that would happen in this scenario is that sparse would run and print errors to the console. I think the current behavior is better because the user will see the failure up front and either report it to us or address it if it is an issue with their setup. checker-valid.sh is only looking for one specific bug at the moment and I don't think that we should be swallowing all problems with sparse in this check. > Check the invocation's exit status before scanning its output. Retain > the existing output check because sparse can return zero on error. > > Tested using a mock checker that succeeds, fails silently, fails with > a diagnostic, or reports an error while returning zero. Also verified > that a missing checker is still rejected. > > AI assistance: ChatGPT identified the bug by inspecting the script and > prepared the fix, commit message and local regression tests. > > Fixes: fd69b2f7d5f4 ("compiler: Use __typeof_unqual__() for __unqual_scalar_typeof()") > Signed-off-by: Hamdy Abou El Anein > --- > scripts/checker-valid.sh | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/scripts/checker-valid.sh b/scripts/checker-valid.sh > index 625a789ed1c8..38defc32cbd9 100755 > --- a/scripts/checker-valid.sh > +++ b/scripts/checker-valid.sh > @@ -14,6 +14,10 @@ static inline int u(const int *q) > } > EOF > > -# sparse happily exits with 0 on error so validate > -# there is none on stderr. Use awk as grep is a pain with sh -e > -$@ $tmp_file 2>&1 | awk -v c=1 '/error/{c=0}END{print c}' > +# Reject a failed checker invocation even if it prints no error. > +# sparse may also exit with 0 on error, so inspect its output. > +if output=$("$@" "$tmp_file" 2>&1); then > + printf '%s\n' "$output" | awk -v c=1 '/error/{c=0}END{print c}' > +else > + echo 0 > +fi > -- > 2.56.1 > -- Cheers, Nathan