valgrind: ptests
PATCH 5/5 valgrind: make run-ptest better
In reply to Randy MacLeodThere were warnings about non-existent files when there was a duplicate in the remove-for-aarch list and the non-deterministic lists so check if the files still exists before trying to deal with it.
Also restore the tests in the opposite order that they were hidden.
--- .../valgrind/valgrind/run-ptest | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-)
meta/recipes-devtools/valgrind/valgrind/run-ptest +14 -9
@@ -32,13 +32,16 @@ if [ "$arch" = "aarch64" ]; then done fi -echo "Run flaky tests using taskset to limit them to a single core." +echo "Run non-deterministic tests using taskset to limit them to a single core." for i in `cat taskset_nondeterministic_tests`; do - taskset 0x00000001 perl tests/vg_regtest --valgrind=${VALGRIND_BIN} --valgrind-lib=${VALGRIND_LIBEXECDIR} --yocto-ptest $i 2>&1|tee -a ${LOG} - mv $i.vgtest $i.IGNORE + # The remove-for-aarch64 and taskset_nondeterministic_tests may overlap so + # check if a file exist. + if test -f "${i}.vgtest"; then + taskset 0x00000001 perl tests/vg_regtest --valgrind=${VALGRIND_BIN} --valgrind-lib=${VALGRIND_LIBEXECDIR} --yocto-ptest $i 2>&1|tee -a ${LOG} + mv $i.vgtest $i.IGNORE + fi done - cd ${VALGRIND_LIB}/ptest && ./tests/vg_regtest \ --valgrind=${VALGRIND_BIN} \ --valgrind-lib=${VALGRIND_LIBEXECDIR} \
@@ -51,6 +54,13 @@ cd ${VALGRIND_LIB}/ptest && \ gdbserver_tests ${TOOLS} ${EXP_TOOLS} \ 2>&1|tee -a ${LOG} +echo "Restore non-deterministic tests" +for i in `cat taskset_nondeterministic_tests`; do + if test -f "${i}.vgtest.IGNORE"; then + mv $i.IGNORE $i.vgtest; + fi +done + if [ "$arch" = "aarch64" ]; then echo "Aarch64: Restore valgrind tests that result in defunct process and then out of memory" for i in `cat remove-for-aarch64`; do
@@ -63,11 +73,6 @@ for i in `cat remove-for-all`; do mv $i.IGNORE $i.vgtest; done -echo "Restore flaky and other non-deterministic tests" -for i in `cat taskset_nondeterministic_tests`; do - mv $i.IGNORE $i.vgtest; -done - echo "Failed test details..." failed_tests=`grep FAIL: ${LOG} | awk '{print $2}'` for test in $failed_tests; do
Signature · 1 line
2.31.1
cover valgrind: ptests
Tested on khem's glibc upgrade branch:
https://git.yoctoproject.org/poky-contrib/log/?h=kraj/poky-next
and poky master (
9b99eb9e36 tzdata: Remove no longer relevant RCONFLICTS:${PN}
Summary:
Work-around a glibc upgrade error in a way that also works for glibc-2.34 on master. Fix up some ptest warnings and temporarily skip the boost_thread test for arm64.
Results:
On the branch currently known as master, the ptest summary is:
qemux86-64:
=== Test Summary ===
TOTAL: 730
PASSED: 711
FAILED: 0
SKIPPED: 19
DURATION: 1052
END: /usr/lib/valgrind/ptest
2021-12-29T23:12
STOP: ptest-runner
TOTAL: 1 FAIL: 0
qemuarm64:
TOTAL: 415
PASSED: 395
FAILED: 0
SKIPPED: 20
DURATION: 4521
END: /usr/lib/valgrind/ptest
2021-12-30T00:33
STOP: ptest-runner
TOTAL: 1 FAIL: 0
and the output from running: ptest-runner valgrind has no superfluous warnings:
root@qemuarm64:~# ptest-runner -l Available ptests: strace /usr/lib/strace/ptest/run-ptest valgrind /usr/lib/valgrind/ptest/run-ptest root@qemuarm64:~# ptest-runner valgrind START: ptest-runner 2021-12-29T23:18 BEGIN: /usr/lib/valgrind/ptest Hide valgrind tests that are non-deterministic Reported at https://bugs.kde.org/show_bug.cgi?id=430321 Aarch64: Hide valgrind tests that result in defunct process and then out of memory Run non-deterministic tests using taskset to limit them to a single core. PASS: gdbserver_tests/mcblocklistsearch PASS: gdbserver_tests/mcbreak ... PASS: none/tests/vgprintf PASS: none/tests/vgprintf_nvalgrind
...checking makefile consistency
...checking header files and include directives
Restore non-deterministic tests
Aarch64: Restore valgrind tests that result in defunct process and then out of memory Restore valgrind tests that are non-deterministc
Failed test details...
=== Test Summary ===
TOTAL: 415
PASSED: 395
FAILED: 0
SKIPPED: 20
DURATION: 4521
END: /usr/lib/valgrind/ptest
2021-12-30T00:33
STOP: ptest-runner
TOTAL: 1 FAIL: 0
../Randy
Randy MacLeod (5):
valgrind: Add util-linux-taskset ptest dependency
valgrind: backport rseq work-around
valgrind: remove duplicate and skipped tests from remove-for-aarch64
valgrind: skip boost_thread for aarch64 ptests
valgrind: make run-ptest better
...plement-linux-rseq-syscall-as-ENOSYS.patch | 198 ++++++++++++++++++ .../valgrind/valgrind/remove-for-aarch64 | 9 +- .../valgrind/valgrind/run-ptest | 23 +- .../valgrind/valgrind_3.18.1.bb | 4 +- 4 files changed, 216 insertions(+), 18 deletions(-) create mode 100644 meta/recipes-devtools/valgrind/valgrind/0001-Implement-linux-rseq-syscall-as-ENOSYS.patch
Signature · 1 line
2.31.1
PATCH 1/5 valgrind: Add util-linux-taskset ptest dependency
We are using taskset to improve the reproducability of tests listed in:
meta/recipes-devtools/valgrind/valgrind/taskset_nondeterministic_tests
so we need to have the ptests depend on util-linux-taskset.
--- meta/recipes-devtools/valgrind/valgrind_3.18.1.bb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
meta/recipes-devtools/valgrind/valgrind_3.18.1.bb +2 -1
@@ -133,7 +133,8 @@ RDEPENDS:${PN}-ptest += " bash coreutils curl file \ perl-module-file-basename perl-module-file-glob perl-module-getopt-long \ perl-module-overloading perl-module-cwd perl-module-ipc-open3 \ perl-module-carp perl-module-symbol \ - procps sed ${PN}-dbg ${PN}-src ${TCLIBC}-src gcc-runtime-dbg" + procps sed ${PN}-dbg ${PN}-src ${TCLIBC}-src gcc-runtime-dbg \ + util-linux-taskset" RDEPENDS:${PN}-ptest:append:libc-glibc = " glibc-utils" # One of the tests contains a bogus interpreter path on purpose.
Signature · 1 line
2.31.1
PATCH 2/5 valgrind: backport rseq work-around
In reply to Randy MacLeodUsing glibc-2.35-alpha, valgrind ptests mostly all fail with the error:
WARNING: unhandled amd64-linux syscall: 334
You may be able to write your own handler.
With this patch applied qemux86-64 ptest results were:
TOTAL: 728
PASSED: 709
FAILED: 0
SKIPPED: 19
This patch implements the Linux rseq syscall as ENOSYS while a proper fix is being worked on as desribed in the patch commit log.
--- ...plement-linux-rseq-syscall-as-ENOSYS.patch | 198 ++++++++++++++++++ .../valgrind/valgrind_3.18.1.bb | 1 + 2 files changed, 199 insertions(+) create mode 100644 meta/recipes-devtools/valgrind/valgrind/0001-Implement-linux-rseq-syscall-as-ENOSYS.patch
meta/recipes-devtools/valgrind/valgrind/0001-Implement-linux-rseq-syscall-as-ENOSYS.patch new file +198 -0
@@ -0,0 +1,198 @@ +From 1024237358f01009fe233cb1294f3b8211304eaa Mon Sep 17 00:00:00 2001 +From: Mark Wielaard <[email protected]> +Date: Fri, 10 Dec 2021 17:41:59 +0100 +Subject: [PATCH] Implement linux rseq syscall as ENOSYS + +This implements rseq for amd64, arm, arm64, ppc32, ppc64, +s390x and x86 linux as ENOSYS (without warning). + +glibc will start using rseq to accelerate sched_getcpu, if +available. This would cause a warning from valgrind every +time a new thread is started. + +Real rseq (restartable sequences) support is pretty hard, so +for now just explicitly return ENOSYS (just like we do for clone3). + +Upstream-Status: Backport [ 1024237358f01009fe233cb1294f3b8211304eaa ] + +https://sourceware.org/pipermail/libc-alpha/2021-December/133656.html +--- + coregrind/m_syswrap/syswrap-amd64-linux.c | 2 ++ + coregrind/m_syswrap/syswrap-arm-linux.c | 1 + + coregrind/m_syswrap/syswrap-arm64-linux.c | 3 ++- + coregrind/m_syswrap/syswrap-ppc32-linux.c | 2 ++ + coregrind/m_syswrap/syswrap-ppc64-linux.c | 2 ++ + coregrind/m_syswrap/syswrap-s390x-linux.c | 2 ++ + coregrind/m_syswrap/syswrap-x86-linux.c | 2 ++ + include/vki/vki-scnums-arm-linux.h | 1 + + include/vki/vki-scnums-arm64-linux.h | 4 +++- + include/vki/vki-scnums-ppc32-linux.h | 1 + + include/vki/vki-scnums-ppc64-linux.h | 1 + + include/vki/vki-scnums-s390x-linux.h | 5 ++++- + 12 files changed, 23 insertions(+), 3 deletions(-) + +diff --git a/coregrind/m_syswrap/syswrap-amd64-linux.c b/coregrind/m_syswrap/syswrap-amd64-linux.c +index 5062324a1..18b25f80a 100644 +--- a/coregrind/m_syswrap/syswrap-amd64-linux.c ++++ b/coregrind/m_syswrap/syswrap-amd64-linux.c +@@ -862,6 +862,8 @@ static SyscallTableEntry syscall_table[] = { + + LINXY(__NR_statx, sys_statx), // 332 + ++ GENX_(__NR_rseq, sys_ni_syscall), // 334 ++ + LINX_(__NR_membarrier, sys_membarrier), // 324 + + LINX_(__NR_copy_file_range, sys_copy_file_range), // 326 +diff --git a/coregrind/m_syswrap/syswrap-arm-linux.c b/coregrind/m_syswrap/syswrap-arm-linux.c +index 556dd844b..d583cef0c 100644 +--- a/coregrind/m_syswrap/syswrap-arm-linux.c ++++ b/coregrind/m_syswrap/syswrap-arm-linux.c +@@ -1024,6 +1024,7 @@ static SyscallTableEntry syscall_main_table[] = { + LINX_(__NR_pwritev2, sys_pwritev2), // 393 + + LINXY(__NR_statx, sys_statx), // 397 ++ GENX_(__NR_rseq, sys_ni_syscall), // 398 + + LINXY(__NR_clock_gettime64, sys_clock_gettime64), // 403 + LINX_(__NR_clock_settime64, sys_clock_settime64), // 404 +diff --git a/coregrind/m_syswrap/syswrap-arm64-linux.c b/coregrind/m_syswrap/syswrap-arm64-linux.c +index b87107727..2066a38ea 100644 +--- a/coregrind/m_syswrap/syswrap-arm64-linux.c ++++ b/coregrind/m_syswrap/syswrap-arm64-linux.c +@@ -823,8 +823,9 @@ static SyscallTableEntry syscall_main_table[] = { + // (__NR_pkey_mprotect, sys_ni_syscall), // 288 + // (__NR_pkey_alloc, sys_ni_syscall), // 289 + // (__NR_pkey_free, sys_ni_syscall), // 290 ++ LINXY(__NR_statx, sys_statx), // 291 + +- LINXY(__NR_statx, sys_statx), // 397 ++ GENX_(__NR_rseq, sys_ni_syscall), // 293 + + LINXY(__NR_io_uring_setup, sys_io_uring_setup), // 425 + LINXY(__NR_io_uring_enter, sys_io_uring_enter), // 426 +diff --git a/coregrind/m_syswrap/syswrap-ppc32-linux.c b/coregrind/m_syswrap/syswrap-ppc32-linux.c +index 6263ab845..637b2504e 100644 +--- a/coregrind/m_syswrap/syswrap-ppc32-linux.c ++++ b/coregrind/m_syswrap/syswrap-ppc32-linux.c +@@ -1028,6 +1028,8 @@ static SyscallTableEntry syscall_table[] = { + + LINXY(__NR_statx, sys_statx), // 383 + ++ GENX_(__NR_rseq, sys_ni_syscall), // 387 ++ + LINXY(__NR_clock_gettime64, sys_clock_gettime64), // 403 + LINX_(__NR_clock_settime64, sys_clock_settime64), // 404 + +diff --git a/coregrind/m_syswrap/syswrap-ppc64-linux.c b/coregrind/m_syswrap/syswrap-ppc64-linux.c +index a26b41c32..93956d3cc 100644 +--- a/coregrind/m_syswrap/syswrap-ppc64-linux.c ++++ b/coregrind/m_syswrap/syswrap-ppc64-linux.c +@@ -1019,6 +1019,8 @@ static SyscallTableEntry syscall_table[] = { + + LINXY(__NR_statx, sys_statx), // 383 + ++ GENX_(__NR_rseq, sys_ni_syscall), // 387 ++ + LINXY(__NR_io_uring_setup, sys_io_uring_setup), // 425 + LINXY(__NR_io_uring_enter, sys_io_uring_enter), // 426 + LINXY(__NR_io_uring_register, sys_io_uring_register), // 427 +diff --git a/coregrind/m_syswrap/syswrap-s390x-linux.c b/coregrind/m_syswrap/syswrap-s390x-linux.c +index 5c9209859..73f9684c4 100644 +--- a/coregrind/m_syswrap/syswrap-s390x-linux.c ++++ b/coregrind/m_syswrap/syswrap-s390x-linux.c +@@ -860,6 +860,8 @@ static SyscallTableEntry syscall_table[] = { + + LINXY(__NR_statx, sys_statx), // 379 + ++ GENX_(__NR_rseq, sys_ni_syscall), // 381 ++ + LINXY(__NR_io_uring_setup, sys_io_uring_setup), // 425 + LINXY(__NR_io_uring_enter, sys_io_uring_enter), // 426 + LINXY(__NR_io_uring_register, sys_io_uring_register), // 427 +diff --git a/coregrind/m_syswrap/syswrap-x86-linux.c b/coregrind/m_syswrap/syswrap-x86-linux.c +index 1d8f45d33..8662ff501 100644 +--- a/coregrind/m_syswrap/syswrap-x86-linux.c ++++ b/coregrind/m_syswrap/syswrap-x86-linux.c +@@ -1619,6 +1619,8 @@ static SyscallTableEntry syscall_table[] = { + /* Explicitly not supported on i386 yet. */ + GENX_(__NR_arch_prctl, sys_ni_syscall), // 384 + ++ GENX_(__NR_rseq, sys_ni_syscall), // 386 ++ + LINXY(__NR_clock_gettime64, sys_clock_gettime64), // 403 + LINX_(__NR_clock_settime64, sys_clock_settime64), // 404 + +diff --git a/include/vki/vki-scnums-arm-linux.h b/include/vki/vki-scnums-arm-linux.h +index ff560e19d..485db8b26 100644 +--- a/include/vki/vki-scnums-arm-linux.h ++++ b/include/vki/vki-scnums-arm-linux.h +@@ -432,6 +432,7 @@ + #define __NR_pkey_alloc 395 + #define __NR_pkey_free 396 + #define __NR_statx 397 ++#define __NR_rseq 398 + + + +diff --git a/include/vki/vki-scnums-arm64-linux.h b/include/vki/vki-scnums-arm64-linux.h +index 9aa3b2b5f..acdfb39c6 100644 +--- a/include/vki/vki-scnums-arm64-linux.h ++++ b/include/vki/vki-scnums-arm64-linux.h +@@ -323,9 +323,11 @@ + #define __NR_pkey_alloc 289 + #define __NR_pkey_free 290 + #define __NR_statx 291 ++#define __NR_io_pgetevents 291 ++#define __NR_rseq 293 + + #undef __NR_syscalls +-#define __NR_syscalls 292 ++#define __NR_syscalls 294 + + ///* + // * All syscalls below here should go away really, +diff --git a/include/vki/vki-scnums-ppc32-linux.h b/include/vki/vki-scnums-ppc32-linux.h +index 6987ad941..08fa77df0 100644 +--- a/include/vki/vki-scnums-ppc32-linux.h ++++ b/include/vki/vki-scnums-ppc32-linux.h +@@ -415,6 +415,7 @@ + #define __NR_pkey_alloc 384 + #define __NR_pkey_free 385 + #define __NR_pkey_mprotect 386 ++#define __NR_rseq 387 + + #endif /* __VKI_SCNUMS_PPC32_LINUX_H */ + +diff --git a/include/vki/vki-scnums-ppc64-linux.h b/include/vki/vki-scnums-ppc64-linux.h +index 6827964fd..a76fa6d32 100644 +--- a/include/vki/vki-scnums-ppc64-linux.h ++++ b/include/vki/vki-scnums-ppc64-linux.h +@@ -407,6 +407,7 @@ + #define __NR_pkey_alloc 384 + #define __NR_pkey_free 385 + #define __NR_pkey_mprotect 386 ++#define __NR_rseq 387 + + #endif /* __VKI_SCNUMS_PPC64_LINUX_H */ + +diff --git a/include/vki/vki-scnums-s390x-linux.h b/include/vki/vki-scnums-s390x-linux.h +index 6487e20c9..869c04584 100644 +--- a/include/vki/vki-scnums-s390x-linux.h ++++ b/include/vki/vki-scnums-s390x-linux.h +@@ -342,8 +342,11 @@ + #define __NR_s390_guarded_storage 378 + #define __NR_statx 379 + #define __NR_s390_sthyi 380 ++#define __NR_kexec_file_load 381 ++#define __NR_io_pgetevents 382 ++#define __NR_rseq 383 + +-#define NR_syscalls 381 ++#define NR_syscalls 384 + + /* + * There are some system calls that are not present on 64 bit, some +-- +2.30.2 +
meta/recipes-devtools/valgrind/valgrind_3.18.1.bb +1 -0
@@ -42,6 +42,7 @@ SRC_URI = "https://sourceware.org/pub/valgrind/valgrind-${PV}.tar.bz2 \ file://s390x_vec_op_t.patch \ file://0001-none-tests-fdleak_cmsg.stderr.exp-adjust-tmp-paths.patch \ file://0001-memcheck-tests-Fix-timerfd-syscall-test.patch \ + file://0001-Implement-linux-rseq-syscall-as-ENOSYS.patch \ " SRC_URI[sha256sum] = "00859aa13a772eddf7822225f4b46ee0d39afbe071d32778da4d99984081f7f5" UPSTREAM_CHECK_REGEX = "valgrind-(?P<pver>\d+(\.\d+)+)\.tar"
Signature · 1 line
2.31.1
PATCH 3/5 valgrind: remove duplicate and skipped tests from remove-for-aarch64
In reply to Randy MacLeodThe valgrind ptest script warns about tests such as:
mv: cannot stat 'drd/tests/bar_bad_xml.vgtest': No such file or directory
Since these tests were either in both remove-for-* lists or were not installed since they fail everywhere as noted in:
85a0d61025 valgrind: fix the remaining ptest failures 984ffe3ab4 valgrind: Disable leak_cpp_interior test
remove them from the remove-for-aarch64 list
--- .../recipes-devtools/valgrind/valgrind/remove-for-aarch64 | 8 -------- 1 file changed, 8 deletions(-)
meta/recipes-devtools/valgrind/valgrind/remove-for-aarch64 +0 -8
@@ -32,7 +32,6 @@ drd/tests/annotate_trace_memory drd/tests/annotate_trace_memory_xml drd/tests/atomic_var drd/tests/bar_bad -drd/tests/bar_bad_xml drd/tests/bar_trivial drd/tests/bug-235681 drd/tests/bug322621
@@ -66,7 +65,6 @@ drd/tests/pth_barrier2 drd/tests/pth_barrier3 drd/tests/pth_barrier_race drd/tests/pth_barrier_reinit -drd/tests/pth_barrier_thr_cr drd/tests/pth_broadcast drd/tests/pth_cancel_locked drd/tests/pth_cleanup_handler
@@ -109,7 +107,6 @@ drd/tests/tc05_simple_race drd/tests/tc06_two_races drd/tests/tc07_hbl1 drd/tests/tc08_hbl2 -drd/tests/tc09_bad_unlock drd/tests/tc10_rec_lock drd/tests/tc11_XCHG drd/tests/tc12_rwl_trivial
@@ -174,7 +171,6 @@ helgrind/tests/tc21_pthonce helgrind/tests/tc22_exit_w_lock helgrind/tests/tc23_bogus_condwait helgrind/tests/tc24_nonzero_sem -helgrind/tests/tls_threads memcheck/tests/accounting memcheck/tests/addressable memcheck/tests/arm64-linux/scalar
@@ -194,13 +190,11 @@ memcheck/tests/dw4 memcheck/tests/err_disable4 memcheck/tests/err_disable_arange1 memcheck/tests/leak-autofreepool-5 -memcheck/tests/leak_cpp_interior memcheck/tests/linux/lsframe1 memcheck/tests/linux/lsframe2 memcheck/tests/linux/with-space memcheck/tests/origin5-bz2 memcheck/tests/origin6-fp -memcheck/tests/overlap memcheck/tests/partial_load_dflt memcheck/tests/pdb-realloc2 memcheck/tests/sh-mem
@@ -208,7 +202,6 @@ memcheck/tests/sh-mem-random memcheck/tests/sigaltstack memcheck/tests/sigkill memcheck/tests/signal2 -memcheck/tests/supp_unknown memcheck/tests/threadname memcheck/tests/threadname_xml memcheck/tests/unit_oset
@@ -236,5 +229,4 @@ memcheck/tests/wrapmallocstatic memcheck/tests/writev1 memcheck/tests/xml1 memcheck/tests/linux/stack_changes -gdbserver_tests/hginfo memcheck/tests/linux/timerfd-syscall
Signature · 1 line
2.31.1
PATCH 4/5 valgrind: skip boost_thread for aarch64 ptests
In reply to Randy MacLeodThe drd/tests/boost_thread test passes when run interactively on qemuarm64 but fails for most runs when run in qemu on an arm worker such as ubuntu1804-arm-1 from the Yocto autobuilder cluster. Skip the test until we fix the problem.
--- meta/recipes-devtools/valgrind/valgrind/remove-for-aarch64 | 1 + 1 file changed, 1 insertion(+)
meta/recipes-devtools/valgrind/valgrind/remove-for-aarch64 +1 -0
@@ -33,6 +33,7 @@ drd/tests/annotate_trace_memory_xml drd/tests/atomic_var drd/tests/bar_bad drd/tests/bar_trivial +drd/tests/boost_thread drd/tests/bug-235681 drd/tests/bug322621 drd/tests/circular_buffer
Signature · 1 line
2.31.1