All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] ltp: syscalls: rt_sigwaitinfo01: Fix failure for MIPS arches
@ 2019-09-03  9:28 zhe.he
  0 siblings, 0 replies; only message in thread
From: zhe.he @ 2019-09-03  9:28 UTC (permalink / raw)
  To: openembedded-core

From: He Zhe <zhe.he@windriver.com>

Backport a patch to fix the following failure.
rt_sigtimedwait01    1  TFAIL  :  .../sigwaitinfo01.c:58: test_empty_set
(.../sigwaitinfo01.c: 148): Unexpected failure:
TEST_ERRNO=EINVAL(22): Invalid argument

Signed-off-by: He Zhe <zhe.he@windriver.com>
---
v2: Rebase

 ...sigtimedwait01-Fix-wrong-sigset-length-fo.patch | 46 ++++++++++++++++++++++
 meta/recipes-extended/ltp/ltp_20190517.bb          |  1 +
 2 files changed, 47 insertions(+)
 create mode 100644 meta/recipes-extended/ltp/ltp/0001-syscall-rt_sigtimedwait01-Fix-wrong-sigset-length-fo.patch

diff --git a/meta/recipes-extended/ltp/ltp/0001-syscall-rt_sigtimedwait01-Fix-wrong-sigset-length-fo.patch b/meta/recipes-extended/ltp/ltp/0001-syscall-rt_sigtimedwait01-Fix-wrong-sigset-length-fo.patch
new file mode 100644
index 0000000..0e56c08
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0001-syscall-rt_sigtimedwait01-Fix-wrong-sigset-length-fo.patch
@@ -0,0 +1,46 @@
+From a5046625eaeed2d3fba456c3ba84c6c141c2ad7c Mon Sep 17 00:00:00 2001
+From: He Zhe <zhe.he@windriver.com>
+Date: Thu, 29 Aug 2019 21:09:46 +0800
+Subject: [PATCH] syscall/rt_sigtimedwait01: Fix wrong sigset length for MIPS
+
+rt_sigtimedwait01 fails as follow on MIPS arches
+rt_sigtimedwait01    1  TFAIL  :  .../sigwaitinfo01.c:58: test_empty_set
+(.../sigwaitinfo01.c: 148): Unexpected failure:
+TEST_ERRNO=EINVAL(22): Invalid argument
+
+As this case purposely bypasses glibc, it should align with the size of kernel
+definition of sigset_t which is different from other arches.
+https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/mips/include/uapi/asm/signal.h#n15
+
+This patch turns to use _NSIG which is always right for all arches.
+
+Upstream-Status: Backport [a5046625eaeed2d3fba456c3ba84c6c141c2ad7c]
+
+Suggested-by: Jan Stancek <jstancek@redhat.com>
+Acked-by: Jan Stancek <jstancek@redhat.com>
+Acked-by: Cyril Hrubis <chrubis@suse.cz>
+Signed-off-by: He Zhe <zhe.he@windriver.com>
+Signed-off-by: Petr Vorel <pvorel@suse.cz>
+---
+ testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c b/testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c
+index 5a32ce1..6a30c27 100644
+--- a/testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c
++++ b/testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c
+@@ -128,9 +128,8 @@ static int my_sigtimedwait(const sigset_t * set, siginfo_t * info,
+ static int my_rt_sigtimedwait(const sigset_t * set, siginfo_t * info,
+ 			      struct timespec *timeout)
+ {
+-
+-	/* The last argument is (number_of_signals)/(bits_per_byte), which are 64 and 8, resp. */
+-	return ltp_syscall(__NR_rt_sigtimedwait, set, info, timeout, 8);
++	/* _NSIG is always the right number of bits of signal map for all arches */
++	return ltp_syscall(__NR_rt_sigtimedwait, set, info, timeout, _NSIG/8);
+ }
+ #endif
+ 
+-- 
+2.7.4
+
diff --git a/meta/recipes-extended/ltp/ltp_20190517.bb b/meta/recipes-extended/ltp/ltp_20190517.bb
index 69d75d5..e9a588f 100644
--- a/meta/recipes-extended/ltp/ltp_20190517.bb
+++ b/meta/recipes-extended/ltp/ltp_20190517.bb
@@ -47,6 +47,7 @@ SRC_URI = "git://github.com/linux-test-project/ltp.git \
            file://0001-ustat02-Fix-EFAULT-in-32bit-compatibility-mode.patch \
            file://0001-cve-meltdown.c-Fix-kernel-symbol-finding.patch \
            file://0001-testcases-use-python3-everywhere-to-run-python-scrip.patch \
+           file://0001-syscall-rt_sigtimedwait01-Fix-wrong-sigset-length-fo.patch \
            "
 
 S = "${WORKDIR}/git"
-- 
2.7.4



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-09-03  9:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-03  9:28 [PATCH v2] ltp: syscalls: rt_sigwaitinfo01: Fix failure for MIPS arches zhe.he

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.