diff mbox series

package/ltp-testsuite: bump version to 20230516

Message ID 20230521135013.528157-1-pevik@seznam.cz
State Changes Requested
Headers show
Series package/ltp-testsuite: bump version to 20230516 | expand

Commit Message

Petr Vorel May 21, 2023, 1:50 p.m. UTC
From: Petr Vorel <petr.vorel@gmail.com>

Remove patch accepted in this release.

Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
---
Hi,

FYI bootlin-x86-64-glibc fails on new KVM tests. I suspect it's a glibc
bug, because it works well on all classic distro native gcc/clang
toolchains (CentOS 7, various Debian and Ubuntu, openSUSE, ...):

CC testcases/kernel/kvm/lib_x86.o
kvm_svm01.c: In function ‘guest_main’:
kvm_svm01.c:42:13: warning: array subscript 0 is outside array bounds of ‘uint32_t[0]’ {aka ‘unsigned int[]’} [-Warray-bounds]
   42 |         if (*avic_ptr != 0xaaaaaaaa)
      |             ^~~~~~~~~
kvm_svm01.c:45:9: warning: array subscript 0 is outside array bounds of ‘uint32_t[0]’ {aka ‘unsigned int[]’} [-Warray-bounds]
   45 |         *avic_ptr = AVIC_TEST_VAL;
      |         ^~~~~~~~~
kvm_svm01.c: In function ‘main’:
kvm_svm01.c:93:13: warning: array subscript 0 is outside array bounds of ‘uint32_t[0]’ {aka ‘unsigned int[]’} [-Warray-bounds]
   93 |         if (*avic_ptr != AVIC_TEST_VAL) {
      |             ^~~~~~~~~
br-test-pkg/bootlin-x86-64-glibc/host/opt/ext-toolchain/bin/../lib/gcc/x86_64-buildroot-linux-gnu/12.2.0/../../../../x86_64-buildroot-linux-gnu/bin/ld: lib_x86.o: in function `kvm_init_guest_vmcb':
lib_x86.c:(.text+0x7c3): undefined reference to `__stack_chk_fail'
collect2: error: ld returned 1 exit status
make[4]: *** [br-test-pkg/bootlin-x86-64-glibc/build/ltp-testsuite-20230516/testcases/kernel/kvm/Makefile:59: kvm_svm01-payload.o] Error 1
make[4]: *** Waiting for unfinished jobs....
br-test-pkg/bootlin-x86-64-glibc/host/opt/ext-toolchain/bin/../lib/gcc/x86_64-buildroot-linux-gnu/12.2.0/../../../../x86_64-buildroot-linux-gnu/bin/ld: lib_x86.o: in function `kvm_init_guest_vmcb':
lib_x86.c:(.text+0x7c3): undefined reference to `__stack_chk_fail'
collect2: error: ld returned 1 exit status
make[4]: *** [br-test-pkg/bootlin-x86-64-glibc/build/ltp-testsuite-20230516/testcases/kernel/kvm/Makefile:59: kvm_pagefault01-payload.o] Error 1
CC testcases/kernel/kvm/lib_host.o
make[3]: *** [../../include/mk/generic_trunk_target.inc:108: all] Error 2
make[2]: *** [../include/mk/generic_trunk_target.inc:108: all] Error 2

It'd also fail on bootlin-x86-64-musl, but it's being skipped due
5e1c238b72.

Any hint how to workaround this is appreciated.

Kind regards,
Petr

 ...onfigure.ac-fix-mount_attr-detection.patch | 54 -------------------
 package/ltp-testsuite/ltp-testsuite.hash      |  4 +-
 package/ltp-testsuite/ltp-testsuite.mk        |  2 +-
 3 files changed, 3 insertions(+), 57 deletions(-)
 delete mode 100644 package/ltp-testsuite/0001-configure.ac-fix-mount_attr-detection.patch

Comments

Thomas Petazzoni July 29, 2023, 8:40 p.m. UTC | #1
On Sun, 21 May 2023 15:50:13 +0200
Petr Vorel <pevik@seznam.cz> wrote:

> From: Petr Vorel <petr.vorel@gmail.com>
> 
> Remove patch accepted in this release.
> 
> Signed-off-by: Petr Vorel <petr.vorel@gmail.com>

I think we can't apply until the above is resolved, as it will affect a
significant number of builds. See below for some hints on what I
believe is going on.

> FYI bootlin-x86-64-glibc fails on new KVM tests. I suspect it's a glibc
> bug, because it works well on all classic distro native gcc/clang
> toolchains (CentOS 7, various Debian and Ubuntu, openSUSE, ...):
> 
> CC testcases/kernel/kvm/lib_x86.o
> kvm_svm01.c: In function ‘guest_main’:
> kvm_svm01.c:42:13: warning: array subscript 0 is outside array bounds of ‘uint32_t[0]’ {aka ‘unsigned int[]’} [-Warray-bounds]
>    42 |         if (*avic_ptr != 0xaaaaaaaa)
>       |             ^~~~~~~~~
> kvm_svm01.c:45:9: warning: array subscript 0 is outside array bounds of ‘uint32_t[0]’ {aka ‘unsigned int[]’} [-Warray-bounds]
>    45 |         *avic_ptr = AVIC_TEST_VAL;
>       |         ^~~~~~~~~
> kvm_svm01.c: In function ‘main’:
> kvm_svm01.c:93:13: warning: array subscript 0 is outside array bounds of ‘uint32_t[0]’ {aka ‘unsigned int[]’} [-Warray-bounds]
>    93 |         if (*avic_ptr != AVIC_TEST_VAL) {
>       |             ^~~~~~~~~
> br-test-pkg/bootlin-x86-64-glibc/host/opt/ext-toolchain/bin/../lib/gcc/x86_64-buildroot-linux-gnu/12.2.0/../../../../x86_64-buildroot-linux-gnu/bin/ld: lib_x86.o: in function `kvm_init_guest_vmcb':
> lib_x86.c:(.text+0x7c3): undefined reference to `__stack_chk_fail'
> collect2: error: ld returned 1 exit status
> make[4]: *** [br-test-pkg/bootlin-x86-64-glibc/build/ltp-testsuite-20230516/testcases/kernel/kvm/Makefile:59: kvm_svm01-payload.o] Error 1
> make[4]: *** Waiting for unfinished jobs....
> br-test-pkg/bootlin-x86-64-glibc/host/opt/ext-toolchain/bin/../lib/gcc/x86_64-buildroot-linux-gnu/12.2.0/../../../../x86_64-buildroot-linux-gnu/bin/ld: lib_x86.o: in function `kvm_init_guest_vmcb':
> lib_x86.c:(.text+0x7c3): undefined reference to `__stack_chk_fail'
> collect2: error: ld returned 1 exit status
> make[4]: *** [br-test-pkg/bootlin-x86-64-glibc/build/ltp-testsuite-20230516/testcases/kernel/kvm/Makefile:59: kvm_pagefault01-payload.o] Error 1
> CC testcases/kernel/kvm/lib_host.o
> make[3]: *** [../../include/mk/generic_trunk_target.inc:108: all] Error 2
> make[2]: *** [../include/mk/generic_trunk_target.inc:108: all] Error 2
> 
> It'd also fail on bootlin-x86-64-musl, but it's being skipped due
> 5e1c238b72.
> 
> Any hint how to workaround this is appreciated.

I don't think it's a glibc bug. The code being built in
testcases/kernel/kvm/ is some bare-metal code. The problem is that it
is being built with Stack Smashing Protection (-fstack-protector),
which requires runtime support from the gcc runtime... but that doesn't
exist for bare-metal code.

What's strange is that testcases/kernel/kvm/Makefile properly accounts
for that and passes -fno-stack-protector:

GUEST_CFLAGS = -ffreestanding -O2 -Wall -fno-asynchronous-unwind-tables -mno-mmx -mno-sse
GUEST_LDFLAGS = -nostdlib -Wl,--build-id=none -fno-stack-protector -z noexecstack

and then these flags are used as the CFLAGS/CPPFLAGS

lib_guest.o $(ARCH_OBJ): CPPFLAGS       := $(GUEST_CPPFLAGS)
lib_guest.o $(ARCH_OBJ): CFLAGS         := $(GUEST_CFLAGS)

Also, the compiler wrapper is passing -fstack-protector if you have one
of the BR2_SSP_* options enabled.

So in order to understand what's going on, could you:

(1) Run the build of ltp-testsuite in verbose mode, so that we get the
    actual compiler/linker command line, with all flags.

(2) Run the build with BR2_DEBUG_WRAPPER=2 to get the details of what
    the wrapper is doing ?

Also, which value are you using for the BR2_SSP_* Buildroot options?

Thanks!

Thomas
diff mbox series

Patch

diff --git a/package/ltp-testsuite/0001-configure.ac-fix-mount_attr-detection.patch b/package/ltp-testsuite/0001-configure.ac-fix-mount_attr-detection.patch
deleted file mode 100644
index 740d3a6d6a..0000000000
--- a/package/ltp-testsuite/0001-configure.ac-fix-mount_attr-detection.patch
+++ /dev/null
@@ -1,54 +0,0 @@ 
-From 30353a1eb3ee8940f38d6a0e8f5f39352fd8a179 Mon Sep 17 00:00:00 2001
-From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
-Date: Sun, 26 Feb 2023 20:25:54 +0100
-Subject: [PATCH] configure.ac: fix mount_attr detection
-Upstream: https://github.com/linux-test-project/ltp/commit/30353a1eb3ee8940f38d6a0e8f5f39352fd8a179
-
-Commit b857f8723f30a4b9554bf6b0ff8fa52fd07e8b60 tried to fix build with
-latest glibc which provides mount_attr in sys/mount.h. Unfortunately,
-the following build failure is still raised because sys/mount is now
-unconditionally included in include/lapi/fsmount.h:
-
-In file included from fsconfig01.c:9:
-../../../../include/lapi/fsmount.h:55:8: error: redefinition of 'struct mount_attr'
-   55 | struct mount_attr {
-      |        ^~~~~~~~~~
-In file included from ../../../../include/lapi/fsmount.h:14:
-/home/autobuild/autobuild/instance-4/output-1/host/armeb-buildroot-linux-gnueabi/sysroot/usr/include/sys/mount.h:210:8: note: originally defined here
-  210 | struct mount_attr
-      |        ^~~~~~~~~~
-
-Fixes: b857f8723 ("lapi/fsmount: resolve conflict in different header files")
-Fixes: http://autobuild.buildroot.org/results/4dbb72e1bf081afd3cd944571b9beeefc7608865
-Link: https://lore.kernel.org/ltp/20230226192554.669332-1-fontaine.fabrice@gmail.com/
-Reviewed-by: Li Wang <liwang@redhat.com>
-[ pvorel: fix from b857f8723 is needed for glibc before glibc-2.37~426,
-i.e. without fix 774058d729 ("linux: Fix sys/mount.h usage with kernel headers")
-(which was backported to 2.35 and 2.34 maintenance). ]
-Reviewed-by: Petr Vorel <pvorel@suse.cz>
-Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
----
- configure.ac | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 114468ae3..4c8763376 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -224,10 +224,10 @@ AC_CHECK_TYPES([struct __kernel_old_timeval, struct __kernel_old_timespec, struc
- 
- AC_CHECK_TYPES([struct futex_waitv],,,[#include <linux/futex.h>])
- AC_CHECK_TYPES([struct mount_attr],,,[
--#ifdef HAVE_LINUX_MOUNT_H
--# include <linux/mount.h>
--#else
-+#ifdef HAVE_MOUNT_SETATTR
- # include <sys/mount.h>
-+#elif HAVE_LINUX_MOUNT_H
-+# include <linux/mount.h>
- #endif
- ])
- 
--- 
-2.40.0
-
diff --git a/package/ltp-testsuite/ltp-testsuite.hash b/package/ltp-testsuite/ltp-testsuite.hash
index 59ba5d0045..f9fa7df78c 100644
--- a/package/ltp-testsuite/ltp-testsuite.hash
+++ b/package/ltp-testsuite/ltp-testsuite.hash
@@ -1,4 +1,4 @@ 
-# From: https://github.com/linux-test-project/ltp/releases/download/20230127/ltp-full-20230127.tar.xz.sha256
-sha256  254412a52c7238f35a247337da186f485e76fb64c6549ed849b3442fc7a417ef  ltp-full-20230127.tar.xz
+# From: https://github.com/linux-test-project/ltp/releases/download/20230516/ltp-full-20230516.tar.xz.sha256
+sha256  d78f4bdd5bdc9e91357631954affba7e66190a2509c369b59f55efd190268956  ltp-full-20230516.tar.xz
 # Locally computed
 sha256  8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643  COPYING
diff --git a/package/ltp-testsuite/ltp-testsuite.mk b/package/ltp-testsuite/ltp-testsuite.mk
index 78271b0730..2776b39042 100644
--- a/package/ltp-testsuite/ltp-testsuite.mk
+++ b/package/ltp-testsuite/ltp-testsuite.mk
@@ -4,7 +4,7 @@ 
 #
 ################################################################################
 
-LTP_TESTSUITE_VERSION = 20230127
+LTP_TESTSUITE_VERSION = 20230516
 LTP_TESTSUITE_SOURCE = ltp-full-$(LTP_TESTSUITE_VERSION).tar.xz
 LTP_TESTSUITE_SITE = https://github.com/linux-test-project/ltp/releases/download/$(LTP_TESTSUITE_VERSION)