summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/valgrind
diff options
context:
space:
mode:
authorYi Fan Yu <yifan.yu@windriver.com>2021-04-12 13:48:18 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-04-18 11:37:24 +0100
commite90519f1b51f51901d4fecc035406c3b65305700 (patch)
tree41f56db4189ae0d002a8fba425ce79226680a1dd /meta/recipes-devtools/valgrind
parent0f51493992abb655b5383b1909ad7ee4363324ae (diff)
downloadpoky-e90519f1b51f51901d4fecc035406c3b65305700.tar.gz
valgrind: Fix ptest swapcontext.vgtest
Backport an upstream patch. to limit the amount of stackstrace present. Revert "valgrind: Disable ptest swapcontext.vgtest" Effectively reverts commit 9dff5766f5795bb02677050045f24365f68bbc1a. [YOCTO #14324] (From OE-Core rev: a9baae5994354ba6410793f8a54e224e9dc21b5a) Signed-off-by: Yi Fan Yu <yifan.yu@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/valgrind')
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/0001-Disable-temporarily-drd-tests-swapcontext.vgtest.patch29
-rw-r--r--meta/recipes-devtools/valgrind/valgrind/0001-drd-tests-swapcontext-Add-SIGALRM-handler-to-avoid-s.patch65
-rw-r--r--meta/recipes-devtools/valgrind/valgrind_3.17.0.bb2
3 files changed, 66 insertions, 30 deletions
diff --git a/meta/recipes-devtools/valgrind/valgrind/0001-Disable-temporarily-drd-tests-swapcontext.vgtest.patch b/meta/recipes-devtools/valgrind/valgrind/0001-Disable-temporarily-drd-tests-swapcontext.vgtest.patch
deleted file mode 100644
index 10ec06ccaf..0000000000
--- a/meta/recipes-devtools/valgrind/valgrind/0001-Disable-temporarily-drd-tests-swapcontext.vgtest.patch
+++ /dev/null
@@ -1,29 +0,0 @@
1From 0f1814a618eff4233e9e8379a8cb2dededdc5a8b Mon Sep 17 00:00:00 2001
2From: Yi Fan Yu <yifan.yu@windriver.com>
3Date: Tue, 23 Mar 2021 11:09:20 -0700
4Subject: [PATCH] Disable temporarily drd/tests/swapcontext.vgtest
5
6New test introduced in valgrind 3.17.0.
7Test fails on both qemuarm64 and qemux64.
8
9Upstream-Status: Pending [Needs more Investigation]
10[YOCTO #14324]
11
12Signed-off-by: Yi Fan Yu <yifan.yu@windriver.com>
13---
14 drd/tests/swapcontext.vgtest | 2 +-
15 1 file changed, 1 insertion(+), 1 deletion(-)
16
17diff --git a/drd/tests/swapcontext.vgtest b/drd/tests/swapcontext.vgtest
18index 98e3712c4..5492da31d 100644
19--- a/drd/tests/swapcontext.vgtest
20+++ b/drd/tests/swapcontext.vgtest
21@@ -1,4 +1,4 @@
22-prereq: test -e swapcontext && ./supported_libpthread
23+prereq: false
24 vgopts: --read-var-info=yes --check-stack-var=yes --show-confl-seg=no --num-callers=2
25 prog: swapcontext
26 stderr_filter: filter_stderr
27--
282.17.1
29
diff --git a/meta/recipes-devtools/valgrind/valgrind/0001-drd-tests-swapcontext-Add-SIGALRM-handler-to-avoid-s.patch b/meta/recipes-devtools/valgrind/valgrind/0001-drd-tests-swapcontext-Add-SIGALRM-handler-to-avoid-s.patch
new file mode 100644
index 0000000000..371c1701d0
--- /dev/null
+++ b/meta/recipes-devtools/valgrind/valgrind/0001-drd-tests-swapcontext-Add-SIGALRM-handler-to-avoid-s.patch
@@ -0,0 +1,65 @@
1From 4c8c4a9c3a92300e3e6500e5a278ca37514a1fdb Mon Sep 17 00:00:00 2001
2From: Yi Fan Yu <yifan.yu@windriver.com>
3Date: Thu, 1 Apr 2021 15:31:47 -0400
4Subject: [PATCH] drd/tests/swapcontext: Add SIGALRM handler to avoid
5 stacktrace
6
7During testing for oe-core build on QEMU,
8SIGALRM can trigger during nanosleep.
9This results a different stderr output than expected.
10
11```
12==277== Process terminating with default action of signal 14 (SIGALRM)
13==277== at 0x36C74C3943: clock_nanosleep@@GLIBC_2.17 (clock_nanosleep.c:43)
14==277== by 0x36C74C8726: nanosleep (nanosleep.c:25)
15```
16
17This stacktrace printing will not occur
18if we add a handler that simply exits.
19
20https://bugs.kde.org/show_bug.cgi?id=435160
21
22Signed-off-by: Yi Fan Yu <yifan.yu@windriver.com>
23---
24 drd/tests/swapcontext.c | 5 +++++
25 drd/tests/swapcontext.stderr.exp | 4 ----
26 2 files changed, 5 insertions(+), 4 deletions(-)
27
28diff --git a/drd/tests/swapcontext.c b/drd/tests/swapcontext.c
29index 622c70bc5..2cb969a5e 100644
30--- a/drd/tests/swapcontext.c
31+++ b/drd/tests/swapcontext.c
32@@ -25,6 +25,10 @@ typedef struct thread_local {
33 size_t nrsw;
34 } thread_local_t;
35
36+static void sig_alrm_handler(int signo) {
37+ _exit(1);
38+}
39+
40 static void f(void *data, int n)
41 {
42 enum { NR_SWITCHES = 200000 };
43@@ -76,6 +80,7 @@ int main(int argc, char *argv[])
44 pthread_attr_t attr;
45 int i, res;
46
47+ signal(SIGALRM, sig_alrm_handler);
48 memset(tlocal, 0, sizeof(tlocal));
49
50 pthread_attr_init(&attr);
51diff --git a/drd/tests/swapcontext.stderr.exp b/drd/tests/swapcontext.stderr.exp
52index fcb5d5ed4..d18786f80 100644
53--- a/drd/tests/swapcontext.stderr.exp
54+++ b/drd/tests/swapcontext.stderr.exp
55@@ -1,7 +1,3 @@
56
57
58-Process terminating with default action of signal 14 (SIGALRM)
59- at 0x........: swapcontext (in /...libc...)
60- by 0x........: f (swapcontext.c:?)
61-
62 ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
63--
642.17.1
65
diff --git a/meta/recipes-devtools/valgrind/valgrind_3.17.0.bb b/meta/recipes-devtools/valgrind/valgrind_3.17.0.bb
index 7a6b766121..2eea84c229 100644
--- a/meta/recipes-devtools/valgrind/valgrind_3.17.0.bb
+++ b/meta/recipes-devtools/valgrind/valgrind_3.17.0.bb
@@ -43,7 +43,7 @@ SRC_URI = "https://sourceware.org/pub/valgrind/valgrind-${PV}.tar.bz2 \
43 file://0001-none-tests-fdleak_cmsg.stderr.exp-adjust-tmp-paths.patch \ 43 file://0001-none-tests-fdleak_cmsg.stderr.exp-adjust-tmp-paths.patch \
44 file://0001-memcheck-tests-Fix-timerfd-syscall-test.patch \ 44 file://0001-memcheck-tests-Fix-timerfd-syscall-test.patch \
45 file://0001-Add-missing-musl.supp.patch \ 45 file://0001-Add-missing-musl.supp.patch \
46 file://0001-Disable-temporarily-drd-tests-swapcontext.vgtest.patch \ 46 file://0001-drd-tests-swapcontext-Add-SIGALRM-handler-to-avoid-s.patch \
47 " 47 "
48SRC_URI[md5sum] = "afe11b5572c3121a781433b7c0ab741b" 48SRC_URI[md5sum] = "afe11b5572c3121a781433b7c0ab741b"
49SRC_URI[sha256sum] = "ad3aec668e813e40f238995f60796d9590eee64a16dff88421430630e69285a2" 49SRC_URI[sha256sum] = "ad3aec668e813e40f238995f60796d9590eee64a16dff88421430630e69285a2"