From: Dan Carpenter <dan.carpenter@linaro.org>
To: oe-kbuild@lists.linux.dev, Marie Zhussupova <marievic@google.com>,
rmoar@google.com, davidgow@google.com, shuah@kernel.org,
brendan.higgins@linux.dev
Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev, elver@google.com,
dvyukov@google.com, lucas.demarchi@intel.com,
thomas.hellstrom@linux.intel.com, rodrigo.vivi@intel.com,
linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com,
kasan-dev@googlegroups.com, intel-xe@lists.freedesktop.org,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
Marie Zhussupova <marievic@google.com>
Subject: Re: [PATCH 6/9] kunit: Enable direct registration of parameter arrays to a KUnit test
Date: Thu, 31 Jul 2025 18:58:28 +0300 [thread overview]
Message-ID: <5683507a-dacc-4e46-893f-d1e775d2ef22@suswa.mountain> (raw)
In-Reply-To: <20250729193647.3410634-7-marievic@google.com>
Hi Marie,
kernel test robot noticed the following build warnings:
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Marie-Zhussupova/kunit-Add-parent-kunit-for-parameterized-test-context/20250730-033818
base: https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git kunit
patch link: https://lore.kernel.org/r/20250729193647.3410634-7-marievic%40google.com
patch subject: [PATCH 6/9] kunit: Enable direct registration of parameter arrays to a KUnit test
config: nios2-randconfig-r072-20250731 (https://download.01.org/0day-ci/archive/20250731/202507310854.pZvIcswn-lkp@intel.com/config)
compiler: nios2-linux-gcc (GCC) 8.5.0
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
| Closes: https://lore.kernel.org/r/202507310854.pZvIcswn-lkp@intel.com/
New smatch warnings:
lib/kunit/test.c:723 kunit_run_tests() error: we previously assumed 'test_case->generate_params' could be null (see line 714)
vim +723 lib/kunit/test.c
914cc63eea6fbe Brendan Higgins 2019-09-23 681 int kunit_run_tests(struct kunit_suite *suite)
914cc63eea6fbe Brendan Higgins 2019-09-23 682 {
fadb08e7c7501e Arpitha Raghunandan 2020-11-16 683 char param_desc[KUNIT_PARAM_DESC_SIZE];
914cc63eea6fbe Brendan Higgins 2019-09-23 684 struct kunit_case *test_case;
acd8e8407b8fcc David Gow 2021-08-03 685 struct kunit_result_stats suite_stats = { 0 };
acd8e8407b8fcc David Gow 2021-08-03 686 struct kunit_result_stats total_stats = { 0 };
8631cd2cf5fbf2 Marie Zhussupova 2025-07-29 687 const void *curr_param;
914cc63eea6fbe Brendan Higgins 2019-09-23 688
c272612cb4a2f7 David Gow 2022-07-01 689 /* Taint the kernel so we know we've run tests. */
c272612cb4a2f7 David Gow 2022-07-01 690 add_taint(TAINT_TEST, LOCKDEP_STILL_OK);
c272612cb4a2f7 David Gow 2022-07-01 691
1cdba21db2ca31 Daniel Latypov 2022-04-29 692 if (suite->suite_init) {
1cdba21db2ca31 Daniel Latypov 2022-04-29 693 suite->suite_init_err = suite->suite_init(suite);
1cdba21db2ca31 Daniel Latypov 2022-04-29 694 if (suite->suite_init_err) {
1cdba21db2ca31 Daniel Latypov 2022-04-29 695 kunit_err(suite, KUNIT_SUBTEST_INDENT
1cdba21db2ca31 Daniel Latypov 2022-04-29 696 "# failed to initialize (%d)", suite->suite_init_err);
1cdba21db2ca31 Daniel Latypov 2022-04-29 697 goto suite_end;
1cdba21db2ca31 Daniel Latypov 2022-04-29 698 }
1cdba21db2ca31 Daniel Latypov 2022-04-29 699 }
1cdba21db2ca31 Daniel Latypov 2022-04-29 700
cae56e1740f559 Daniel Latypov 2022-04-29 701 kunit_print_suite_start(suite);
914cc63eea6fbe Brendan Higgins 2019-09-23 702
fadb08e7c7501e Arpitha Raghunandan 2020-11-16 703 kunit_suite_for_each_test_case(suite, test_case) {
fadb08e7c7501e Arpitha Raghunandan 2020-11-16 704 struct kunit test = { .param_value = NULL, .param_index = 0 };
acd8e8407b8fcc David Gow 2021-08-03 705 struct kunit_result_stats param_stats = { 0 };
fadb08e7c7501e Arpitha Raghunandan 2020-11-16 706
887d85a0736ff3 Rae Moar 2023-03-08 707 kunit_init_test(&test, test_case->name, test_case->log);
03806177fa4cbb Marie Zhussupova 2025-07-29 708 __kunit_init_parent_test(test_case, &test);
03806177fa4cbb Marie Zhussupova 2025-07-29 709
529534e8cba3e6 Rae Moar 2023-07-25 710 if (test_case->status == KUNIT_SKIPPED) {
529534e8cba3e6 Rae Moar 2023-07-25 711 /* Test marked as skip */
529534e8cba3e6 Rae Moar 2023-07-25 712 test.status = KUNIT_SKIPPED;
529534e8cba3e6 Rae Moar 2023-07-25 713 kunit_update_stats(¶m_stats, test.status);
44c50ed8e59936 Marie Zhussupova 2025-07-29 @714 } else if (!test_case->generate_params && !test.params_data.params) {
^^^^^^^^^^^^^^^^^^^^^^^^^^
Imagine ->generate_parms is NULL but test.params_data.params is
non-NULL.
37dbb4c7c7442d David Gow 2021-11-02 715 /* Non-parameterised test. */
529534e8cba3e6 Rae Moar 2023-07-25 716 test_case->status = KUNIT_SKIPPED;
37dbb4c7c7442d David Gow 2021-11-02 717 kunit_run_case_catch_errors(suite, test_case, &test);
37dbb4c7c7442d David Gow 2021-11-02 718 kunit_update_stats(¶m_stats, test.status);
03806177fa4cbb Marie Zhussupova 2025-07-29 719 } else if (test_case->status != KUNIT_FAILURE) {
fadb08e7c7501e Arpitha Raghunandan 2020-11-16 720 /* Get initial param. */
fadb08e7c7501e Arpitha Raghunandan 2020-11-16 721 param_desc[0] = '\0';
8631cd2cf5fbf2 Marie Zhussupova 2025-07-29 722 /* TODO: Make generate_params try-catch */
13ee0c64bd88a3 Marie Zhussupova 2025-07-29 @723 curr_param = test_case->generate_params(&test, NULL, param_desc);
^^^^^^^^^^^^^^^^^^^^^^^^^^
Then this could crash.
I suspect that this is fine, but I bet that in the previous
condition, just testing one would probably have been sufficient
or maybe we could have change && to ||.
529534e8cba3e6 Rae Moar 2023-07-25 724 test_case->status = KUNIT_SKIPPED;
6c738b52316c58 Rae Moar 2022-11-23 725 kunit_log(KERN_INFO, &test, KUNIT_SUBTEST_INDENT KUNIT_SUBTEST_INDENT
6c738b52316c58 Rae Moar 2022-11-23 726 "KTAP version 1\n");
44b7da5fcd4c99 David Gow 2021-11-02 727 kunit_log(KERN_INFO, &test, KUNIT_SUBTEST_INDENT KUNIT_SUBTEST_INDENT
44b7da5fcd4c99 David Gow 2021-11-02 728 "# Subtest: %s", test_case->name);
fadb08e7c7501e Arpitha Raghunandan 2020-11-16 729
8631cd2cf5fbf2 Marie Zhussupova 2025-07-29 730 while (curr_param) {
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2025-07-31 15:58 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-29 19:36 [PATCH 0/9] kunit: Refactor and extend KUnit's Marie Zhussupova
2025-07-29 19:36 ` [PATCH 1/9] kunit: Add parent kunit for parameterized test context Marie Zhussupova
2025-08-02 9:44 ` David Gow
2025-08-05 15:17 ` Rae Moar
2025-08-08 12:20 ` Marie Zhussupova
2025-07-29 19:36 ` [PATCH 2/9] kunit: Introduce param_init/exit for parameterized test shared context management Marie Zhussupova
2025-07-30 13:50 ` kernel test robot
2025-08-02 9:44 ` David Gow
2025-08-05 15:17 ` Rae Moar
2025-08-08 13:01 ` Marie Zhussupova
2025-07-29 19:36 ` [PATCH 3/9] kunit: Pass additional context to generate_params for parameterized testing Marie Zhussupova
2025-07-30 14:32 ` kernel test robot
2025-08-02 9:44 ` David Gow
2025-08-05 15:18 ` Rae Moar
2025-07-29 19:36 ` [PATCH 4/9] kcsan: test: Update parameter generator to new signature Marie Zhussupova
2025-08-02 9:44 ` David Gow
2025-08-07 11:11 ` Marco Elver
2025-07-29 19:36 ` [PATCH 5/9] drm/xe: " Marie Zhussupova
2025-08-02 9:44 ` David Gow
2025-08-07 10:59 ` Lucas De Marchi
2025-07-29 19:36 ` [PATCH 6/9] kunit: Enable direct registration of parameter arrays to a KUnit test Marie Zhussupova
2025-07-29 20:14 ` Rae Moar
2025-07-29 20:26 ` Rae Moar
2025-07-31 15:58 ` Dan Carpenter [this message]
2025-07-31 20:01 ` Marie Zhussupova
2025-08-02 9:44 ` David Gow
2025-08-05 15:18 ` Rae Moar
2025-08-08 1:22 ` Marie Zhussupova
2025-07-29 19:36 ` [PATCH 7/9] kunit: Add example parameterized test with shared resources and direct static parameter array setup Marie Zhussupova
2025-07-30 12:25 ` kernel test robot
2025-08-02 9:44 ` David Gow
2025-08-06 17:50 ` Marie Zhussupova
2025-08-05 15:19 ` Rae Moar
2025-07-29 19:36 ` [PATCH 8/9] kunit: Add example parameterized test with direct dynamic " Marie Zhussupova
2025-08-02 9:44 ` David Gow
2025-08-05 15:19 ` Rae Moar
2025-07-29 19:36 ` [PATCH 9/9] Documentation: kunit: Document new parameterized test features Marie Zhussupova
2025-08-02 9:45 ` David Gow
2025-08-08 13:02 ` Marie Zhussupova
2025-08-05 15:19 ` Rae Moar
2025-08-08 13:05 ` Marie Zhussupova
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5683507a-dacc-4e46-893f-d1e775d2ef22@suswa.mountain \
--to=dan.carpenter@linaro.org \
--cc=brendan.higgins@linux.dev \
--cc=davidgow@google.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=dvyukov@google.com \
--cc=elver@google.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=kasan-dev@googlegroups.com \
--cc=kunit-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=lkp@intel.com \
--cc=lucas.demarchi@intel.com \
--cc=marievic@google.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=oe-kbuild@lists.linux.dev \
--cc=rmoar@google.com \
--cc=rodrigo.vivi@intel.com \
--cc=shuah@kernel.org \
--cc=thomas.hellstrom@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®