Skip to contentSkip to conversation

ltp: Update to 20200120

PATCH Superseded Petr Vorel 3 participants 12 messages Feb 28, 2020 – Feb 29, 2020

v5 of 7 Superseded Latest is v7 →

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

PATCH v5 1/2 ltp: Update to 20200120

Removed ffsb copying file and associated runtest file fs_ext4 (both removed in this release).

Added LIBS=-lfts for MUSL.

Removed patches (accepted upstream)
* 0001-mkswap01.sh-Add-udevadm-trigger-before-swap-verifica.patch
* 0001-testcases-fix-an-absent-format-string-issue.patch
* 0001-nm01-Remove-prefix-zeros-of-the-addresses-output-by-.patch

Merged patches
* 0006-rt_tgsigqueueinfo-disable-test-on-musl.patch
(into 0001-build-Add-option-to-select-libc-implementation.patch as they touch the same files)

Refreshed patches (some tests have been fixed for musl)
* 0001-Add-more-musl-exclusions.patch
* 0001-build-Add-option-to-select-libc-implementation.patch
* 0002-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch IMHO this one shouldn't be needed not, but CI still fails without it

Updated status
* 0008-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch
* 0001-syscalls-Check-for-time64-unsafe-syscalls-before-usi.patch

---
Changes v4->v5:
* Put back 0002-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch as it still needed on MUSL (although it should not be needed, strange). Reported by Anuj Mittal

* Remove fs_ext4 to fix build error.
https://autobuilder.yoctoproject.org/typhoon/#/builders/95/builds/574
Reported by Richard Purdie

@Anuj, @Richard: could you please test this version? (at least on MUSL)?

Kind regards,
Petr

 meta/lib/oeqa/runtime/cases/ltp.py            |   2 +-
 .../ltp/0001-Add-more-musl-exclusions.patch   |  37 +------
 ...option-to-select-libc-implementation.patch | 103 +++++-------------
 ...udevadm-trigger-before-swap-verifica.patch |  35 ------
 ...ix-zeros-of-the-addresses-output-by-.patch |  43 --------
 ...or-time64-unsafe-syscalls-before-usi.patch |  41 +++++--
 ...es-fix-an-absent-format-string-issue.patch |  24 ----
 ...rs-Link-with-libfts-explicitly-on-mu.patch |  20 ++--
 ..._tgsigqueueinfo-disable-test-on-musl.patch |  35 ------
 ...k-nfsv4-acl-acl1.c-Security-fix-on-s.patch |  27 ++---
 .../ltp/{ltp_20190930.bb => ltp_20200120.bb}  |  10 +-
 11 files changed, 95 insertions(+), 282 deletions(-)
 delete mode 100644 meta/recipes-extended/ltp/ltp/0001-mkswap01.sh-Add-udevadm-trigger-before-swap-verifica.patch
 delete mode 100644 meta/recipes-extended/ltp/ltp/0001-nm01-Remove-prefix-zeros-of-the-addresses-output-by-.patch
 delete mode 100644 meta/recipes-extended/ltp/ltp/0001-testcases-fix-an-absent-format-string-issue.patch
 delete mode 100644 meta/recipes-extended/ltp/ltp/0006-rt_tgsigqueueinfo-disable-test-on-musl.patch
 rename meta/recipes-extended/ltp/{ltp_20190930.bb => ltp_20200120.bb} (89%)
meta/lib/oeqa/runtime/cases/ltp.py +1 -1
index b8b7300435..6dc5ef22ad 100644
@@ -59,7 +59,7 @@ class LtpTest(LtpTestBase):
 
     ltp_groups = ["math", "syscalls", "dio", "io", "mm", "ipc", "sched", "nptl", "pty", "containers", "controllers", "filecaps", "cap_bounds", "fcntl-locktests", "connectors", "commands", "net.ipv6_lib", "input","fs_perms_simple"]
 
-    ltp_fs = ["fs", "fsx", "fs_bind", "fs_ext4"]
+    ltp_fs = ["fs", "fsx", "fs_bind"]
     # skip kernel cpuhotplug
     ltp_kernel = ["power_management_tests", "hyperthreading ", "kernel_misc", "hugetlb"]
     ltp_groups += ltp_fs
meta/recipes-extended/ltp/ltp/0001-Add-more-musl-exclusions.patch +6 -31
index d3af31f34a..773844d442 100644
@@ -5,12 +5,12 @@ Subject: [PATCH] Add more musl exclusions
 
 Upstream-Status: Pending
 Signed-off-by: Alexander Kanavin <[email protected]>
+[ pvorel: rebase for 20200120: enable fanotify13, fanotify15, setxattr03 ]
+Signed-off-by: Petr Vorel <[email protected]>
 ---
  testcases/kernel/syscalls/accept4/Makefile      | 4 ++++
- testcases/kernel/syscalls/fanotify/Makefile     | 6 ++++++
- testcases/kernel/syscalls/setxattr/Makefile     | 4 ++++
  testcases/kernel/syscalls/timer_create/Makefile | 4 ++++
- 4 files changed, 18 insertions(+)
+ 2 files changed, 8 insertions(+)
 
 diff --git a/testcases/kernel/syscalls/accept4/Makefile b/testcases/kernel/syscalls/accept4/Makefile
 index 504042e11..94db06266 100644
@@ -23,34 +23,6 @@ index 504042e11..94db06266 100644
 +ifeq ($(LIBC),musl)
 +FILTER_OUT_MAKE_TARGETS        := accept4_01
 +endif
-+
- include $(top_srcdir)/include/mk/generic_leaf_target.mk
-diff --git a/testcases/kernel/syscalls/fanotify/Makefile b/testcases/kernel/syscalls/fanotify/Makefile
-index 5d01b4825..0263a6e20 100644
---- a/testcases/kernel/syscalls/fanotify/Makefile
-+++ b/testcases/kernel/syscalls/fanotify/Makefile
-@@ -20,4 +20,10 @@ top_srcdir		?= ../../../..
- fanotify11: CFLAGS+=-pthread
- include $(top_srcdir)/include/mk/testcases.mk
- 
-+ifeq ($(LIBC),musl)
-+FILTER_OUT_MAKE_TARGETS        := fanotify13 fanotify15
-+endif
-+
- include $(top_srcdir)/include/mk/generic_leaf_target.mk
-+
-+
-diff --git a/testcases/kernel/syscalls/setxattr/Makefile b/testcases/kernel/syscalls/setxattr/Makefile
-index 72544c13e..7f20b2780 100644
---- a/testcases/kernel/syscalls/setxattr/Makefile
-+++ b/testcases/kernel/syscalls/setxattr/Makefile
-@@ -20,4 +20,8 @@ top_srcdir		?= ../../../..
- 
- include $(top_srcdir)/include/mk/testcases.mk
- 
-+ifeq ($(LIBC),musl)
-+FILTER_OUT_MAKE_TARGETS        := setxattr03
-+endif
 +
  include $(top_srcdir)/include/mk/generic_leaf_target.mk
 diff --git a/testcases/kernel/syscalls/timer_create/Makefile b/testcases/kernel/syscalls/timer_create/Makefile
@@ -68,3 +40,6 @@ index 8de247075..eb240f432 100644
  CPPFLAGS		+= -D_GNU_SOURCE -I$(abs_srcdir)/../include
  
  LDLIBS			+= -lpthread -lrt
+-- 
+2.25.1
+
meta/recipes-extended/ltp/ltp/0001-build-Add-option-to-select-libc-implementation.patch +29 -74

127 lines not on this page · raw message

meta/recipes-extended/ltp/ltp/0001-mkswap01.sh-Add-udevadm-trigger-before-swap-verifica.patch deleted +0 -35
deleted file mode 100644
index 1b433d3ad3..0000000000
@@ -1,35 +0,0 @@
-From fae8852a63d9fa6e56fb8b24eaf10560bd13757f Mon Sep 17 00:00:00 2001
-From: Yongxin Liu <[email protected]>
-Date: Tue, 12 Nov 2019 11:33:50 +0800
-Subject: [PATCH] mkswap01.sh: Add "udevadm trigger" before swap verification
-
-Fix: https://github.com/linux-test-project/ltp/issues/458
-
-Sometimes the swap device cannot show up in /dev/disk/by-uuid/
-or /dev/disk/by-lable/ due to the issue #458. When this issue
-happens, "blkid -c /dev/null" and "ls /dev/disk/by-uuid/" show
-different UUID of the device.
-
-Upstream-Status: Submitted [https://patchwork.ozlabs.org/patch/1193414]
-
-Signed-off-by: Yongxin Liu <[email protected]>
----
- testcases/commands/mkswap/mkswap01.sh | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/testcases/commands/mkswap/mkswap01.sh b/testcases/commands/mkswap/mkswap01.sh
-index 3a348c6e6..9437c4a4e 100755
---- a/testcases/commands/mkswap/mkswap01.sh
-+++ b/testcases/commands/mkswap/mkswap01.sh
-@@ -129,6 +129,8 @@ mkswap_test()
- 		return
- 	fi
- 
-+	udevadm trigger --name-match=$TST_DEVICE
-+
- 	if [ -n "$device" ]; then
- 		mkswap_verify "$mkswap_op" "$op_arg" "$device" "$size" "$dev_file"
- 		if [ $? -ne 0 ]; then
--- 
-2.14.4
-
meta/recipes-extended/ltp/ltp/0001-nm01-Remove-prefix-zeros-of-the-addresses-output-by-.patch deleted +0 -43

43 lines not on this page · raw message

meta/recipes-extended/ltp/ltp/0001-syscalls-Check-for-time64-unsafe-syscalls-before-usi.patch +30 -11

73 lines not on this page · raw message

meta/recipes-extended/ltp/ltp/0001-testcases-fix-an-absent-format-string-issue.patch deleted +0 -24
deleted file mode 100644
index 9330844509..0000000000
@@ -1,24 +0,0 @@
-From 476ce907fa18042cdde0a244ba9a46cd895ce76c Mon Sep 17 00:00:00 2001
-From: Alexander Kanavin <[email protected]>
-Date: Thu, 12 Dec 2019 17:56:02 +0100
-Subject: [PATCH] testcases: fix an absent format string issue
-
-Upstream-Status: Pending
-Signed-off-by: Alexander Kanavin <[email protected]>
----
- .../kernel/syscalls/pidfd_send_signal/pidfd_send_signal03.c     | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/testcases/kernel/syscalls/pidfd_send_signal/pidfd_send_signal03.c b/testcases/kernel/syscalls/pidfd_send_signal/pidfd_send_signal03.c
-index 27dbc6626..19d943d06 100644
---- a/testcases/kernel/syscalls/pidfd_send_signal/pidfd_send_signal03.c
-+++ b/testcases/kernel/syscalls/pidfd_send_signal/pidfd_send_signal03.c
-@@ -59,7 +59,7 @@ static void verify_pidfd_send_signal(void)
- 
- 		/* Manipulate PID for next process */
- 		sprintf(pid_str, "%d", pid - 1);
--		SAFE_FILE_PRINTF(last_pid_file, pid_str);
-+		SAFE_FILE_PRINTF(last_pid_file, "%s", pid_str);
- 
- 		new_pid = SAFE_FORK();
- 		if (new_pid == 0) {
meta/recipes-extended/ltp/ltp/0002-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch +13 -7
index eff9ed0741..412025017b 100644
@@ -1,21 +1,27 @@
-From 81e5bd5442337a4a648a0dbbff47eaac0d351287 Mon Sep 17 00:00:00 2001
+From 2f6f356a49e28eb597df063e31770632e69a93aa Mon Sep 17 00:00:00 2001
 From: Khem Raj <[email protected]>
-Date: Thu, 7 Jan 2016 18:22:38 +0000
+Date: Fri, 28 Feb 2020 14:55:26 +0100
 Subject: [PATCH] kernel/controllers: Link with libfts explicitly on musl
 
 musl does not implement fts like glibc and therefore it depends on
 external implementation for all fts APIs
 
-Upstream-Status: Pending
+Upstream-Status: not acceptible
 
 Signed-off-by: Khem Raj <[email protected]>
+[ pvorel: rebased for 20200120
+IMHO this patch should not be needed as commits
+22f510de8 ("Fix static linking with musl-fts") and
+b24f3d32c ("cpuset: Detect missing fts.h") should handle it
+but CI still report failures ]
+Signed-off-by: Petr Vorel <[email protected]>
 ---
  testcases/kernel/controllers/Makefile.inc        | 3 +++
  testcases/kernel/controllers/cpuset/Makefile.inc | 3 +++
  2 files changed, 6 insertions(+)
 
 diff --git a/testcases/kernel/controllers/Makefile.inc b/testcases/kernel/controllers/Makefile.inc
-index 4ca0b5a..1d85e4d 100644
+index 4ca0b5ac3..1d85e4d86 100644
 --- a/testcases/kernel/controllers/Makefile.inc
 +++ b/testcases/kernel/controllers/Makefile.inc
 @@ -36,6 +36,9 @@ MAKE_DEPS		:= $(LIB)
@@ -29,13 +35,13 @@ index 4ca0b5a..1d85e4d 100644
  INSTALL_TARGETS		?= *.sh
  
 diff --git a/testcases/kernel/controllers/cpuset/Makefile.inc b/testcases/kernel/controllers/cpuset/Makefile.inc
-index db6a843..86dd2a8 100644
+index c03dd77d7..6dd4ee619 100644
 --- a/testcases/kernel/controllers/cpuset/Makefile.inc
 +++ b/testcases/kernel/controllers/cpuset/Makefile.inc
 @@ -42,6 +42,9 @@ MAKE_DEPS		:= $(LIBCONTROLLERS) $(LIBCPUSET)
  LDFLAGS			+= -L$(abs_builddir)/$(LIBCPUSET_DIR) -L$(abs_builddir)/$(LIBCONTROLLERS_DIR)
  
- LDLIBS			+= -lcpu_set -lcontrollers -lltp
+ LDLIBS			:= -lcpu_set -lcontrollers -lltp $(LDLIBS)
 +ifeq ($(LIBC),musl)
 +LDLIBS			+= -lfts
 +endif
@@ -43,5 +49,5 @@ index db6a843..86dd2a8 100644
  INSTALL_TARGETS		?= *.sh
  
 -- 
-2.7.4
+2.25.1
 
meta/recipes-extended/ltp/ltp/0006-rt_tgsigqueueinfo-disable-test-on-musl.patch deleted +0 -35
deleted file mode 100644
index 804edfa1b4..0000000000
@@ -1,35 +0,0 @@
-From 60054686e2c1a4bedf1d507af97ebbb7ff491e77 Mon Sep 17 00:00:00 2001
-From: Yi Zhao <[email protected]>
-Date: Thu, 18 Jul 2019 15:23:15 +0800
-Subject: [PATCH] rt_tgsigqueueinfo: disable test on musl
-
-Fix build error with musl:
-rt_tgsigqueueinfo01.c: In function 'sigusr1_handler':
-rt_tgsigqueueinfo01.c:42:22: error: 'siginfo_t' {aka 'struct <anonymous>'} has no member named '_sifields'; did you mean '__si_fields'?
-   42 |  sigval_rcv = uinfo->_sifields._rt.SI_SIGVAL.sival_ptr;
-      |                      ^~~~~~~~~
-      |                      __si_fields
-
-Upstream-Status: Pending
-
-Signed-off-by: Yi Zhao <[email protected]>
----
- testcases/kernel/syscalls/Makefile | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/testcases/kernel/syscalls/Makefile b/testcases/kernel/syscalls/Makefile
-index d1becd0..1f3ff34 100644
---- a/testcases/kernel/syscalls/Makefile
-+++ b/testcases/kernel/syscalls/Makefile
-@@ -31,7 +31,7 @@ endif
- ifeq ($(LIBC),musl)
- FILTER_OUT_DIRS	+= confstr fmtmsg getcontext ioctl mallopt profil \
- 		   rt_sigsuspend setdomainname sethostname sigsuspend \
--		   ustat
-+		   ustat rt_tgsigqueueinfo
- endif
- 
- ifeq ($(UCLIBC),1)
--- 
-2.7.4
-
meta/recipes-extended/ltp/ltp/0008-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch +14 -13
index b46325eaf3..350091a70c 100644
@@ -1,33 +1,34 @@
-From aa7a9185a037ad59012bd46713ac340458e95209 Mon Sep 17 00:00:00 2001
+From 4b7db094d6fc5659001ae8dc17078bb65d46b9c9 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= <[email protected]>
 Date: Fri, 13 May 2016 11:11:28 -0500
-Subject: [PATCH] testcases/network/nfsv4/acl/acl1.c: Security fix on
- string printf
+Subject: [PATCH] acl: Security fix on string printf
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
 
-Fixes:
+Fixes build error when compiled with -Werror=format-security:
 
-acl1.c: In function 'test_acl_default':
-acl1.c:317:2: error: format not a string literal and no format arguments
-[-Werror=format-security]
-  printf(cmd);
+acl1.c: In function ‘test_acl_default’:
+acl1.c:305:2: error: format not a string literal and no format arguments [-Werror=format-security]
+  305 |  printf(cmd);
 
-[YOCTO #9548]
+Patch taken from openembedded-core,
+original bug report: https://bugzilla.yoctoproject.org/9548
 
-Upstream-Status: Pending
+[YOCTO #9548]
 
 Signed-off-by: Aníbal Limón <[email protected]>
+Signed-off-by: Petr Vorel <[email protected]>
+Upstream-Status: accepted in 4b7db094d6fc5659001ae8dc17078bb65d46b9c9
 ---
  testcases/network/nfsv4/acl/acl1.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/testcases/network/nfsv4/acl/acl1.c b/testcases/network/nfsv4/acl/acl1.c
-index bdf0180..898b7ca 100644
+index aae9484e5..ad778cd33 100644
 --- a/testcases/network/nfsv4/acl/acl1.c
 +++ b/testcases/network/nfsv4/acl/acl1.c
-@@ -303,7 +303,7 @@ void test_acl_default(char *dir, acl_t acl)
+@@ -302,7 +302,7 @@ void test_acl_default(char *dir, acl_t acl)
  	char *cmd = malloc(256);
  
  	strcpy(cmd, "chmod 7777 ");
@@ -37,5 +38,5 @@ index bdf0180..898b7ca 100644
  	system(cmd);
  	acl2 = acl_get_file(path, ACL_TYPE_ACCESS);
 -- 
-2.7.4
+2.25.1
 
meta/recipes-extended/ltp/ltp_20200120.bb renamed from meta/recipes-extended/ltp/ltp_20190930.bb +2 -8
similarity index 89%
rename from meta/recipes-extended/ltp/ltp_20190930.bb
rename to meta/recipes-extended/ltp/ltp_20200120.bb
index 19bd7bc9c6..312eeca114 100644
@@ -12,12 +12,11 @@ LIC_FILES_CHKSUM = "\
     file://testcases/open_posix_testsuite/COPYING;md5=48b1c5ec633e3e30ec2cf884ae699947 \
     file://testcases/realtime/COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \
     file://utils/benchmark/kernbench-0.42/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
-    file://utils/ffsb-6.0-rc2/COPYING;md5=c46082167a314d785d012a244748d803 \
 "
 
 DEPENDS = "attr libaio libcap acl openssl zip-native"
 DEPENDS_append_libc-musl = " fts "
-EXTRA_OEMAKE_append_libc-musl = " LIBC=musl "
+EXTRA_OEMAKE_append_libc-musl = " LIBC=musl LIBS=-lfts "
 
 # since ltp contains x86-64 assembler which uses the frame-pointer register,
 # set -fomit-frame-pointer x86-64 to handle cases where optimisation
@@ -27,21 +26,16 @@ CFLAGS_append_x86-64 = " -fomit-frame-pointer"
 
 CFLAGS_append_powerpc64 = " -D__SANE_USERSPACE_TYPES__"
 CFLAGS_append_mipsarchn64 = " -D__SANE_USERSPACE_TYPES__"
-SRCREV = "c9707b465a08397569920b676345474f44327200"
+SRCREV = "4079aaf264d0e9ead042b59d1c5f4e643620d0d5"
 
 SRC_URI = "git://github.com/linux-test-project/ltp.git \
            file://0001-build-Add-option-to-select-libc-implementation.patch \
-           file://0002-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch \
            file://0003-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch \
            file://0004-guard-mallocopt-with-__GLIBC__.patch \
-           file://0006-rt_tgsigqueueinfo-disable-test-on-musl.patch \
            file://0007-Fix-test_proc_kill-hanging.patch \
            file://0008-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch \
            file://0009-open_posix_testsuite-mmap24-2-Relax-condition-a-bit.patch \
-           file://0001-mkswap01.sh-Add-udevadm-trigger-before-swap-verifica.patch \
-           file://0001-testcases-fix-an-absent-format-string-issue.patch \
            file://0001-Add-more-musl-exclusions.patch \
-           file://0001-nm01-Remove-prefix-zeros-of-the-addresses-output-by-.patch \
            file://0001-syscalls-Check-for-time64-unsafe-syscalls-before-usi.patch \
            "
 
Signature · 1 line
2.25.1
author
#1 lore raw

PATCH v5 2/2 ltp: Remove mips related open_posix_testsuite patch

Upstream just disagree on this patch
https://patchwork.ozlabs.org/comment/2012045/

---
Changes v4->v5: NONE

 ...suite-mmap24-2-Relax-condition-a-bit.patch | 68 -------------------
 meta/recipes-extended/ltp/ltp_20200120.bb     |  1 -
 2 files changed, 69 deletions(-)
 delete mode 100644 meta/recipes-extended/ltp/ltp/0009-open_posix_testsuite-mmap24-2-Relax-condition-a-bit.patch
meta/recipes-extended/ltp/ltp/0009-open_posix_testsuite-mmap24-2-Relax-condition-a-bit.patch deleted +0 -68
deleted file mode 100644
index d32ac1dd7c..0000000000
@@ -1,68 +0,0 @@
-From a8715a1446305ffd76406f63c7f160c13a5b2e72 Mon Sep 17 00:00:00 2001
-From: "Hongzhi.Song" <[email protected]>
-Date: Wed, 10 Oct 2018 22:07:05 -0400
-Subject: [PATCH] open_posix_testsuite/mmap24-2: Relax condition a bit
-
-Mips will return EINVAL instead of ENOMEM as expected
-if the range [addr + len) exceeds TASK_SIZE.
-
-Linux kernel code: arch/mips/mm/mmap.c
-if (flags & MAP_FIXED) {
-    /* Even MAP_FIXED mappings must reside within TASK_SIZE */
-    if (TASK_SIZE - len < addr)
-        return -EINVAL;
-
-Relax the condition and accept both ENOMEM and EINVAL
-as expected outcome.
-
-Upstream-Status: Submitted [https://lists.linux.it/pipermail/ltp/2018-October/009624.html]
-
-Signed-off-by: Hongzhi.Song <[email protected]>
----
- .../open_posix_testsuite/conformance/interfaces/mmap/24-2.c    | 10 +++++-----
- 1 file changed, 5 insertions(+), 5 deletions(-)
-
-diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/24-2.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/24-2.c
-index 9cf83d9..55090a6 100644
---- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/24-2.c
-+++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/24-2.c
-@@ -7,7 +7,7 @@
-  * source tree.
-  *
-  * The mmap() function shall fail if:
-- * [ENOMEM] MAP_FIXED was specified,
-+ * [ENOMEM or EINVAL] MAP_FIXED was specified,
-  * and the range [addr,addr+len) exceeds that allowed
-  * for the address space of a process; or, if MAP_FIXED was not specified and
-  * there is insufficient room in the address space to effect the mapping.
-@@ -15,7 +15,7 @@
-  * Test Step:
-  * 1. Map a shared memory object, with size exceeding the value get from
-  *    rlim_cur of resource RLIMIT_AS, setting MAP_FIXED;
-- * 3. Should get ENOMEM.
-+ * 3. Should get ENOMEM or EINVAL.
-  */
- 
- #include <stdio.h>
-@@ -92,8 +92,8 @@ int main(void)
- 	       (unsigned long)len);
- 	pa = mmap(addr, len, PROT_READ | PROT_WRITE, MAP_FIXED | MAP_SHARED, fd,
- 		  0);
--	if (pa == MAP_FAILED && errno == ENOMEM) {
--		printf("Got ENOMEM: %s\nTest PASSED\n", strerror(errno));
-+	if (pa == MAP_FAILED && (errno == ENOMEM || errno == EINVAL)) {
-+		printf("Got ENOMEM or EINVAL: %s\nTest PASSED\n", strerror(errno));
- 		exit(PTS_PASS);
- 	}
- 
-@@ -102,6 +102,6 @@ int main(void)
- 	else
- 		munmap(pa, len);
- 	close(fd);
--	printf("Test Fail: Did not get ENOMEM as expected\n");
-+	printf("Test Failed: Did not get ENOMEM or EINVAL as expected\n");
- 	return PTS_FAIL;
- }
--- 
-2.7.4
-
meta/recipes-extended/ltp/ltp_20200120.bb +0 -1
index 312eeca114..847f267b0b 100644
@@ -34,7 +34,6 @@ SRC_URI = "git://github.com/linux-test-project/ltp.git \
            file://0004-guard-mallocopt-with-__GLIBC__.patch \
            file://0007-Fix-test_proc_kill-hanging.patch \
            file://0008-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch \
-           file://0009-open_posix_testsuite-mmap24-2-Relax-condition-a-bit.patch \
            file://0001-Add-more-musl-exclusions.patch \
            file://0001-syscalls-Check-for-time64-unsafe-syscalls-before-usi.patch \
            "
Signature · 1 line
2.25.1
#2 lore raw
In reply to Petr Vorel

Hi Petr,

Quoted 26 lines · Petr Vorel

Removed ffsb copying file and associated runtest file fs_ext4 (both removed in this release).

Added LIBS=-lfts for MUSL.

Removed patches (accepted upstream)
* 0001-mkswap01.sh-Add-udevadm-trigger-before-swap-verifica.patch
* 0001-testcases-fix-an-absent-format-string-issue.patch
* 0001-nm01-Remove-prefix-zeros-of-the-addresses-output-by-.patch

Merged patches
* 0006-rt_tgsigqueueinfo-disable-test-on-musl.patch (into 0001-build-Add-option-to-select-libc-implementation.patch as they
touch the same files)

Refreshed patches (some tests have been fixed for musl)
* 0001-Add-more-musl-exclusions.patch
* 0001-build-Add-option-to-select-libc-implementation.patch
* 0002-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch IMHO this one shouldn't be needed not, but CI still fails without it

Updated status
* 0008-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch
* 0001-syscalls-Check-for-time64-unsafe-syscalls-before-usi.patch

Quoted 8 lines

---
Changes v4->v5:
* Put back 0002-kernel-controllers-Link-with-libfts-explicitly-on- mu.patch
as it still needed on MUSL (although it should not be needed, strange).
Reported by Anuj Mittal

I'm sorry to say that this still isn't quite right for musl:

https://autobuilder.yoctoproject.org/typhoon/#/builders/45/builds/1634
https://autobuilder.yoctoproject.org/typhoon/#/builders/64/builds/1630

Still having the fts issue :(

Cheers,

Richard

author
#3 lore raw

Hi Richard, Khem,

Quoted 7 lines
Quoted 6 lines

Changes v4->v5:
* Put back 0002-kernel-controllers-Link-with-libfts-explicitly-on- mu.patch
as it still needed on MUSL (although it should not be needed, strange).
Reported by Anuj Mittal

Quoted 6 lines

I'm sorry to say that this still isn't quite right for musl:

https://autobuilder.yoctoproject.org/typhoon/#/builders/45/builds/1634
https://autobuilder.yoctoproject.org/typhoon/#/builders/64/builds/1630

Still having the fts issue :(

OK, step1b is still problematic:
/home/pokybuild/yocto-worker/musl-qemux86-64/build/build/tmp/work/core2-64-poky-linux-musl/ltp/20200120-r0/recipe-sysroot-native/usr/bin/x86_64-poky-linux-musl/../../libexec/x86_64-poky-linux-musl/gcc/x86_64-poky-linux-musl/9.2.0/ld: /usr/src/debug/ltp/20200120-r0/git/testcases/kernel/controllers/cpuset/cpuset_lib/libcpuset.c:3224: undefined reference to `fts_read' /home/pokybuild/yocto-worker/musl-qemux86-64/build/build/tmp/work/core2-64-poky-linux-musl/ltp/20200120-r0/recipe-sysroot-native/usr/bin/x86_64-poky-linux-musl/../../libexec/x86_64-poky-linux-musl/gcc/x86_64-poky-linux-musl/9.2.0/ld: /usr/src/debug/ltp/20200120-r0/git/testcases/kernel/controllers/cpuset/cpuset_lib/libcpuset.c:3224: undefined reference to `fts_read' /home/pokybuild/yocto-worker/musl-qemux86-64/build/build/tmp/work/core2-64-poky-linux-musl/ltp/20200120-r0/recipe-sysroot-native/usr/bin/x86_64-poky-linux-musl/../../libexec/x86_64-poky-linux-musl/gcc/x86_64-poky-linux-musl/9.2.0/ld: /usr/src/debug/ltp/20200120-r0/git/testcases/kernel/controllers/cpuset/cpuset_lib/libcpuset.c:3269: undefined reference to `fts_close' /home/pokybuild/yocto-worker/musl-qemux86-64/build/build/tmp/work/core2-64-poky-linux-musl/ltp/20200120-r0/recipe-sysroot-native/usr/bin/x86_64-poky-linux-musl/../../libexec/x86_64-poky-linux-musl/gcc/x86_64-poky-linux-musl/9.2.0/ld: /usr/src/debug/ltp/20200120-r0/git/testcases/kernel/controllers/cpuset/cpuset_lib/libcpuset.c:3277: undefined reference to `fts_close'

At least we know, that once we solve this problem, we can remove 0002-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch

Please, how to reproduce this build locally? Is it:
. oe-init-build-env
TCLIBC=musl bitbake ltp

Or do I need to put something into config files conf/local.conf or conf/bblayers.conf ?

I need to double check if musl-fts is really built and whether the order of -lfts is correct. But all this has been solved even for static build for Buildroot, so I guess it's some issue related to openembedded. Unfortunately, I'm not much experienced in openembedded (stepped in, because nobody else has updated LTP package yet).

Khem, any idea, what can be wrong?

Kind regards,
Petr

#4 lore raw
Quoted 6 lines · Petr Vorel

At least we know, that once we solve this problem, we can remove 0002-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch

Please, how to reproduce this build locally? Is it:
. oe-init-build-env
TCLIBC=musl bitbake ltp

Yes, that should be enough.

Quoted 13 lines

Or do I need to put something into config files conf/local.conf or conf/bblayers.conf ?

I need to double check if musl-fts is really built and whether the order of
-lfts is correct. But all this has been solved even for static build for Buildroot,
so I guess it's some issue related to openembedded. Unfortunately, I'm not much
experienced in openembedded (stepped in, because nobody else has updated LTP
package yet).

Quoted 1 line

Khem, any idea, what can be wrong?

FWIW I'll run a build here and see if I can spot anything but I'm trying to do other things today!

Cheers,

Richard

#5 lore raw
Quoted 24 lines · Richard Purdie
Quoted 6 lines · Petr Vorel

At least we know, that once we solve this problem, we can remove 0002-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch

Please, how to reproduce this build locally? Is it:
. oe-init-build-env
TCLIBC=musl bitbake ltp

Yes, that should be enough.

Quoted 14 lines

Or do I need to put something into config files conf/local.conf or conf/bblayers.conf ?

I need to double check if musl-fts is really built and whether the order of
-lfts is correct. But all this has been solved even for static build
for Buildroot,
so I guess it's some issue related to openembedded. Unfortunately, I'm not much
experienced in openembedded (stepped in, because nobody else has updated LTP
package yet).

Quoted 4 lines
Quoted 1 line

Khem, any idea, what can be wrong?

FWIW I'll run a build here and see if I can spot anything but I'm trying to do other things today!

I was able to confirm that fts is in the recipe sysroot and that the compile step is running "make -j 88 LIBC=musl LIBS=-lfts", i.e. its being passed in to ltp. Beyond that I'm a little out my depth to know how/why its not ending up where it should unfortunately. At least the issue does appear to reproduce though...

Cheers,

Richard

#6 lore raw
Quoted 29 lines · Richard Purdie
Quoted 28 lines · Richard Purdie
Quoted 6 lines · Petr Vorel

At least we know, that once we solve this problem, we can remove 0002-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch

Please, how to reproduce this build locally? Is it:
. oe-init-build-env
TCLIBC=musl bitbake ltp

Yes, that should be enough.

Quoted 17 lines

Or do I need to put something into config files conf/local.conf or conf/bblayers.conf ?

I need to double check if musl-fts is really built and whether the
order of
-lfts is correct. But all this has been solved even for static build
for Buildroot,
so I guess it's some issue related to openembedded. Unfortunately,
I'm not much
experienced in openembedded (stepped in, because nobody else has updated LTP
package yet).

Khem, any idea, what can be wrong?

Quoted 8 lines
Quoted 2 lines

FWIW I'll run a build here and see if I can spot anything but I'm trying to do other things today!

I was able to confirm that fts is in the recipe sysroot and that the compile step is running "make -j 88 LIBC=musl LIBS=-lfts", i.e. its being passed in to ltp. Beyond that I'm a little out my depth to know how/why its not ending up where it should unfortunately. At least the issue does appear to reproduce though...

Grep suggests LIBS is a configure option, not a makefile one. I tried:

meta/recipes-extended/ltp/ltp_20200120.bb +2 -1
index 847f267b0b7..5be9489a756 100644
@@ -16,7 +16,8 @@ LIC_FILES_CHKSUM = "\
 
 DEPENDS = "attr libaio libcap acl openssl zip-native"
 DEPENDS_append_libc-musl = " fts "
-EXTRA_OEMAKE_append_libc-musl = " LIBC=musl LIBS=-lfts "
+EXTRA_OEMAKE_append_libc-musl = " LIBC=musl "
+EXTRA_OECONF_append_libc-musl = " LIBS=-lfts "
 
 # since ltp contains x86-64 assembler which uses the frame-pointer register,
 # set -fomit-frame-pointer x86-64 to handle cases where optimisation

and this does seem to build for musl. Might be worth runtime testing that on the autobuilder?

Cheers,

Richard

#7 lore raw
Quoted 56 lines · Richard Purdie
Quoted 29 lines · Richard Purdie
Quoted 28 lines · Richard Purdie
Quoted 6 lines · Petr Vorel

At least we know, that once we solve this problem, we can remove 0002-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch

Please, how to reproduce this build locally? Is it:
. oe-init-build-env
TCLIBC=musl bitbake ltp

Yes, that should be enough.

Quoted 17 lines

Or do I need to put something into config files conf/local.conf or conf/bblayers.conf ?

I need to double check if musl-fts is really built and whether the
order of
-lfts is correct. But all this has been solved even for static build
for Buildroot,
so I guess it's some issue related to openembedded. Unfortunately,
I'm not much
experienced in openembedded (stepped in, because nobody else has updated LTP
package yet).

Khem, any idea, what can be wrong?

Quoted 8 lines
Quoted 2 lines

FWIW I'll run a build here and see if I can spot anything but I'm trying to do other things today!

I was able to confirm that fts is in the recipe sysroot and that the compile step is running "make -j 88 LIBC=musl LIBS=-lfts", i.e. its being passed in to ltp. Beyond that I'm a little out my depth to know how/why its not ending up where it should unfortunately. At least the issue does appear to reproduce though...

Grep suggests LIBS is a configure option, not a makefile one. I tried:

meta/recipes-extended/ltp/ltp_20200120.bb +2 -1
index 847f267b0b7..5be9489a756 100644
@@ -16,7 +16,8 @@ LIC_FILES_CHKSUM = "\
 
  DEPENDS = "attr libaio libcap acl openssl zip-native"
  DEPENDS_append_libc-musl = " fts "
-EXTRA_OEMAKE_append_libc-musl = " LIBC=musl LIBS=-lfts "
+EXTRA_OEMAKE_append_libc-musl = " LIBC=musl "
+EXTRA_OECONF_append_libc-musl = " LIBS=-lfts "
 
  # since ltp contains x86-64 assembler which uses the frame-pointer register,
  # set -fomit-frame-pointer x86-64 to handle cases where optimisation
Quoted 2 lines

and this does seem to build for musl. Might be worth runtime testing that on the autobuilder?

yes thats right fix, I have sent v6 of original patch including above fix, please give it a try

Quoted 5 lines

Cheers,

Richard

author
#8 lore raw
In reply to Richard Purdie

Hi Richard,

meta/recipes-extended/ltp/ltp_20200120.bb LIC_FILES_CHKSUM = "\ · line 20

Quoted 13 lines

Grep suggests LIBS is a configure option, not a makefile one. I tried:

meta/recipes-extended/ltp/ltp_20200120.bb +2 -1
index 847f267b0b7..5be9489a756 100644
@@ -16,7 +16,8 @@ LIC_FILES_CHKSUM = "\
 
 DEPENDS = "attr libaio libcap acl openssl zip-native"
 DEPENDS_append_libc-musl = " fts "
-EXTRA_OEMAKE_append_libc-musl = " LIBC=musl LIBS=-lfts "
+EXTRA_OEMAKE_append_libc-musl = " LIBC=musl "
+EXTRA_OECONF_append_libc-musl = " LIBS=-lfts "

Thanks a lot for an explanation. Next time I need to read carefully.

Kind regards,
Petr

author
#9 lore raw
In reply to Richard Purdie

Hi Richard, Khem,

Quoted 5 lines

I was able to confirm that fts is in the recipe sysroot and that the compile step is running "make -j 88 LIBC=musl LIBS=-lfts", i.e. its being passed in to ltp. Beyond that I'm a little out my depth to know how/why its not ending up where it should unfortunately. At least the issue does appear to reproduce though...

Is there a way to compile only LTP and the necessary build dependencies?

if I run this:
. oe-init-build-env
MACHINE=qemuarm TCLIBC=musl bitbake ltp

It takes ages and compiles many things (gnutls, iptables, expat, procps, tar, ...).

Kind regards,
Petr

#10 lore raw
Quoted 7 lines · Petr Vorel

Hi Richard, Khem,

Quoted 5 lines

I was able to confirm that fts is in the recipe sysroot and that the compile step is running "make -j 88 LIBC=musl LIBS=-lfts", i.e. its being passed in to ltp. Beyond that I'm a little out my depth to know how/why its not ending up where it should unfortunately. At least the issue does appear to reproduce though...

Quoted 8 lines

Is there a way to compile only LTP and the necessary build dependencies?

if I run this:
. oe-init-build-env
MACHINE=qemuarm TCLIBC=musl bitbake ltp

It takes ages and compiles many things (gnutls, iptables, expat, procps, tar, ...).

Yeah first time it will have to build all the dependencies unfortunately but thereafter it should be incremental

Your command is right to build ltp only for musl

Quoted 5 lines

Kind regards,
Petr

#11 lore raw
In reply to Petr Vorel
Quoted 31 lines · Petr Vorel

Hi Richard, Khem,

Quoted 7 lines
Quoted 6 lines

Changes v4->v5:
* Put back 0002-kernel-controllers-Link-with-libfts-explicitly-on- mu.patch
as it still needed on MUSL (although it should not be needed, strange).
Reported by Anuj Mittal

Quoted 6 lines

I'm sorry to say that this still isn't quite right for musl:

https://autobuilder.yoctoproject.org/typhoon/#/builders/45/builds/1634
https://autobuilder.yoctoproject.org/typhoon/#/builders/64/builds/1630

Still having the fts issue :(

OK, step1b is still problematic:
/home/pokybuild/yocto-worker/musl-qemux86-64/build/build/tmp/work/core2-64-poky-linux-musl/ltp/20200120-r0/recipe-sysroot-native/usr/bin/x86_64-poky-linux-musl/../../libexec/x86_64-poky-linux-musl/gcc/x86_64-poky-linux-musl/9.2.0/ld: /usr/src/debug/ltp/20200120-r0/git/testcases/kernel/controllers/cpuset/cpuset_lib/libcpuset.c:3224: undefined reference to `fts_read' /home/pokybuild/yocto-worker/musl-qemux86-64/build/build/tmp/work/core2-64-poky-linux-musl/ltp/20200120-r0/recipe-sysroot-native/usr/bin/x86_64-poky-linux-musl/../../libexec/x86_64-poky-linux-musl/gcc/x86_64-poky-linux-musl/9.2.0/ld: /usr/src/debug/ltp/20200120-r0/git/testcases/kernel/controllers/cpuset/cpuset_lib/libcpuset.c:3224: undefined reference to `fts_read' /home/pokybuild/yocto-worker/musl-qemux86-64/build/build/tmp/work/core2-64-poky-linux-musl/ltp/20200120-r0/recipe-sysroot-native/usr/bin/x86_64-poky-linux-musl/../../libexec/x86_64-poky-linux-musl/gcc/x86_64-poky-linux-musl/9.2.0/ld: /usr/src/debug/ltp/20200120-r0/git/testcases/kernel/controllers/cpuset/cpuset_lib/libcpuset.c:3269: undefined reference to `fts_close' /home/pokybuild/yocto-worker/musl-qemux86-64/build/build/tmp/work/core2-64-poky-linux-musl/ltp/20200120-r0/recipe-sysroot-native/usr/bin/x86_64-poky-linux-musl/../../libexec/x86_64-poky-linux-musl/gcc/x86_64-poky-linux-musl/9.2.0/ld: /usr/src/debug/ltp/20200120-r0/git/testcases/kernel/controllers/cpuset/cpuset_lib/libcpuset.c:3277: undefined reference to `fts_close'

At least we know, that once we solve this problem, we can remove 0002-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch

Please, how to reproduce this build locally? Is it:
. oe-init-build-env
TCLIBC=musl bitbake ltp

Or do I need to put something into config files conf/local.conf or conf/bblayers.conf ?

Quoted 7 lines

I need to double check if musl-fts is really built and whether the order of -lfts is correct. But all this has been solved even for static build for Buildroot, so I guess it's some issue related to openembedded. Unfortunately, I'm not much experienced in openembedded (stepped in, because nobody else has updated LTP package yet).

Khem, any idea, what can be wrong?

I have added -lfts to LIBS and sent v6 of this patch

Quoted 4 lines

Kind regards,
Petr