Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2592904rdb; Wed, 21 Feb 2024 12:36:41 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVTYWSqpi0KZdSbG0ezw+H50A/EH7hFsBKDEdeI8W5fB4+C7rBfT/2pMQAfWDYdxCnGCJG9grzmw9M5cnW4n9Z+zidLG6P2FKROAdnEbg== X-Google-Smtp-Source: AGHT+IHeLZzWgcrcwYk/PmOoHm7ZdX0mWtHs6mrS8yjIR1Hradd8OKMEhN0RlVLVN3lwW314sbJT X-Received: by 2002:a17:906:560a:b0:a3f:6302:1e63 with SMTP id f10-20020a170906560a00b00a3f63021e63mr975812ejq.46.1708547801173; Wed, 21 Feb 2024 12:36:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708547801; cv=pass; d=google.com; s=arc-20160816; b=Oc8fiCscqfqlY4g5iXoujvrNAqgvgs8axApB67e00iDCxu9YNyBNzUqZPPbqAlFCIT apANGjcCxLCgSfNTz2IMqEwWjNDuQ8Q/UHndh9DAjXQ6hSXKTBVXmYuLMtb23s9FrLYC j5zZIOAHJ4Uq+OYb3AIHQXq2rnC8iPybsdknZu8keGi0C8oBIzy6qvsupGH4Qi+/l6Hg 44pB3sKJ0skkK+OZJmYPJI3NkRtpSh7RD82JO/UmmCAiKs7XLFmPutI/4qi563t5pg15 AE/D4NocpetAnWgGN47cuFsoohYNzEhx88rLQLk8+uKVdqhgwYz50aoS8Vxl1b0BfRHs mziQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=8iAiTEgCppjIE3t1disnBeWTtqYJCr/gkvmRX972lsA=; fh=sSfToBFleTTgkFrQX3hhNBaeUk/tjA6qSn989OMDYAI=; b=aYLoCECRt6Ly9UpP1wZBCKAEndcSrs3CsZeYrPHNjxlIQmb483w7RiTIQW4EnZQr8s 6WrRyIlhFMV/Hm6QWFINbkBgRrxAiQ2jXCudhuT+tMrs+yT3ASCQV73r8rlu45BPyLvZ ecC1veJcTK79ICk+rPKl7XidlmkAl8MIGljgyX2JwdoHEP2uzsJGYIBLiRo+Yn/7TjBh LLF4ZLKiSwCqOufN8UnZY7NoMz+WjgP52WlJQxwupZhmoHYLT3XnDR83xpX8SoEf1Ny5 S4K/fPW6K1ye5VXM775xP5Ot9vN0tI7km0v/3jBJgCdoSuuc6EK09CdMC27VUGL5Aai6 9RyQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=2YfyKTCa; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-75469-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75469-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id d20-20020a170906371400b00a3e81575cb2si3471286ejc.364.2024.02.21.12.36.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 12:36:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-75469-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=2YfyKTCa; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-75469-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75469-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B4C471F249A0 for ; Wed, 21 Feb 2024 20:36:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D284245C10; Wed, 21 Feb 2024 20:36:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="2YfyKTCa" Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 974293B298 for ; Wed, 21 Feb 2024 20:36:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708547797; cv=none; b=TGWP3yg9D2U/R6lxyvGSYpVfV8BPjBIZA+fxrNY2DCTwqFHCy8t/WjB95EVPiGYYb1zHwUh91Rtl+SMyYsBj296Ca4b9J960sQz1DPNDkm58VQikOwzFYSW6eAUt5kNzziDBitPO7JqE/6WgkWY6QwbJDPPw8/XG5Xv0z2XQVd0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708547797; c=relaxed/simple; bh=GFhPlma8ElxwHflsLYpQTVGFiMO4B/Q3z9xrY8lb7y0=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=V1rg9ojBawlxM+WLCTFh23RetCGk8tlboiILyquDej5PW6AUIZA7+UCF+60qSvr2OAbTUHO5IoDTogpnsAuQclDIIXpcn1ZBOeQC3HvAY6VJNBwY8QIpCi8onZIoQW/xjl83pOof4GTDVrR4Wfz9dFSYqHLLJtB/BKERNeUfd48= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=2YfyKTCa; arc=none smtp.client-ip=209.85.214.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-1d89f0ab02bso27805ad.1 for ; Wed, 21 Feb 2024 12:36:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1708547795; x=1709152595; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=8iAiTEgCppjIE3t1disnBeWTtqYJCr/gkvmRX972lsA=; b=2YfyKTCalqJEmT09oHd6tBBIhAKQCDxF7k9cZJRi+n2VzJnUWP+niT0r4LbNCPyOgH 6cZtFztITsdtDbUsJtrYkw4REvWYKreLhbQVwfgKK4NNmGXKfPqCiyYl5yPwkUIazorc 4THvpwq5OQSfZv4K6eGeoTGY9mC5T4O9Cf1AF8comXvGUNUFC5BNyBsi3s36iEKWlJoV ALdfecMsG/cbTmNWMtrX9CVd/7Li88L6+ffBqCRgY6vZzpe58W81Nz25zs81BUPDkz35 DnwufmVEwZ1+v+XvfhM7tvBhCcRreE0DLCdSh1dvhSjdmcRli/gV0g0mBgZ7XoDFuXWW Wrgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708547795; x=1709152595; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8iAiTEgCppjIE3t1disnBeWTtqYJCr/gkvmRX972lsA=; b=g703IEZ+Npb9D+DhkWQy/5FEU5iV3+MwIbBSNPXdwkNfiI7Ts2T+ASEXSMdY1yfx4+ zFiKYeaLXLOITDvJia0X5b3/UCD7XW40l0gDv+VC92b3P5D89YrJ+WkcteA6YVpQL5zw MHFqvGWpWC/PIODzHpn6xeFP2f5ySz77IT9zaHcK00IvutGpAgf6/VEE4BcuGGSfJMnE 0D6LDL0A0h7l7GMT5NbOvIZO9K07hUx3lZJMNg5Nw/FyjBkphBfQ0BkC1/9F4ma6wqY0 JdxpHdKGmhUtYvsjvxI4jhAzMBfvj51WSKomR42W5pBuC4ijj28u2fMgYFGZarCH8YoQ RJlQ== X-Forwarded-Encrypted: i=1; AJvYcCW/Q5ec+BNy8uu+u5QGnjkiyV94L0dxnGOio46XJpjKKepwRl7CfDH6IDIdrnvUaB8QSqJNZlof+08lxSkF6PJGFq5SKolfWBNgPVLz X-Gm-Message-State: AOJu0Yxzdi+YEjmU+P4XlRdkRmKPtFz6DyAXFU58vgbRaJLbcNcH6JHp ZH3RkZIqbjUi3rXcG9Z5muhKrKCUI58vuOSp+UHVtxs6+6Ubrs+c6LXydM012YdRojxmGmt2Hyi WaUIwQSvIuPAXroFNFz34+65+h8O77MYB/cudoh5psr33H6UVrg== X-Received: by 2002:ac8:4907:0:b0:42e:660:eb8d with SMTP id e7-20020ac84907000000b0042e0660eb8dmr285459qtq.5.1708547393077; Wed, 21 Feb 2024 12:29:53 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240221092728.1281499-1-davidgow@google.com> <20240221092728.1281499-2-davidgow@google.com> In-Reply-To: <20240221092728.1281499-2-davidgow@google.com> From: Daniel Latypov Date: Wed, 21 Feb 2024 12:29:38 -0800 Message-ID: Subject: Re: [PATCH 1/9] kunit: test: Log the correct filter string in executor_test To: David Gow Cc: Linus Torvalds , Shuah Khan , Guenter Roeck , Rae Moar , Matthew Auld , Arunpravin Paneer Selvam , =?UTF-8?Q?Christian_K=C3=B6nig?= , Kees Cook , =?UTF-8?B?TWHDrXJhIENhbmFs?= , Rodrigo Vivi , Matthew Brost , Willem de Bruijn , Florian Westphal , Cassio Neri , Javier Martinez Canillas , Arthur Grillo , Brendan Higgins , Stephen Boyd , David Airlie , Maxime Ripard , "David S . Miller" , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, intel-xe@lists.freedesktop.org, linux-rtc@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-hardening@vger.kernel.org, netdev@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Feb 21, 2024 at 1:28=E2=80=AFAM David Gow wro= te: > > KUnit's executor_test logs the filter string in KUNIT_ASSERT_EQ_MSG(), > but passed a random character from the filter, rather than the whole > string. Note: it's worse than that, afaict. It's printing from a random bit of memory. I was curious about this, so I found under UML, the string I got was always "efault)" if I make it fail for j=3D0. > > This was found by annotating KUNIT_ASSERT_EQ_MSG() to let gcc validate > the format string. > > Fixes: 76066f93f1df ("kunit: add tests for filtering attributes") > Signed-off-by: David Gow Reviewed-by: Daniel Latypov > --- > lib/kunit/executor_test.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/kunit/executor_test.c b/lib/kunit/executor_test.c > index 22d4ee86dbed..3f7f967e3688 100644 > --- a/lib/kunit/executor_test.c > +++ b/lib/kunit/executor_test.c > @@ -129,7 +129,7 @@ static void parse_filter_attr_test(struct kunit *test= ) > GFP_KERNEL); > for (j =3D 0; j < filter_count; j++) { > parsed_filters[j] =3D kunit_next_attr_filter(&filter, &er= r); > - KUNIT_ASSERT_EQ_MSG(test, err, 0, "failed to parse filter= '%s'", filters[j]); > + KUNIT_ASSERT_EQ_MSG(test, err, 0, "failed to parse filter= from '%s'", filters); note: if there is a v2, it might be nice to include `j` in the message.