All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 3/6] lib: Move KUnit tests into tests/ subdirectory
@ 2024-10-15  5:04 kernel test robot
  0 siblings, 0 replies; 11+ messages in thread
From: kernel test robot @ 2024-10-15  5:04 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Dan Carpenter

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20241011072509.3068328-5-davidgow@google.com>
References: <20241011072509.3068328-5-davidgow@google.com>
TO: David Gow <davidgow@google.com>

Hi David,

kernel test robot noticed the following build warnings:

[auto build test WARNING on akpm-mm/mm-nonmm-unstable]
[cannot apply to geert-m68k/for-next geert-m68k/for-linus brauner-vfs/vfs.all linus/master v6.12-rc3 next-20241014]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/David-Gow/lib-math-Move-kunit-tests-into-tests-subdir/20241011-153344
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-nonmm-unstable
patch link:    https://lore.kernel.org/r/20241011072509.3068328-5-davidgow%40google.com
patch subject: [PATCH 3/6] lib: Move KUnit tests into tests/ subdirectory
:::::: branch date: 4 days ago
:::::: commit date: 4 days ago
config: nios2-randconfig-r072-20241015 (https://download.01.org/0day-ci/archive/20241015/202410151246.ymPWVzSF-lkp@intel.com/config)
compiler: nios2-linux-gcc (GCC) 14.1.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 <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202410151246.ymPWVzSF-lkp@intel.com/

New smatch warnings:
lib/tests/memcpy_kunit.c:320 init_large() warn: calling memset(x, y, ARRAY_SIZE());
lib/tests/fortify_kunit.c:479 fortify_test_strcpy() error: strcpy() 'src' too large for 'pad.buf' (33 vs 32)
lib/tests/slub_kunit.c:99 test_first_word() error: dereferencing freed memory 'p'
lib/tests/overflow_kunit.c:480 shift_overflow_test() warn: '(_a_full << _to_shift)' 32768 can't fit into 32767 '*_d'
lib/tests/overflow_kunit.c:528 shift_truncate_test() warn: '(_a_full << _to_shift)' 65536 can't fit into 65535 '*_d'
lib/tests/overflow_kunit.c:566 shift_nonsense_test() warn: '(_a_full << _to_shift)' 18446744073709551611 can't fit into 32767 '*_d'
lib/tests/overflow_kunit.c:567 shift_nonsense_test() warn: assigning 18446744073709551611 to unsigned variable '*_d'
lib/tests/overflow_kunit.c:827 overflows_type_test() warn: assigning (-128) to unsigned variable 'v'
lib/tests/overflow_kunit.c:827 overflows_type_test() warn: assigning (-128) to unsigned variable 'v'
lib/tests/overflow_kunit.c:848 overflows_type_test() warn: 't1 + v' 65535 can't fit into 127 'v'
lib/tests/overflow_kunit.c:848 overflows_type_test() warn: 't1 + v' 65535 can't fit into 127 'v'
lib/tests/overflow_kunit.c:857 overflows_type_test() warn: assigning s16min to unsigned variable 'v'
lib/tests/overflow_kunit.c:857 overflows_type_test() warn: assigning s16min to unsigned variable 'v'
lib/tests/overflow_kunit.c:872 overflows_type_test() warn: value (-129) can't fit into (-128) 'v'
lib/tests/overflow_kunit.c:872 overflows_type_test() warn: value (-129) can't fit into (-128) 'v'
lib/tests/overflow_kunit.c:874 overflows_type_test() warn: value s16min can't fit into (-128) 'v'
lib/tests/overflow_kunit.c:874 overflows_type_test() warn: value s16min can't fit into (-128) 'v'
lib/tests/overflow_kunit.c:903 overflows_type_test() warn: assigning s32min to unsigned variable 'v'
lib/tests/overflow_kunit.c:903 overflows_type_test() warn: assigning s32min to unsigned variable 'v'
lib/tests/overflow_kunit.c:1155 castable_to_type_test() warn: unsigned '(((1 << (8 * 1 - 1 - (((-1)) < 1))) - 1) + (1 << (8 * 1 - 1 - (((-1)) < 1))))' is never less than zero.
lib/tests/overflow_kunit.c:1155 castable_to_type_test() warn: unsigned '(((1 << (8 * 1 - 1 - (((-1)) < 1))) - 1) + (1 << (8 * 1 - 1 - (((-1)) < 1))))' is never less than zero.

Old smatch warnings:
arch/nios2/include/asm/thread_info.h:62 current_thread_info() error: uninitialized symbol 'sp'.
lib/tests/fortify_kunit.c:490 fortify_test_strcpy() error: strcpy() 'src' too large for 'pad.buf' (33 vs 32)
lib/tests/fortify_kunit.c:503 fortify_test_strcpy() error: strcpy() 'src' too large for 'pad.buf' (33 vs 32)
arch/nios2/include/asm/thread_info.h:62 current_thread_info() error: uninitialized symbol 'sp'.
lib/tests/overflow_kunit.c:489 shift_overflow_test() warn: '(_a_full << _to_shift)' 69932 can't fit into 65535 '*_d'
lib/tests/overflow_kunit.c:500 shift_overflow_test() warn: '(_a_full << _to_shift)' 34966 can't fit into 32767 '*_d'
lib/tests/overflow_kunit.c:509 shift_overflow_test() warn: '(_a_full << _to_shift)' 300 can't fit into 127 '*_d'
lib/tests/overflow_kunit.c:511 shift_overflow_test() warn: '(_a_full << _to_shift)' 69932 can't fit into 32767 '*_d'
lib/tests/overflow_kunit.c:529 shift_truncate_test() warn: '(_a_full << _to_shift)' 65535 can't fit into 32767 '*_d'
lib/tests/overflow_kunit.c:567 shift_nonsense_test() warn: '(_a_full << _to_shift)' 18446744073709551611 can't fit into 65535 '*_d'
lib/tests/overflow_kunit.c:830 overflows_type_test() warn: assigning (-128) to unsigned variable 'v'
lib/tests/overflow_kunit.c:830 overflows_type_test() warn: assigning (-128) to unsigned variable 'v'
lib/tests/overflow_kunit.c:850 overflows_type_test() warn: 't1 + v' 32768 can't fit into 32767 'v'
lib/tests/overflow_kunit.c:850 overflows_type_test() warn: 't1 + v' 32768 can't fit into 32767 'v'
lib/tests/overflow_kunit.c:851 overflows_type_test() warn: 't1 + v' 65535 can't fit into 32767 'v'
lib/tests/overflow_kunit.c:851 overflows_type_test() warn: 't1 + v' 65535 can't fit into 32767 'v'
lib/tests/overflow_kunit.c:860 overflows_type_test() warn: assigning s16min to unsigned variable 'v'
lib/tests/overflow_kunit.c:860 overflows_type_test() warn: assigning s16min to unsigned variable 'v'
lib/tests/overflow_kunit.c:873 overflows_type_test() warn: 't1 + v' 32767 can't fit into 127 'v'
lib/tests/overflow_kunit.c:873 overflows_type_test() warn: 't1 + v' 32767 can't fit into 127 'v'
lib/tests/overflow_kunit.c:884 overflows_type_test() warn: 't1 + v' 4294967295 can't fit into 127 'v'
lib/tests/overflow_kunit.c:884 overflows_type_test() warn: 't1 + v' 4294967295 can't fit into 127 'v'
lib/tests/overflow_kunit.c:886 overflows_type_test() warn: 't1 + v' 65536 can't fit into 65535 'v'
lib/tests/overflow_kunit.c:886 overflows_type_test() warn: 't1 + v' 65536 can't fit into 65535 'v'
lib/tests/overflow_kunit.c:887 overflows_type_test() warn: 't1 + v' 4294967295 can't fit into 65535 'v'
lib/tests/overflow_kunit.c:887 overflows_type_test() warn: 't1 + v' 4294967295 can't fit into 65535 'v'
lib/tests/overflow_kunit.c:889 overflows_type_test() warn: 't1 + v' 32768 can't fit into 32767 'v'
lib/tests/overflow_kunit.c:889 overflows_type_test() warn: 't1 + v' 32768 can't fit into 32767 'v'
lib/tests/overflow_kunit.c:890 overflows_type_test() warn: 't1 + v' 4294967295 can't fit into 32767 'v'
lib/tests/overflow_kunit.c:890 overflows_type_test() warn: 't1 + v' 4294967295 can't fit into 32767 'v'
lib/tests/overflow_kunit.c:901 overflows_type_test() warn: 't1 + v' 2147483647 can't fit into 65535 'v'
lib/tests/overflow_kunit.c:901 overflows_type_test() warn: 't1 + v' 2147483647 can't fit into 65535 'v'
lib/tests/overflow_kunit.c:905 overflows_type_test() warn: 't1 + v' 65536 can't fit into 65535 'v'
lib/tests/overflow_kunit.c:905 overflows_type_test() warn: 't1 + v' 65536 can't fit into 65535 'v'
lib/tests/overflow_kunit.c:906 overflows_type_test() warn: 't1 + v' 2147483647 can't fit into 65535 'v'
lib/tests/overflow_kunit.c:906 overflows_type_test() warn: 't1 + v' 2147483647 can't fit into 65535 'v'
lib/tests/overflow_kunit.c:908 overflows_type_test() warn: assigning s32min to unsigned variable 'v'
lib/tests/overflow_kunit.c:908 overflows_type_test() warn: assigning s32min to unsigned variable 'v'
lib/tests/overflow_kunit.c:920 overflows_type_test() warn: value (-129) can't fit into (-128) 'v'
lib/tests/overflow_kunit.c:920 overflows_type_test() warn: value (-129) can't fit into (-128) 'v'
lib/tests/overflow_kunit.c:921 overflows_type_test() warn: 't1 + v' 2147483647 can't fit into 127 'v'
lib/tests/overflow_kunit.c:921 overflows_type_test() warn: 't1 + v' 2147483647 can't fit into 127 'v'
lib/tests/overflow_kunit.c:922 overflows_type_test() warn: value s32min can't fit into (-128) 'v'
lib/tests/overflow_kunit.c:922 overflows_type_test() warn: value s32min can't fit into (-128) 'v'
lib/tests/overflow_kunit.c:925 overflows_type_test() warn: 't1 + v' 32768 can't fit into 32767 'v'
lib/tests/overflow_kunit.c:925 overflows_type_test() warn: 't1 + v' 32768 can't fit into 32767 'v'
lib/tests/overflow_kunit.c:926 overflows_type_test() warn: value (-32769) can't fit into s16min 'v'
lib/tests/overflow_kunit.c:926 overflows_type_test() warn: value (-32769) can't fit into s16min 'v'
lib/tests/overflow_kunit.c:927 overflows_type_test() warn: 't1 + v' 2147483647 can't fit into 32767 'v'
lib/tests/overflow_kunit.c:927 overflows_type_test() warn: 't1 + v' 2147483647 can't fit into 32767 'v'
lib/tests/overflow_kunit.c:928 overflows_type_test() warn: value s32min can't fit into s16min 'v'
lib/tests/overflow_kunit.c:928 overflows_type_test() warn: value s32min can't fit into s16min 'v'
lib/tests/overflow_kunit.c:1156 castable_to_type_test() warn: unsigned '(((1 << (8 * 2 - 1 - (((-1)) < 1))) - 1) + (1 << (8 * 2 - 1 - (((-1)) < 1))))' is never less than zero.
lib/tests/overflow_kunit.c:1156 castable_to_type_test() warn: unsigned '(((1 << (8 * 2 - 1 - (((-1)) < 1))) - 1) + (1 << (8 * 2 - 1 - (((-1)) < 1))))' is never less than zero.
lib/tests/overflow_kunit.c:1157 castable_to_type_test() warn: unsigned '(((1 << (8 * 4 - 1 - (((-1)) < 1))) - 1) + (1 << (8 * 4 - 1 - (((-1)) < 1))))' is never less than zero.
lib/tests/overflow_kunit.c:1157 castable_to_type_test() warn: unsigned '(((1 << (8 * 4 - 1 - (((-1)) < 1))) - 1) + (1 << (8 * 4 - 1 - (((-1)) < 1))))' is never less than zero.
lib/tests/overflow_kunit.c:1157 castable_to_type_test() warn: unsigned '(((1 << (8 * 4 - 1 - (((-1)) < 1))) - 1) + (1 << (8 * 4 - 1 - (((-1)) < 1))))' is never less than zero.

vim +320 lib/tests/memcpy_kunit.c

96fce387d58fa8 lib/memcpy_kunit.c Kees Cook 2022-09-28  309  
96fce387d58fa8 lib/memcpy_kunit.c Kees Cook 2022-09-28  310  static void init_large(struct kunit *test)
96fce387d58fa8 lib/memcpy_kunit.c Kees Cook 2022-09-28  311  {
96fce387d58fa8 lib/memcpy_kunit.c Kees Cook 2022-09-28  312  	/* Get many bit patterns. */
96fce387d58fa8 lib/memcpy_kunit.c Kees Cook 2022-09-28  313  	get_random_bytes(large_src, ARRAY_SIZE(large_src));
96fce387d58fa8 lib/memcpy_kunit.c Kees Cook 2022-09-28  314  
96fce387d58fa8 lib/memcpy_kunit.c Kees Cook 2022-09-28  315  	/* Make sure we have non-zero edges. */
96fce387d58fa8 lib/memcpy_kunit.c Kees Cook 2022-09-28  316  	set_random_nonzero(test, &large_src[0]);
96fce387d58fa8 lib/memcpy_kunit.c Kees Cook 2022-09-28  317  	set_random_nonzero(test, &large_src[ARRAY_SIZE(large_src) - 1]);
96fce387d58fa8 lib/memcpy_kunit.c Kees Cook 2022-09-28  318  
96fce387d58fa8 lib/memcpy_kunit.c Kees Cook 2022-09-28  319  	/* Explicitly zero the entire destination. */
96fce387d58fa8 lib/memcpy_kunit.c Kees Cook 2022-09-28 @320  	memset(large_dst, 0, ARRAY_SIZE(large_dst));
96fce387d58fa8 lib/memcpy_kunit.c Kees Cook 2022-09-28  321  }
96fce387d58fa8 lib/memcpy_kunit.c Kees Cook 2022-09-28  322  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 11+ messages in thread
* [PATCH 0/6] KUnit test moves / renames
@ 2024-10-11  7:25 David Gow
  2024-10-11  7:25 ` [PATCH 3/6] lib: Move KUnit tests into tests/ subdirectory David Gow
  0 siblings, 1 reply; 11+ messages in thread
From: David Gow @ 2024-10-11  7:25 UTC (permalink / raw)
  To: Andrew Morton, Shuah Khan, Brendan Higgins, Rae Moar, Kees Cook
  Cc: linux-kselftest, kunit-dev, linux-kernel, Stephen Rothwell,
	David Gow

As discussed in [1], the KUnit test naming scheme has changed to avoid
name conflicts (and tab-completion woes) with the files being tested.
These renames and moves have caused a nasty set of merge conflicts, so
this series collates and rebases them all to be applied via
mm-nonmm-unstable alongside any lib/ changes[2].

Thanks to everyone whose patches appear here, and everyone who reviewed
on the original series. I hope I didn't break them too much during the
rebase!

Link: https://lore.kernel.org/lkml/20240720165441.it.320-kees@kernel.org/ [1]
Link: https://lore.kernel.org/lkml/CABVgOSmbSzcGUi=E4piSojh3A4_0GjE0fAYbqKjtYGbE9beYRQ@mail.gmail.com/ [2]
---

Bruno Sobreira França (1):
  lib/math: Add int_log test suite

Diego Vieira (1):
  lib/tests/kfifo_kunit.c: add tests for the kfifo structure

Gabriela Bittencourt (2):
  unicode: kunit: refactor selftest to kunit tests
  unicode: kunit: change tests filename and path

Kees Cook (1):
  lib: Move KUnit tests into tests/ subdirectory

Luis Felipe Hernandez (1):
  lib: math: Move kunit tests into tests/ subdir

 MAINTAINERS                                   |  19 +-
 arch/m68k/configs/amiga_defconfig             |   2 +-
 arch/m68k/configs/apollo_defconfig            |   2 +-
 arch/m68k/configs/atari_defconfig             |   2 +-
 arch/m68k/configs/bvme6000_defconfig          |   2 +-
 arch/m68k/configs/hp300_defconfig             |   2 +-
 arch/m68k/configs/mac_defconfig               |   2 +-
 arch/m68k/configs/multi_defconfig             |   2 +-
 arch/m68k/configs/mvme147_defconfig           |   2 +-
 arch/m68k/configs/mvme16x_defconfig           |   2 +-
 arch/m68k/configs/q40_defconfig               |   2 +-
 arch/m68k/configs/sun3_defconfig              |   2 +-
 arch/m68k/configs/sun3x_defconfig             |   2 +-
 arch/powerpc/configs/ppc64_defconfig          |   2 +-
 fs/unicode/Kconfig                            |   5 +-
 fs/unicode/Makefile                           |   2 +-
 fs/unicode/tests/.kunitconfig                 |   3 +
 .../{utf8-selftest.c => tests/utf8_kunit.c}   | 149 ++++++------
 fs/unicode/utf8-norm.c                        |   2 +-
 lib/Kconfig.debug                             |  31 ++-
 lib/Makefile                                  |  36 +--
 lib/math/Makefile                             |   5 +-
 lib/math/tests/Makefile                       |   6 +-
 .../{test_div64.c => tests/div64_kunit.c}     |   0
 lib/math/tests/int_log_kunit.c                |  75 ++++++
 .../mul_u64_u64_div_u64_kunit.c}              |   2 +-
 .../rational_kunit.c}                         |   0
 lib/tests/Makefile                            |  39 +++
 lib/{ => tests}/bitfield_kunit.c              |   0
 lib/{ => tests}/checksum_kunit.c              |   0
 lib/{ => tests}/cmdline_kunit.c               |   0
 lib/{ => tests}/cpumask_kunit.c               |   0
 lib/{ => tests}/fortify_kunit.c               |   0
 lib/{ => tests}/hashtable_test.c              |   0
 lib/{ => tests}/is_signed_type_kunit.c        |   0
 lib/tests/kfifo_kunit.c                       | 224 ++++++++++++++++++
 lib/{ => tests}/kunit_iov_iter.c              |   0
 lib/{ => tests}/list-test.c                   |   0
 lib/{ => tests}/memcpy_kunit.c                |   0
 lib/{ => tests}/overflow_kunit.c              |   0
 lib/{ => tests}/siphash_kunit.c               |   0
 lib/{ => tests}/slub_kunit.c                  |   0
 lib/{ => tests}/stackinit_kunit.c             |   0
 lib/{ => tests}/string_helpers_kunit.c        |   0
 lib/{ => tests}/string_kunit.c                |   0
 lib/{ => tests}/test_bits.c                   |   0
 lib/{ => tests}/test_fprobe.c                 |   0
 lib/{ => tests}/test_hash.c                   |   0
 lib/{ => tests}/test_kprobes.c                |   0
 lib/{ => tests}/test_linear_ranges.c          |   0
 lib/{ => tests}/test_list_sort.c              |   0
 lib/{ => tests}/test_sort.c                   |   0
 lib/{ => tests}/usercopy_kunit.c              |   0
 53 files changed, 474 insertions(+), 150 deletions(-)
 create mode 100644 fs/unicode/tests/.kunitconfig
 rename fs/unicode/{utf8-selftest.c => tests/utf8_kunit.c} (64%)
 rename lib/math/{test_div64.c => tests/div64_kunit.c} (100%)
 create mode 100644 lib/math/tests/int_log_kunit.c
 rename lib/math/{test_mul_u64_u64_div_u64.c => tests/mul_u64_u64_div_u64_kunit.c} (98%)
 rename lib/math/{rational-test.c => tests/rational_kunit.c} (100%)
 create mode 100644 lib/tests/Makefile
 rename lib/{ => tests}/bitfield_kunit.c (100%)
 rename lib/{ => tests}/checksum_kunit.c (100%)
 rename lib/{ => tests}/cmdline_kunit.c (100%)
 rename lib/{ => tests}/cpumask_kunit.c (100%)
 rename lib/{ => tests}/fortify_kunit.c (100%)
 rename lib/{ => tests}/hashtable_test.c (100%)
 rename lib/{ => tests}/is_signed_type_kunit.c (100%)
 create mode 100644 lib/tests/kfifo_kunit.c
 rename lib/{ => tests}/kunit_iov_iter.c (100%)
 rename lib/{ => tests}/list-test.c (100%)
 rename lib/{ => tests}/memcpy_kunit.c (100%)
 rename lib/{ => tests}/overflow_kunit.c (100%)
 rename lib/{ => tests}/siphash_kunit.c (100%)
 rename lib/{ => tests}/slub_kunit.c (100%)
 rename lib/{ => tests}/stackinit_kunit.c (100%)
 rename lib/{ => tests}/string_helpers_kunit.c (100%)
 rename lib/{ => tests}/string_kunit.c (100%)
 rename lib/{ => tests}/test_bits.c (100%)
 rename lib/{ => tests}/test_fprobe.c (100%)
 rename lib/{ => tests}/test_hash.c (100%)
 rename lib/{ => tests}/test_kprobes.c (100%)
 rename lib/{ => tests}/test_linear_ranges.c (100%)
 rename lib/{ => tests}/test_list_sort.c (100%)
 rename lib/{ => tests}/test_sort.c (100%)
 rename lib/{ => tests}/usercopy_kunit.c (100%)

-- 
2.47.0.rc1.288.g06298d1525-goog


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-10-15  5:05 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-15  5:04 [PATCH 3/6] lib: Move KUnit tests into tests/ subdirectory kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2024-10-11  7:25 [PATCH 0/6] KUnit test moves / renames David Gow
2024-10-11  7:25 ` [PATCH 3/6] lib: Move KUnit tests into tests/ subdirectory David Gow
2024-10-11  9:17   ` Vlastimil Babka
2024-10-11 10:44   ` Andy Shevchenko
2024-10-11 13:38     ` Geert Uytterhoeven
2024-10-11 13:57       ` Andy Shevchenko
2024-10-11 14:14         ` Geert Uytterhoeven
2024-10-11 15:21           ` Andy Shevchenko
2024-10-11 16:29             ` Christophe Leroy
2024-10-11 17:22               ` Andy Shevchenko
2024-10-11 17:20   ` Kees Cook

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.