diff options
Diffstat (limited to 'poky/meta/recipes-extended/ltp')
3 files changed, 113 insertions, 0 deletions
diff --git a/poky/meta/recipes-extended/ltp/ltp/0001-syscalls-tgkill03-wait-for-defunct-tid-to-get-detach.patch b/poky/meta/recipes-extended/ltp/ltp/0001-syscalls-tgkill03-wait-for-defunct-tid-to-get-detach.patch new file mode 100644 index 000000000..6ea26150f --- /dev/null +++ b/poky/meta/recipes-extended/ltp/ltp/0001-syscalls-tgkill03-wait-for-defunct-tid-to-get-detach.patch @@ -0,0 +1,75 @@ +From e747d0456adc080a1d31fb653bda9dc491795c80 Mon Sep 17 00:00:00 2001 +From: Jan Stancek <jstancek@redhat.com> +Date: Sun, 16 Jun 2019 11:14:16 +0200 +Subject: [PATCH] syscalls/tgkill03: wait for defunct tid to get detached + +Case where defunct tid is used has been observed to sporadically fail: + tgkill03.c:96: FAIL: Defunct tid should have failed with ESRCH: SUCCESS + +glibc __pthread_timedjoin_ex() waits for CLONE_CHILD_CLEARTID to clear tid, +and then resumes. Kernel clears it (glibc pd->tid) at: + do_exit + exit_mm + mm_release + put_user(0, tsk->clear_child_tid); + +but kernel tid is still valid, presumably until: + release_task + __exit_signal + __unhash_process + detach_pid + +To avoid race wait until /proc/<pid>/task/<tid> disappears. + +Signed-off-by: Jan Stancek <jstancek@redhat.com> +Reviewed-by: Li Wang <liwang@redhat.com> +Acked-by: Sumit Garg <sumit.garg@linaro.org> + +Upstream-Status: Backport +[https://github.com/linux-test-project/ltp/commit/e747d0456adc080a1d31fb653bda9dc491795c80] + +Signed-off-by: He Zhe <zhe.he@windriver.com> +--- + testcases/kernel/syscalls/tgkill/tgkill03.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/testcases/kernel/syscalls/tgkill/tgkill03.c b/testcases/kernel/syscalls/tgkill/tgkill03.c +index f5bbdc5..593a217 100644 +--- a/testcases/kernel/syscalls/tgkill/tgkill03.c ++++ b/testcases/kernel/syscalls/tgkill/tgkill03.c +@@ -7,6 +7,7 @@ + + #include <pthread.h> + #include <pwd.h> ++#include <stdio.h> + #include <sys/types.h> + + #include "tst_safe_pthread.h" +@@ -42,6 +43,7 @@ static void setup(void) + { + sigset_t sigusr1; + pthread_t defunct_thread; ++ char defunct_tid_path[PATH_MAX]; + + sigemptyset(&sigusr1); + sigaddset(&sigusr1, SIGUSR1); +@@ -55,8 +57,9 @@ static void setup(void) + TST_CHECKPOINT_WAIT(0); + + SAFE_PTHREAD_CREATE(&defunct_thread, NULL, defunct_thread_func, NULL); +- + SAFE_PTHREAD_JOIN(defunct_thread, NULL); ++ sprintf(defunct_tid_path, "/proc/%d/task/%d", getpid(), defunct_tid); ++ TST_RETRY_FN_EXP_BACKOFF(access(defunct_tid_path, R_OK), -1, 15); + } + + static void cleanup(void) +@@ -108,4 +111,5 @@ static struct tst_test test = { + .setup = setup, + .cleanup = cleanup, + .test = run, ++ .timeout = 20, + }; +-- +2.7.4 + diff --git a/poky/meta/recipes-extended/ltp/ltp/0001-ustat02-Fix-EFAULT-in-32bit-compatibility-mode.patch b/poky/meta/recipes-extended/ltp/ltp/0001-ustat02-Fix-EFAULT-in-32bit-compatibility-mode.patch new file mode 100644 index 000000000..c936b788f --- /dev/null +++ b/poky/meta/recipes-extended/ltp/ltp/0001-ustat02-Fix-EFAULT-in-32bit-compatibility-mode.patch @@ -0,0 +1,36 @@ +From 156776a3e29491b363fdc9811912e1298655d060 Mon Sep 17 00:00:00 2001 +From: Steven Price <steven.price@arm.com> +Date: Fri, 19 Jul 2019 13:48:17 +0100 +Subject: [PATCH] ustat02: Fix EFAULT in 32bit compatibility mode + +The size of dev_t is larger than 32 bits which causes the dev argument +to be passed incorrectly. On Arm this means that the EFAULT test case +actually returns EINVAL because the device number isn't recognised. + +Signed-off-by: Steven Price <steven.price@arm.com> +Acked-by: Li Wang <liwang@redhat.com> + +Upstream-Status: Backport +[https://github.com/linux-test-project/ltp/commit/156776a3e29491b363fdc9811912e1298655d060] + +Signed-off-by: He Zhe <zhe.he@windriver.com> +--- + testcases/kernel/syscalls/ustat/ustat02.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/testcases/kernel/syscalls/ustat/ustat02.c b/testcases/kernel/syscalls/ustat/ustat02.c +index 9bbe4f3..1a0e9e0 100644 +--- a/testcases/kernel/syscalls/ustat/ustat02.c ++++ b/testcases/kernel/syscalls/ustat/ustat02.c +@@ -36,7 +36,7 @@ int TST_TOTAL = ARRAY_SIZE(tc); + + void run(unsigned int test) + { +- TEST(tst_syscall(__NR_ustat, *tc[test].dev, tc[test].buf)); ++ TEST(tst_syscall(__NR_ustat, (unsigned int)*tc[test].dev, tc[test].buf)); + + if ((TST_RET == -1) && (TST_ERR == tc[test].exp_errno)) + tst_res(TPASS | TTERRNO, "ustat(2) expected failure"); +-- +2.7.4 + diff --git a/poky/meta/recipes-extended/ltp/ltp_20190517.bb b/poky/meta/recipes-extended/ltp/ltp_20190517.bb index c62f2618b..b0e2f969c 100644 --- a/poky/meta/recipes-extended/ltp/ltp_20190517.bb +++ b/poky/meta/recipes-extended/ltp/ltp_20190517.bb @@ -43,6 +43,8 @@ SRC_URI = "git://github.com/linux-test-project/ltp.git \ file://0012-getrlimit03-adjust-a-bit-of-code-to-compatiable-with.patch \ file://0001-Add-configure-time-check-for-getdents-getdents64-API.patch \ file://0002-check-for-RES_USE_INET6-during-configure.patch \ + file://0001-syscalls-tgkill03-wait-for-defunct-tid-to-get-detach.patch \ + file://0001-ustat02-Fix-EFAULT-in-32bit-compatibility-mode.patch \ " S = "${WORKDIR}/git" |