Skip to contentSkip to conversation

Failure after v6.0-rc4-215-ge35ff25f9fda: Merge tag 'linux-kselftest-kunit-fixes-6.0-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest

TCWG CI [email protected] 2 participants 2 messages Sep 13, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Failure after v6.0-rc4-215-ge35ff25f9fda: Merge tag 'linux-kselftest-kunit-fixes-6.0-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:

Results changed to
-10

# build_abe binutils:
-9
# build_kernel_llvm:
-5
# build_abe qemu:
-2
# linux_n_obj:
23021
# First few build errors in logs:
# 00:05:09 crypto/wp512.c:782:13: error: stack frame size (1168) exceeds limit (1024) in 'wp512_process_buffer' [-Werror,-Wframe-larger-than]
# 00:05:09 make[1]: *** [scripts/Makefile.build:249: crypto/wp512.o] Error 1
# 00:08:22 make: *** [Makefile:1853: crypto] Error 2
# 00:15:17 drivers/gpu/drm/selftests/test-drm_mm.c:372:12: error: stack frame size (1032) exceeds limit (1024) in '__igt_reserve' [-Werror,-Wframe-larger-than]
# 00:15:17 make[4]: *** [scripts/Makefile.build:249: drivers/gpu/drm/selftests/test-drm_mm.o] Error 1
# 00:15:42 make[3]: *** [scripts/Makefile.build:465: drivers/gpu/drm/selftests] Error 2
# 00:31:04 drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu13/smu_v13_0_7_ppt.c:1434:12: error: stack frame size (1080) exceeds limit (1024) in 'smu_v13_0_7_get_power_profile_mode' [-Werror,-Wframe-larger-than]
# 00:31:04 make[4]: *** [scripts/Makefile.build:249: drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu13/smu_v13_0_7_ppt.o] Error 1
# 00:33:33 drivers/staging/rtl8723bs/core/rtw_security.c:1288:5: error: stack frame size (1040) exceeds limit (1024) in 'rtw_aes_decrypt' [-Werror,-Wframe-larger-than]
# 00:33:34 make[3]: *** [scripts/Makefile.build:249: drivers/staging/rtl8723bs/core/rtw_security.o] Error 1

from
-10

# build_abe binutils:
-9
# build_kernel_llvm:
-5
# build_abe qemu:
-2
# linux_n_obj:
23022

THIS IS THE END OF INTERESTING STUFF. BELOW ARE LINKS TO BUILDS, REPRODUCTION INSTRUCTIONS, AND THE RAW COMMIT.

For latest status see comments in https://linaro.atlassian.net/browse/LLVM-647 . Status of v6.0-rc4-215-ge35ff25f9fda commit for tcwg_kernel:
commit e35ff25f9fda4385249f909bce21c8f759bc46d4
Merge: 22b2e2d6ab35 2a2dfc869d33
Author: Linus Torvalds <[email protected]>
Date: Fri Sep 9 14:13:36 2022 -0400

Merge tag 'linux-kselftest-kunit-fixes-6.0-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest

Pull KUnit fixes from Shuah Khan:
"Two fixes to test build and a fix for incorrect taint reason reporting"

* tag 'linux-kselftest-kunit-fixes-6.0-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
tools: Add new "test" taint to kernel-chktaint
kunit: fix Kconfig for build-in tests USB4 and Nitro Enclaves
kunit: fix assert_type for comparison macros
* llvm-release-arm-mainline-allmodconfig
** Failure after v6.0-rc4-215-ge35ff25f9fda: Merge tag 'linux-kselftest-kunit-fixes-6.0-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
** https://ci.linaro.org/job/tcwg_kernel-llvm-build-llvm-release-arm-mainline-allmodconfig/396/

Bad build: https://ci.linaro.org/job/tcwg_kernel-llvm-build-llvm-release-arm-mainline-allmodconfig/396/artifact/artifacts
Good build: https://ci.linaro.org/job/tcwg_kernel-llvm-build-llvm-release-arm-mainline-allmodconfig/395/artifact/artifacts

Reproduce current build:
<cut>
mkdir -p investigate-linux-e35ff25f9fda4385249f909bce21c8f759bc46d4 cd investigate-linux-e35ff25f9fda4385249f909bce21c8f759bc46d4

# Fetch scripts
git clone https://git.linaro.org/toolchain/jenkins-scripts

# Fetch manifests for bad and good builds
mkdir -p bad/artifacts good/artifacts
curl -o bad/artifacts/manifest.sh https://ci.linaro.org/job/tcwg_kernel-llvm-build-llvm-release-arm-mainline-allmodconfig/396/artifact/artifacts/manifest.sh --fail curl -o good/artifacts/manifest.sh https://ci.linaro.org/job/tcwg_kernel-llvm-build-llvm-release-arm-mainline-allmodconfig/395/artifact/artifacts/manifest.sh --fail

# Reproduce bad build
(cd bad; ../jenkins-scripts/tcwg_kernel-build.sh ^^ true %%rr[top_artifacts] artifacts) # Reproduce good build
(cd good; ../jenkins-scripts/tcwg_kernel-build.sh ^^ true %%rr[top_artifacts] artifacts) </cut>

Full commit (up to 1000 lines):
<cut>
commit e35ff25f9fda4385249f909bce21c8f759bc46d4
Merge: 22b2e2d6ab35 2a2dfc869d33
Author: Linus Torvalds <[email protected]>
Date: Fri Sep 9 14:13:36 2022 -0400

Merge tag 'linux-kselftest-kunit-fixes-6.0-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest

Pull KUnit fixes from Shuah Khan:
"Two fixes to test build and a fix for incorrect taint reason reporting"

* tag 'linux-kselftest-kunit-fixes-6.0-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
tools: Add new "test" taint to kernel-chktaint
kunit: fix Kconfig for build-in tests USB4 and Nitro Enclaves
kunit: fix assert_type for comparison macros

commit 2a2dfc869d3345ccdd91322b023f4b0da84acbe7

Author: Joe Fradley <[email protected]>
Date:   Tue Aug 23 21:19:33 2022 -0700

tools: Add new "test" taint to kernel-chktaint

Commit c272612cb4a2 ("kunit: Taint the kernel when KUnit tests are run") added a new taint flag for when in-kernel tests run. This commit adds recognition of this new flag in kernel-chktaint.

With this change the correct reason will be reported if the kernel is tainted because of a test run.
Amended Commit log: Shuah Khan <[email protected]>

---
 tools/debugging/kernel-chktaint | 9 +++++++++
 1 file changed, 9 insertions(+)
tools/debugging/kernel-chktaint +9 -0
index f1af27ce9f20..279be06332be 100755
@@ -187,6 +187,7 @@ else
 	echo " * auxiliary taint, defined for and used by distros (#16)"
 
 fi
+
 T=`expr $T / 2`
 if [ `expr $T % 2` -eq 0 ]; then
 	addout " "
@@ -195,6 +196,14 @@ else
 	echo " * kernel was built with the struct randomization plugin (#17)"
 fi
 
+T=`expr $T / 2`
+if [ `expr $T % 2` -eq 0 ]; then
+	addout " "
+else
+	addout "N"
+	echo " * an in-kernel test (such as a KUnit test) has been run (#18)"
+fi
+
 echo "For a more detailed explanation of the various taint flags see"
 echo " Documentation/admin-guide/tainted-kernels.rst in the Linux kernel sources"
 echo " or https://kernel.org/doc/html/latest/admin-guide/tainted-kernels.html"

commit 793f55b2971e3a95d77ad08e9da2a3dc6c946cd7

Author: Nico Pache <[email protected]>
Date:   Wed Aug 10 19:40:56 2022 -0400

kunit: fix Kconfig for build-in tests USB4 and Nitro Enclaves

Both the USB4 and Nitro Enclaves KUNIT tests are now able to be compiled if KUNIT is compiled as a module. This leads to issues if KUNIT is being packaged separately from the core kernel and when KUNIT is run baremetal without the required driver compiled into the kernel.

Fixes 635dcd16844b ("thunderbolt: test: Use kunit_test_suite() macro")
Fixes fe5be808fa6c ("nitro_enclaves: test: Use kunit_test_suite() macro")
---
 drivers/thunderbolt/Kconfig         | 3 +--
 drivers/virt/nitro_enclaves/Kconfig | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)
drivers/thunderbolt/Kconfig +1 -2
index e76a6c173637..f12d0a3ee3e2 100644
@@ -29,8 +29,7 @@ config USB4_DEBUGFS_WRITE
 
 config USB4_KUNIT_TEST
 	bool "KUnit tests" if !KUNIT_ALL_TESTS
-	depends on (USB4=m || KUNIT=y)
-	depends on KUNIT
+	depends on USB4 && KUNIT=y
 	default KUNIT_ALL_TESTS
 
 config USB4_DMA_TEST
drivers/virt/nitro_enclaves/Kconfig +1 -1
index ce91add81401..dc4d25c26256 100644
@@ -17,7 +17,7 @@ config NITRO_ENCLAVES
 
 config NITRO_ENCLAVES_MISC_DEV_TEST
 	bool "Tests for the misc device functionality of the Nitro Enclaves" if !KUNIT_ALL_TESTS
-	depends on NITRO_ENCLAVES && KUNIT
+	depends on NITRO_ENCLAVES && KUNIT=y
 	default KUNIT_ALL_TESTS
 	help
 	  Enable KUnit tests for the misc device functionality of the Nitro

commit aded3cad909581c60335037112c4f86bbfe90f17

Author: Sander Vanheule <[email protected]>
Date:   Sun Aug 21 17:01:47 2022 +0200

kunit: fix assert_type for comparison macros

When replacing KUNIT_BINARY_*_MSG_ASSERTION() macros with KUNIT_BINARY_INT_ASSERTION(), the assert_type parameter was not always correctly transferred. Specifically, the following errors were introduced:
- KUNIT_EXPECT_LE_MSG() uses KUNIT_ASSERTION
- KUNIT_ASSERT_LT_MSG() uses KUNIT_EXPECTATION
- KUNIT_ASSERT_GT_MSG() uses KUNIT_EXPECTATION

A failing KUNIT_EXPECT_LE_MSG() test thus prevents further tests from running, while failing KUNIT_ASSERT_{LT,GT}_MSG() tests do not prevent further tests from running. This is contrary to the documentation, which states that failing KUNIT_EXPECT_* macros allow further tests to run, while failing KUNIT_ASSERT_* macros should prevent this.

Revert the KUNIT_{ASSERTION,EXPECTATION} switches to fix the behaviour for the affected macros.

Fixes 40f39777ce4f ("kunit: decrease macro layering for integer asserts")
---
 include/kunit/test.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
include/kunit/test.h +3 -3
index c958855681cc..840a2c375065 100644
@@ -826,7 +826,7 @@ do {									       \
 
 #define KUNIT_EXPECT_LE_MSG(test, left, right, fmt, ...)		       \
 	KUNIT_BINARY_INT_ASSERTION(test,				       \
-				   KUNIT_ASSERTION,			       \
+				   KUNIT_EXPECTATION,			       \
 				   left, <=, right,			       \
 				   fmt,					       \
 				    ##__VA_ARGS__)
@@ -1116,7 +1116,7 @@ do {									       \
 
 #define KUNIT_ASSERT_LT_MSG(test, left, right, fmt, ...)		       \
 	KUNIT_BINARY_INT_ASSERTION(test,				       \
-				   KUNIT_EXPECTATION,			       \
+				   KUNIT_ASSERTION,			       \
 				   left, <, right,			       \
 				   fmt,					       \
 				    ##__VA_ARGS__)
@@ -1157,7 +1157,7 @@ do {									       \
 
 #define KUNIT_ASSERT_GT_MSG(test, left, right, fmt, ...)		       \
 	KUNIT_BINARY_INT_ASSERTION(test,				       \
-				   KUNIT_EXPECTATION,			       \
+				   KUNIT_ASSERTION,			       \
 				   left, >, right,			       \
 				   fmt,					       \
 				    ##__VA_ARGS__)

</cut>

#1 lore raw
Quoted 26 lines · On Tue, Sep 13, 2022 at 03:43:43AM +0000, [email protected] wrote:

Failure after v6.0-rc4-215-ge35ff25f9fda: Merge tag 'linux-kselftest-kunit-fixes-6.0-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:

Results changed to
-10

# build_abe binutils:
-9
# build_kernel_llvm:
-5
# build_abe qemu:
-2
# linux_n_obj:
23021
# First few build errors in logs:
# 00:05:09 crypto/wp512.c:782:13: error: stack frame size (1168) exceeds limit (1024) in 'wp512_process_buffer' [-Werror,-Wframe-larger-than]
# 00:05:09 make[1]: *** [scripts/Makefile.build:249: crypto/wp512.o] Error 1
# 00:08:22 make: *** [Makefile:1853: crypto] Error 2
# 00:15:17 drivers/gpu/drm/selftests/test-drm_mm.c:372:12: error: stack frame size (1032) exceeds limit (1024) in '__igt_reserve' [-Werror,-Wframe-larger-than]
# 00:15:17 make[4]: *** [scripts/Makefile.build:249: drivers/gpu/drm/selftests/test-drm_mm.o] Error 1
# 00:15:42 make[3]: *** [scripts/Makefile.build:465: drivers/gpu/drm/selftests] Error 2
# 00:31:04 drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu13/smu_v13_0_7_ppt.c:1434:12: error: stack frame size (1080) exceeds limit (1024) in 'smu_v13_0_7_get_power_profile_mode' [-Werror,-Wframe-larger-than]
# 00:31:04 make[4]: *** [scripts/Makefile.build:249: drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu13/smu_v13_0_7_ppt.o] Error 1
# 00:33:33 drivers/staging/rtl8723bs/core/rtw_security.c:1288:5: error: stack frame size (1040) exceeds limit (1024) in 'rtw_aes_decrypt' [-Werror,-Wframe-larger-than]
# 00:33:34 make[3]: *** [scripts/Makefile.build:249: drivers/staging/rtl8723bs/core/rtw_security.o] Error 1

from
-10

Quoted 8 lines
# build_abe binutils:
-9
# build_kernel_llvm:
-5
# build_abe qemu:
-2
# linux_n_obj:
23022

This appears to have a similar cause as before [1]. This is allmodconfig so I suspect the restriction of CONFIG_USB4_KUNIT_TEST causes drivers/thunderbolt/test.o to be dropped from the build.

TL;DR: Bot's heuristic for determining a regression (fewer nunber of objects built plus a build error) was falsely triggered.

[1]: https://lore.kernel.org/[email protected]/

Cheers,
Nathan