You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(122) |
Nov
(152) |
Dec
(69) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(6) |
Feb
(25) |
Mar
(73) |
Apr
(82) |
May
(24) |
Jun
(25) |
Jul
(10) |
Aug
(11) |
Sep
(10) |
Oct
(54) |
Nov
(203) |
Dec
(182) |
| 2004 |
Jan
(307) |
Feb
(305) |
Mar
(430) |
Apr
(312) |
May
(187) |
Jun
(342) |
Jul
(487) |
Aug
(637) |
Sep
(336) |
Oct
(373) |
Nov
(441) |
Dec
(210) |
| 2005 |
Jan
(385) |
Feb
(480) |
Mar
(636) |
Apr
(544) |
May
(679) |
Jun
(625) |
Jul
(810) |
Aug
(838) |
Sep
(634) |
Oct
(521) |
Nov
(965) |
Dec
(543) |
| 2006 |
Jan
(494) |
Feb
(431) |
Mar
(546) |
Apr
(411) |
May
(406) |
Jun
(322) |
Jul
(256) |
Aug
(401) |
Sep
(345) |
Oct
(542) |
Nov
(308) |
Dec
(481) |
| 2007 |
Jan
(427) |
Feb
(326) |
Mar
(367) |
Apr
(255) |
May
(244) |
Jun
(204) |
Jul
(223) |
Aug
(231) |
Sep
(354) |
Oct
(374) |
Nov
(497) |
Dec
(362) |
| 2008 |
Jan
(322) |
Feb
(482) |
Mar
(658) |
Apr
(422) |
May
(476) |
Jun
(396) |
Jul
(455) |
Aug
(267) |
Sep
(280) |
Oct
(253) |
Nov
(232) |
Dec
(304) |
| 2009 |
Jan
(486) |
Feb
(470) |
Mar
(458) |
Apr
(423) |
May
(696) |
Jun
(461) |
Jul
(551) |
Aug
(575) |
Sep
(134) |
Oct
(110) |
Nov
(157) |
Dec
(102) |
| 2010 |
Jan
(226) |
Feb
(86) |
Mar
(147) |
Apr
(117) |
May
(107) |
Jun
(203) |
Jul
(193) |
Aug
(238) |
Sep
(300) |
Oct
(246) |
Nov
(23) |
Dec
(75) |
| 2011 |
Jan
(133) |
Feb
(195) |
Mar
(315) |
Apr
(200) |
May
(267) |
Jun
(293) |
Jul
(353) |
Aug
(237) |
Sep
(278) |
Oct
(611) |
Nov
(274) |
Dec
(260) |
| 2012 |
Jan
(303) |
Feb
(391) |
Mar
(417) |
Apr
(441) |
May
(488) |
Jun
(655) |
Jul
(590) |
Aug
(610) |
Sep
(526) |
Oct
(478) |
Nov
(359) |
Dec
(372) |
| 2013 |
Jan
(467) |
Feb
(226) |
Mar
(391) |
Apr
(281) |
May
(299) |
Jun
(252) |
Jul
(311) |
Aug
(352) |
Sep
(481) |
Oct
(571) |
Nov
(222) |
Dec
(231) |
| 2014 |
Jan
(185) |
Feb
(329) |
Mar
(245) |
Apr
(238) |
May
(281) |
Jun
(399) |
Jul
(382) |
Aug
(500) |
Sep
(579) |
Oct
(435) |
Nov
(487) |
Dec
(256) |
| 2015 |
Jan
(338) |
Feb
(357) |
Mar
(330) |
Apr
(294) |
May
(191) |
Jun
(108) |
Jul
(142) |
Aug
(261) |
Sep
(190) |
Oct
(54) |
Nov
(83) |
Dec
(22) |
| 2016 |
Jan
(49) |
Feb
(89) |
Mar
(33) |
Apr
(50) |
May
(27) |
Jun
(34) |
Jul
(53) |
Aug
(53) |
Sep
(98) |
Oct
(206) |
Nov
(93) |
Dec
(53) |
| 2017 |
Jan
(65) |
Feb
(82) |
Mar
(102) |
Apr
(86) |
May
(187) |
Jun
(67) |
Jul
(23) |
Aug
(93) |
Sep
(65) |
Oct
(45) |
Nov
(35) |
Dec
(17) |
| 2018 |
Jan
(26) |
Feb
(35) |
Mar
(38) |
Apr
(32) |
May
(8) |
Jun
(43) |
Jul
(27) |
Aug
(30) |
Sep
(43) |
Oct
(42) |
Nov
(38) |
Dec
(67) |
| 2019 |
Jan
(32) |
Feb
(37) |
Mar
(53) |
Apr
(64) |
May
(49) |
Jun
(18) |
Jul
(14) |
Aug
(53) |
Sep
(25) |
Oct
(30) |
Nov
(49) |
Dec
(31) |
| 2020 |
Jan
(87) |
Feb
(45) |
Mar
(37) |
Apr
(51) |
May
(99) |
Jun
(36) |
Jul
(11) |
Aug
(14) |
Sep
(20) |
Oct
(24) |
Nov
(40) |
Dec
(23) |
| 2021 |
Jan
(14) |
Feb
(53) |
Mar
(85) |
Apr
(15) |
May
(19) |
Jun
(3) |
Jul
(14) |
Aug
(1) |
Sep
(57) |
Oct
(73) |
Nov
(56) |
Dec
(22) |
| 2022 |
Jan
(3) |
Feb
(22) |
Mar
(6) |
Apr
(55) |
May
(46) |
Jun
(39) |
Jul
(15) |
Aug
(9) |
Sep
(11) |
Oct
(34) |
Nov
(20) |
Dec
(36) |
| 2023 |
Jan
(79) |
Feb
(41) |
Mar
(99) |
Apr
(169) |
May
(48) |
Jun
(16) |
Jul
(16) |
Aug
(57) |
Sep
(19) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
1
(1) |
2
|
3
(2) |
4
(2) |
5
|
6
|
|
7
(1) |
8
|
9
|
10
(1) |
11
(1) |
12
(2) |
13
|
|
14
|
15
|
16
(1) |
17
(1) |
18
|
19
|
20
(13) |
|
21
(3) |
22
(2) |
23
(6) |
24
(2) |
25
(5) |
26
(2) |
27
(2) |
|
28
(6) |
|
|
|
|
|
|
|
From: Bart V. A. <bva...@so...> - 2021-02-20 22:57:25
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=719d23b7a9c3b02411dee7d5d4d3744938bb768c commit 719d23b7a9c3b02411dee7d5d4d3744938bb768c Author: Bart Van Assche <bva...@ac...> Date: Sat Feb 20 14:48:58 2021 -0800 drd/tests/swapcontext: Improve portability Diff: --- drd/tests/swapcontext.c | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/drd/tests/swapcontext.c b/drd/tests/swapcontext.c index f3944d1ba6..e692559b06 100644 --- a/drd/tests/swapcontext.c +++ b/drd/tests/swapcontext.c @@ -16,7 +16,6 @@ typedef struct thread_local { ucontext_t uc[3]; size_t nrsw; - int tfd; } thread_local_t; static void f(void *data, int n) @@ -26,15 +25,11 @@ static void f(void *data, int n) thread_local_t *tlocal = data; while (1) { - memset(&pfd, 0, sizeof(pfd)); - pfd.fd = tlocal->tfd; - pfd.events = POLLIN; - - if (poll(&pfd, 1, 0) == 1) { - if (++tlocal->nrsw == NR_SWITCHES) - return; - swapcontext(&tlocal->uc[n], &tlocal->uc[3 - n]); - } + struct timespec delay = { .tv_nsec = 1000 }; + nanosleep(&delay, NULL); + if (++tlocal->nrsw == NR_SWITCHES) + return; + swapcontext(&tlocal->uc[n], &tlocal->uc[3 - n]); } } @@ -62,19 +57,6 @@ void *worker(void *data) __valgrind_register_current_stack(); - tlocal->tfd = timerfd_create(CLOCK_REALTIME, 0); - if (tlocal->tfd < 0) - abort(); - - it.it_interval.tv_sec = 0; - it.it_interval.tv_nsec = 1000; - - it.it_value.tv_sec = time(NULL); - it.it_value.tv_nsec = 1000; - - if (timerfd_settime(tlocal->tfd, TFD_TIMER_ABSTIME, &it, NULL) < 0) - abort(); - if (getcontext(&(tlocal->uc[1])) < 0) abort(); if (getcontext(&(tlocal->uc[2])) < 0) |
|
From: Paul F. <pj...@wa...> - 2021-02-20 20:45:17
|
On 2/20/21 9:17 PM, Mark Wielaard wrote: > > And I think swapcontext itself isn't portable either. > So maybe the testcase should be GNU/Linux only? swapcontext should be OK, at least there is a manpage for it on all 3 OSes. I expect that the timerfd part will be difficult to port. A+ Paul |
|
From: Mark W. <ma...@so...> - 2021-02-20 20:30:54
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=dec30506534c0c1bb0e77e62275e697b041e3c3a commit dec30506534c0c1bb0e77e62275e697b041e3c3a Author: Allison Karlitskaya <all...@re...> Date: Tue Oct 13 13:17:11 2020 +0200 Linux: Add wrapper for fcntl(F_{GET,ADD}_SEALS) Add also a testcase to memcheck/tests/linux, enabled according to a new check for memfd_create() in configure.ac. https://bugs.kde.org/show_bug.cgi?id=361770 Diff: --- .gitignore | 1 + NEWS | 1 + configure.ac | 3 ++ coregrind/m_syswrap/syswrap-linux.c | 4 ++ include/vki/vki-linux.h | 3 ++ memcheck/tests/linux/Makefile.am | 5 +++ memcheck/tests/linux/memfd.c | 75 +++++++++++++++++++++++++++++++++++ memcheck/tests/linux/memfd.stderr.exp | 6 +++ memcheck/tests/linux/memfd.vgtest | 3 ++ 9 files changed, 101 insertions(+) diff --git a/.gitignore b/.gitignore index dff20848e6..eec6169891 100644 --- a/.gitignore +++ b/.gitignore @@ -1047,6 +1047,7 @@ /memcheck/tests/linux/lsframe2 /memcheck/tests/linux/Makefile /memcheck/tests/linux/Makefile.in +/memcheck/tests/linux/memfd /memcheck/tests/linux/rfcomm /memcheck/tests/linux/sigqueue /memcheck/tests/linux/stack_changes diff --git a/NEWS b/NEWS index cdd103b01e..55bf58ae8a 100644 --- a/NEWS +++ b/NEWS @@ -78,6 +78,7 @@ where XXXXXX is the bug number as listed below. 140939 --track-fds reports leakage of stdout/in/err and doesn't respect -q 217695 malloc/calloc/realloc/memalign failure doesn't set errno to ENOMEM 345077 linux syscall execveat support (linux 3.19) +361770 Missing F_ADD_SEALS 369029 handle linux syscalls sched_getattr and sched_setattr 384729 __libc_freeres inhibits cross-platform valgrind 391853 Makefile.all.am:L247 and @SOLARIS_UNDEF_LARGESOURCE@ being empty diff --git a/configure.ac b/configure.ac index 41ae942429..4648450fe3 100755 --- a/configure.ac +++ b/configure.ac @@ -4358,6 +4358,7 @@ AC_CHECK_FUNCS([ \ klogctl \ mallinfo \ memchr \ + memfd_create \ memset \ mkdir \ mremap \ @@ -4409,6 +4410,8 @@ AM_CONDITIONAL([HAVE_PREADV_PWRITEV], [test x$ac_cv_func_preadv = xyes && test x$ac_cv_func_pwritev = xyes]) AM_CONDITIONAL([HAVE_PREADV2_PWRITEV2], [test x$ac_cv_func_preadv2 = xyes && test x$ac_cv_func_pwritev2 = xyes]) +AM_CONDITIONAL([HAVE_MEMFD_CREATE], + [test x$ac_cv_func_memfd_create = xyes]) if test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX \ -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX \ diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c index fcc534454a..3d6939d147 100644 --- a/coregrind/m_syswrap/syswrap-linux.c +++ b/coregrind/m_syswrap/syswrap-linux.c @@ -6784,6 +6784,7 @@ PRE(sys_fcntl) case VKI_F_GETSIG: case VKI_F_GETLEASE: case VKI_F_GETPIPE_SZ: + case VKI_F_GET_SEALS: PRINT("sys_fcntl ( %" FMT_REGWORD "u, %" FMT_REGWORD "u )", ARG1, ARG2); PRE_REG_READ2(long, "fcntl", unsigned int, fd, unsigned int, cmd); break; @@ -6798,6 +6799,7 @@ PRE(sys_fcntl) case VKI_F_SETOWN: case VKI_F_SETSIG: case VKI_F_SETPIPE_SZ: + case VKI_F_ADD_SEALS: PRINT("sys_fcntl[ARG3=='arg'] ( %" FMT_REGWORD "u, %" FMT_REGWORD "u, %" FMT_REGWORD "u )", ARG1, ARG2, ARG3); PRE_REG_READ3(long, "fcntl", @@ -6930,6 +6932,7 @@ PRE(sys_fcntl64) case VKI_F_GETSIG: case VKI_F_SETSIG: case VKI_F_GETLEASE: + case VKI_F_GET_SEALS: PRINT("sys_fcntl64 ( %" FMT_REGWORD "u, %" FMT_REGWORD "u )", ARG1, ARG2); PRE_REG_READ2(long, "fcntl64", unsigned int, fd, unsigned int, cmd); break; @@ -6941,6 +6944,7 @@ PRE(sys_fcntl64) case VKI_F_SETFL: case VKI_F_SETLEASE: case VKI_F_NOTIFY: + case VKI_F_ADD_SEALS: PRINT("sys_fcntl64[ARG3=='arg'] ( %" FMT_REGWORD "u, %" FMT_REGWORD "u, %" FMT_REGWORD "u )", ARG1, ARG2, ARG3); PRE_REG_READ3(long, "fcntl64", diff --git a/include/vki/vki-linux.h b/include/vki/vki-linux.h index 3b9dc37796..426d9db92f 100644 --- a/include/vki/vki-linux.h +++ b/include/vki/vki-linux.h @@ -1504,6 +1504,9 @@ struct vki_dirent64 { #define VKI_F_SETPIPE_SZ (VKI_F_LINUX_SPECIFIC_BASE + 7) #define VKI_F_GETPIPE_SZ (VKI_F_LINUX_SPECIFIC_BASE + 8) +#define VKI_F_ADD_SEALS (VKI_F_LINUX_SPECIFIC_BASE + 9) +#define VKI_F_GET_SEALS (VKI_F_LINUX_SPECIFIC_BASE + 10) + struct vki_flock { short l_type; short l_whence; diff --git a/memcheck/tests/linux/Makefile.am b/memcheck/tests/linux/Makefile.am index 1c53ffbaf8..7e796aa7fa 100644 --- a/memcheck/tests/linux/Makefile.am +++ b/memcheck/tests/linux/Makefile.am @@ -13,6 +13,7 @@ EXTRA_DIST = \ ioctl-tiocsig.vgtest ioctl-tiocsig.stderr.exp \ lsframe1.vgtest lsframe1.stdout.exp lsframe1.stderr.exp \ lsframe2.vgtest lsframe2.stdout.exp lsframe2.stderr.exp \ + memfd.vgtest memfd.stderr.exp \ rfcomm.vgtest rfcomm.stderr.exp \ sigqueue.vgtest sigqueue.stderr.exp \ stack_changes.stderr.exp stack_changes.stdout.exp \ @@ -58,6 +59,10 @@ if HAVE_AT_FDCWD check_PROGRAMS += sys-openat endif +if HAVE_MEMFD_CREATE +check_PROGRAMS += memfd +endif + if HAVE_COPY_FILE_RANGE check_PROGRAMS += sys-copy_file_range endif diff --git a/memcheck/tests/linux/memfd.c b/memcheck/tests/linux/memfd.c new file mode 100644 index 0000000000..f37e4b5c2f --- /dev/null +++ b/memcheck/tests/linux/memfd.c @@ -0,0 +1,75 @@ +#define _GNU_SOURCE + +#include <assert.h> +#include <errno.h> +#include <fcntl.h> +#include <sys/mman.h> +#include <unistd.h> + +#include "../../memcheck.h" + +static void +assert_expected (int fd, int expected_seals) +{ + int current_seals = fcntl (fd, F_GET_SEALS); + assert (current_seals == expected_seals); +} + +static void +add_seal (int fd, int *expected_seals, int new_seal) +{ + int r = fcntl (fd, F_ADD_SEALS, new_seal); + assert (r == 0); + + *expected_seals |= new_seal; + + // Make sure we get the result we expected. + assert_expected (fd, *expected_seals); +} + +static void +add_seal_expect_fail (int fd, int new_seal, int expected_errno) +{ + int r = fcntl (fd, F_ADD_SEALS, new_seal); + assert (r == -1 && errno == expected_errno); +} + +int +main (void) +{ + int expected_seals = 0; + int fd; + + // Try with an fd that doesn't support sealing. + fd = memfd_create ("xyz", 0); + if (fd < 0) + { + // Not supported, nothing to test... + return 1; + } + + assert_expected (fd, F_SEAL_SEAL); + add_seal_expect_fail (fd, F_SEAL_WRITE, EPERM); + assert_expected (fd, F_SEAL_SEAL); // ...should still be unset after failed attempt + close (fd); + + // Now, try the successful case. + fd = memfd_create ("xyz", MFD_ALLOW_SEALING); + add_seal (fd, &expected_seals, F_SEAL_SHRINK); + add_seal (fd, &expected_seals, F_SEAL_GROW); + + // Now prevent more sealing. + add_seal (fd, &expected_seals, F_SEAL_SEAL); + + // And make sure that it indeed fails. + add_seal_expect_fail (fd, F_SEAL_WRITE, EPERM); + assert_expected (fd, expected_seals); + close (fd); + + // Test the only memory failure possible: passing an undefined argument to F_ADD_SEALS + int undefined_seal = 0; + VALGRIND_MAKE_MEM_UNDEFINED(&undefined_seal, sizeof undefined_seal); + fcntl (-1, F_ADD_SEALS, undefined_seal); + + return 0; +} diff --git a/memcheck/tests/linux/memfd.stderr.exp b/memcheck/tests/linux/memfd.stderr.exp new file mode 100644 index 0000000000..13009d8ae4 --- /dev/null +++ b/memcheck/tests/linux/memfd.stderr.exp @@ -0,0 +1,6 @@ +Syscall param fcntl(arg) contains uninitialised byte(s) + ... + by 0x........: main (memfd.c:72) + Uninitialised value was created by a client request + at 0x........: main (memfd.c:71) + diff --git a/memcheck/tests/linux/memfd.vgtest b/memcheck/tests/linux/memfd.vgtest new file mode 100644 index 0000000000..4096401f73 --- /dev/null +++ b/memcheck/tests/linux/memfd.vgtest @@ -0,0 +1,3 @@ +prereq: test -e memfd +vgopts: -q --track-origins=yes +prog: memfd |
|
From: Mark W. <ma...@kl...> - 2021-02-20 20:17:49
|
Hi Paul, On Sat, 2021-02-20 at 20:47 +0100, Paul Floyd wrote: > > On 20 Feb 2021, at 20:13, Mark Wielaard <ma...@kl...> wrote: > > The buildbot found two setups where the make distcheck test failed > > with > > the last commit: > > This fails to compile on Solaris and FreeBSD and will almost > certainly not compile on macOS. This is because > > +#include <sys/timerfd.h> > > does not exist on these platforms. This either needs a configure > check or a more portable timer API. And I think swapcontext itself isn't portable either. So maybe the testcase should be GNU/Linux only? Cheers, Mark |
|
From: Paul F. <pj...@wa...> - 2021-02-20 19:47:59
|
> On 20 Feb 2021, at 20:13, Mark Wielaard <ma...@kl...> wrote: > > Hi, > > The buildbot found two setups where the make distcheck test failed with > the last commit: > > Hi This fails to compile on Solaris and FreeBSD and will almost certainly not compile on macOS. This is because +#include <sys/timerfd.h> does not exist on these platforms. This either needs a configure check or a more portable timer API. A+ Paul |
|
From: Mark W. <ma...@kl...> - 2021-02-20 19:29:46
|
Hi, The buildbot found two setups where the make distcheck test failed with the last commit: On Sat, 2021-02-20 at 17:25 +0000, bui...@bu... wrote: > The Buildbot has detected a failed build on builder whole buildset > while building valgrind. > Full details are available at: > https://builder.wildebeest.org/buildbot/#builders/37/builds/143 > > Buildbot URL: https://builder.wildebeest.org/buildbot/ > > Worker for this Build: fedora-x86_64 > > Build Reason: <unknown> > Blamelist: Bart Van Assche <bva...@ac...> > > BUILD FAILED: failed test (failure) > > Sincerely, > -The BuildbotThe Buildbot has detected a failed build on builder > whole buildset while building valgrind. > Full details are available at: > https://builder.wildebeest.org/buildbot/#builders/38/builds/122 > > Buildbot URL: https://builder.wildebeest.org/buildbot/ > > Worker for this Build: fedora-s390x > > Build Reason: <unknown> > Blamelist: Bart Van Assche <bva...@ac...> > > BUILD FAILED: failed test (failure) Should hopefully be fixed by: commit 7aac53c6d0ca7e11d4037ff474dcd1c08862fd30 Author: Mark Wielaard <ma...@kl...> Date: Sat Feb 20 20:05:31 2021 +0100 Fix valgrind.h include in drd/tests/swapcontext.c In tree tests should include "valgrind.h" not <valgrind/valgrind.h> the later might pick up the system installed valgrind.h and doesn't work when srcdir != builddir. diff --git a/drd/tests/swapcontext.c b/drd/tests/swapcontext.c index e73a612dc..f3944d1ba 100644 --- a/drd/tests/swapcontext.c +++ b/drd/tests/swapcontext.c @@ -11,7 +11,7 @@ #include <sys/timerfd.h> #include <ucontext.h> #include <unistd.h> -#include <valgrind/valgrind.h> +#include "valgrind.h" typedef struct thread_local { ucontext_t uc[3]; If not, I am sure the buildbot will let us know soon :) Cheers, Mrk |
|
From: Mark W. <ma...@so...> - 2021-02-20 19:09:33
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=7aac53c6d0ca7e11d4037ff474dcd1c08862fd30 commit 7aac53c6d0ca7e11d4037ff474dcd1c08862fd30 Author: Mark Wielaard <ma...@kl...> Date: Sat Feb 20 20:05:31 2021 +0100 Fix valgrind.h include in drd/tests/swapcontext.c In tree tests should include "valgrind.h" not <valgrind/valgrind.h> the later might pick up the system installed valgrind.h and doesn't work when srcdir != builddir. Diff: --- drd/tests/swapcontext.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drd/tests/swapcontext.c b/drd/tests/swapcontext.c index e73a612dc3..f3944d1ba6 100644 --- a/drd/tests/swapcontext.c +++ b/drd/tests/swapcontext.c @@ -11,7 +11,7 @@ #include <sys/timerfd.h> #include <ucontext.h> #include <unistd.h> -#include <valgrind/valgrind.h> +#include "valgrind.h" typedef struct thread_local { ucontext_t uc[3]; |
|
From: Bart V. A. <bva...@so...> - 2021-02-20 16:46:01
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=0062f2b519ea48b82164ae423fac58a59ee00f1a commit 0062f2b519ea48b82164ae423fac58a59ee00f1a Author: Bart Van Assche <bva...@ac...> Date: Sun Feb 14 18:42:04 2021 -0800 drd/tests/swapcontext: Add a swapcontext() test Diff: --- drd/tests/Makefile.am | 5 ++ drd/tests/swapcontext.c | 124 +++++++++++++++++++++++++++++++++++++++ drd/tests/swapcontext.stderr.exp | 7 +++ drd/tests/swapcontext.vgtest | 4 ++ 4 files changed, 140 insertions(+) diff --git a/drd/tests/Makefile.am b/drd/tests/Makefile.am index 5df76150e9..a489c8b46d 100644 --- a/drd/tests/Makefile.am +++ b/drd/tests/Makefile.am @@ -267,6 +267,8 @@ EXTRA_DIST = \ sem_open_traced.vgtest \ sem_wait.stderr.exp \ sem_wait.vgtest \ + swapcontext.stderr.exp \ + swapcontext.vgtest \ sigalrm.stderr.exp \ sigalrm.vgtest \ sigaltstack.stderr.exp \ @@ -406,6 +408,7 @@ check_PROGRAMS = \ sem_as_mutex \ sem_open \ sigalrm \ + swapcontext \ threaded-fork \ trylock \ unit_bitmap \ @@ -585,3 +588,5 @@ std_thread2_LDFLAGS = -Wl,--no-as-needed endif sem_wait_SOURCES = sem_wait.cpp + +swapcontext_SOURCES = swapcontext.c diff --git a/drd/tests/swapcontext.c b/drd/tests/swapcontext.c new file mode 100644 index 0000000000..e73a612dc3 --- /dev/null +++ b/drd/tests/swapcontext.c @@ -0,0 +1,124 @@ +/* See also https://bugs.kde.org/show_bug.cgi?id=432381. */ + +#define _GNU_SOURCE + +#include <poll.h> +#include <pthread.h> +#include <signal.h> +#include <stdlib.h> +#include <string.h> +#include <sys/time.h> +#include <sys/timerfd.h> +#include <ucontext.h> +#include <unistd.h> +#include <valgrind/valgrind.h> + +typedef struct thread_local { + ucontext_t uc[3]; + size_t nrsw; + int tfd; +} thread_local_t; + +static void f(void *data, int n) +{ + enum { NR_SWITCHES = 200000 }; + struct pollfd pfd; + thread_local_t *tlocal = data; + + while (1) { + memset(&pfd, 0, sizeof(pfd)); + pfd.fd = tlocal->tfd; + pfd.events = POLLIN; + + if (poll(&pfd, 1, 0) == 1) { + if (++tlocal->nrsw == NR_SWITCHES) + return; + swapcontext(&tlocal->uc[n], &tlocal->uc[3 - n]); + } + } +} + +void __valgrind_register_current_stack(void) +{ + pthread_attr_t attr; + size_t stacksize; + void *stack; + + if (pthread_getattr_np(pthread_self(), &attr) != 0) + abort(); + + if (pthread_attr_getstack(&attr, &stack, &stacksize) != 0) + abort(); + + VALGRIND_STACK_REGISTER(stack, stack + stacksize); +} + +#define STACKSIZE 8192 + +void *worker(void *data) +{ + thread_local_t *tlocal = data; + struct itimerspec it; + + __valgrind_register_current_stack(); + + tlocal->tfd = timerfd_create(CLOCK_REALTIME, 0); + if (tlocal->tfd < 0) + abort(); + + it.it_interval.tv_sec = 0; + it.it_interval.tv_nsec = 1000; + + it.it_value.tv_sec = time(NULL); + it.it_value.tv_nsec = 1000; + + if (timerfd_settime(tlocal->tfd, TFD_TIMER_ABSTIME, &it, NULL) < 0) + abort(); + + if (getcontext(&(tlocal->uc[1])) < 0) + abort(); + if (getcontext(&(tlocal->uc[2])) < 0) + abort(); + + tlocal->uc[1].uc_link = &tlocal->uc[0]; + tlocal->uc[1].uc_stack.ss_sp = malloc(STACKSIZE); + tlocal->uc[1].uc_stack.ss_size = STACKSIZE; + makecontext(&tlocal->uc[1], (void (*)(void))f, 2, tlocal, 1); + VALGRIND_STACK_REGISTER(tlocal->uc[1].uc_stack.ss_sp, + tlocal->uc[1].uc_stack.ss_sp + + tlocal->uc[1].uc_stack.ss_size); + + tlocal->uc[2].uc_link = &tlocal->uc[0]; + tlocal->uc[2].uc_stack.ss_sp = malloc(STACKSIZE); + tlocal->uc[2].uc_stack.ss_size = STACKSIZE; + makecontext(&tlocal->uc[2], (void (*)(void))f, 2, tlocal, 2); + VALGRIND_STACK_REGISTER(tlocal->uc[2].uc_stack.ss_sp, + tlocal->uc[2].uc_stack.ss_sp + + tlocal->uc[2].uc_stack.ss_size); + + swapcontext(&tlocal->uc[0], &tlocal->uc[1]); + return NULL; +} + +int main(int argc, char *argv[]) +{ + enum { NR = 32 }; + thread_local_t tlocal[NR]; + pthread_t thread[NR]; + int i; + + memset(tlocal, 0, sizeof(tlocal)); + + for (i = 0; i < NR; i++) + pthread_create(&thread[i], NULL, worker, &tlocal[i]); + + // Wait until the threads have been created. + sleep(1); + for (i = 0; i < NR; i++) + pthread_kill(thread[i], SIGINT); + + for (i = 0; i < NR; i++) + pthread_join(thread[i], NULL); + + return 0; +} diff --git a/drd/tests/swapcontext.stderr.exp b/drd/tests/swapcontext.stderr.exp new file mode 100644 index 0000000000..1ebc73a407 --- /dev/null +++ b/drd/tests/swapcontext.stderr.exp @@ -0,0 +1,7 @@ + + +Process terminating with default action of signal 2 (SIGINT) + at 0x........: swapcontext (in /...libc...) + by 0x........: f (swapcontext.c:?) + +ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) diff --git a/drd/tests/swapcontext.vgtest b/drd/tests/swapcontext.vgtest new file mode 100644 index 0000000000..98e3712c40 --- /dev/null +++ b/drd/tests/swapcontext.vgtest @@ -0,0 +1,4 @@ +prereq: test -e swapcontext && ./supported_libpthread +vgopts: --read-var-info=yes --check-stack-var=yes --show-confl-seg=no --num-callers=2 +prog: swapcontext +stderr_filter: filter_stderr |
|
From: Bart V. A. <bva...@so...> - 2021-02-20 16:45:46
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=fd5a12afcb126d3be18f78a6f17d49847e202742 commit fd5a12afcb126d3be18f78a6f17d49847e202742 Author: Bart Van Assche <bva...@ac...> Date: Fri Feb 19 20:24:57 2021 -0800 drd: Process stack registration client requests Reset stack information if the client registers a new stack Diff: --- NEWS | 1 + drd/drd_main.c | 8 ++++++++ drd/drd_thread.c | 11 +++++++++++ drd/drd_thread.h | 1 + 4 files changed, 21 insertions(+) diff --git a/NEWS b/NEWS index c910af0f4e..cdd103b01e 100644 --- a/NEWS +++ b/NEWS @@ -120,6 +120,7 @@ where XXXXXX is the bug number as listed below. 431556 Complete arm64 FADDP v8.2 instruction support 432102 Add support for DWARF5 as produced by GCC11 432161 Addition of arm64 v8.2 FADDP, FNEG and FSQRT +432381 drd: Process STACK_REGISTER client requests 432672 vg_regtest: test-specific environment variables not reset between tests 432809 VEX should support REX.W + POPF 432861 PPC modsw and modsd give incorrect results for 1 mod 12 diff --git a/drd/drd_main.c b/drd/drd_main.c index 7873c1f977..2f2279e52d 100644 --- a/drd/drd_main.c +++ b/drd/drd_main.c @@ -629,6 +629,13 @@ static void drd_stop_using_mem_stack_signal(Addr a, SizeT len) True); } +static void drd_register_stack(Addr start, Addr end) +{ + DrdThreadId drd_tid = DRD_(thread_get_running_tid)(); + + DRD_(thread_register_stack)(drd_tid, start, end); +} + static void drd_pre_thread_create(const ThreadId creator, const ThreadId created) { @@ -852,6 +859,7 @@ void drd_pre_clo_init(void) VG_(track_die_mem_munmap) (drd_stop_using_nonstack_mem); VG_(track_die_mem_stack) (drd_stop_using_mem_stack); VG_(track_die_mem_stack_signal) (drd_stop_using_mem_stack_signal); + VG_(track_register_stack) (drd_register_stack); VG_(track_pre_deliver_signal) (drd_pre_deliver_signal); VG_(track_post_deliver_signal) (drd_post_deliver_signal); VG_(track_start_client_code) (drd_start_client_code); diff --git a/drd/drd_thread.c b/drd/drd_thread.c index 548c74843b..32064c3b15 100644 --- a/drd/drd_thread.c +++ b/drd/drd_thread.c @@ -431,6 +431,17 @@ void DRD_(thread_post_join)(DrdThreadId drd_joiner, DrdThreadId drd_joinee) DRD_(thread_delayed_delete)(drd_joinee); } +void DRD_(thread_register_stack)(DrdThreadId tid, Addr addr1, Addr addr2) +{ + tl_assert(0 <= (int)tid && tid < DRD_N_THREADS + && tid != DRD_INVALID_THREADID); + tl_assert(addr1 < addr2); + DRD_(g_threadinfo)[tid].stack_min = addr2; + DRD_(g_threadinfo)[tid].stack_min_min = addr2; + DRD_(g_threadinfo)[tid].stack_startup = addr2; + DRD_(g_threadinfo)[tid].stack_max = addr2; +} + /** * NPTL hack: NPTL allocates the 'struct pthread' on top of the stack, * and accesses this data structure from multiple threads without locking. diff --git a/drd/drd_thread.h b/drd/drd_thread.h index 063ae35fc9..0f7d783733 100644 --- a/drd/drd_thread.h +++ b/drd/drd_thread.h @@ -153,6 +153,7 @@ void DRD_(thread_delete)(const DrdThreadId tid, Bool detached); void DRD_(thread_finished)(const DrdThreadId tid); void DRD_(drd_thread_atfork_child)(const DrdThreadId tid); void DRD_(thread_pre_cancel)(const DrdThreadId tid); +void DRD_(thread_register_stack)(DrdThreadId tid, Addr addr1, Addr addr2); void DRD_(thread_set_stack_startup)(const DrdThreadId tid, const Addr stack_startup); Addr DRD_(thread_get_stack_min)(const DrdThreadId tid); |
|
From: Bart V. A. <bva...@so...> - 2021-02-20 16:45:29
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=dc29ef72df49d88fa1c0866d362803f920a6e2d5 commit dc29ef72df49d88fa1c0866d362803f920a6e2d5 Author: Bart Van Assche <bva...@ac...> Date: Sun Feb 14 20:08:52 2021 -0800 core: Pass stack change user requests on to tools Since DRD tracks the lowest and highest stack address that has been used, it needs to know about stack registration events. Hence pass on stack registration events to tools. Diff: --- coregrind/m_scheduler/scheduler.c | 1 + coregrind/m_tooliface.c | 2 ++ coregrind/pub_core_tooliface.h | 2 ++ include/pub_tool_tooliface.h | 3 +++ 4 files changed, 8 insertions(+) diff --git a/coregrind/m_scheduler/scheduler.c b/coregrind/m_scheduler/scheduler.c index 77f78ebbc7..dc22dca176 100644 --- a/coregrind/m_scheduler/scheduler.c +++ b/coregrind/m_scheduler/scheduler.c @@ -2050,6 +2050,7 @@ void do_client_request ( ThreadId tid ) case VG_USERREQ__STACK_REGISTER: { UWord sid = VG_(register_stack)((Addr)arg[1], (Addr)arg[2]); SET_CLREQ_RETVAL( tid, sid ); + VG_TRACK(register_stack, (Addr)arg[1], (Addr)arg[2]); break; } case VG_USERREQ__STACK_DEREGISTER: { diff --git a/coregrind/m_tooliface.c b/coregrind/m_tooliface.c index efa991debf..cbafe47c52 100644 --- a/coregrind/m_tooliface.c +++ b/coregrind/m_tooliface.c @@ -438,6 +438,8 @@ DEF0(track_die_mem_stack, Addr, SizeT) DEF0(track_ban_mem_stack, Addr, SizeT) +DEF0(track_register_stack, Addr, Addr) + DEF0(track_pre_mem_read, CorePart, ThreadId, const HChar*, Addr, SizeT) DEF0(track_pre_mem_read_asciiz, CorePart, ThreadId, const HChar*, Addr) DEF0(track_pre_mem_write, CorePart, ThreadId, const HChar*, Addr, SizeT) diff --git a/coregrind/pub_core_tooliface.h b/coregrind/pub_core_tooliface.h index 4da8cd29e9..5f75d49972 100644 --- a/coregrind/pub_core_tooliface.h +++ b/coregrind/pub_core_tooliface.h @@ -226,6 +226,8 @@ typedef struct { void (*track_ban_mem_stack)(Addr, SizeT); + void (*track_register_stack)(Addr, Addr); + void (*track_pre_mem_read) (CorePart, ThreadId, const HChar*, Addr, SizeT); void (*track_pre_mem_read_asciiz)(CorePart, ThreadId, const HChar*, Addr); void (*track_pre_mem_write) (CorePart, ThreadId, const HChar*, Addr, SizeT); diff --git a/include/pub_tool_tooliface.h b/include/pub_tool_tooliface.h index c7eef06eb1..62c9969612 100644 --- a/include/pub_tool_tooliface.h +++ b/include/pub_tool_tooliface.h @@ -609,6 +609,9 @@ void VG_(track_die_mem_stack) (void(*f)(Addr a, SizeT len)); /* Used for redzone at end of thread stacks */ void VG_(track_ban_mem_stack) (void(*f)(Addr a, SizeT len)); +/* Used to report VG_USERREQ__STACK_REGISTER client requests */ +void VG_(track_register_stack) (void(*f)(Addr start, Addr end)); + /* These ones occur around syscalls, signal handling, etc */ void VG_(track_pre_mem_read) (void(*f)(CorePart part, ThreadId tid, const HChar* s, Addr a, SizeT size)); |
|
From: Mark W. <ma...@so...> - 2021-02-20 16:00:18
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=84c7df99173ca9589daea551557e4a107bbbde1c commit 84c7df99173ca9589daea551557e4a107bbbde1c Author: Mark Wielaard <ma...@kl...> Date: Sat Feb 20 16:56:33 2021 +0100 Update NEWS with some core and platform (s390) changes and bug fixes. Mention the new DWARF version 5 support needed with GCC 11. s390 now supports z14 vector instructions. Add missing bugs fixed and sort them by bug number (n-i-bz last). Pull in 3.16.1 release data. Diff: --- NEWS | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 51 insertions(+), 14 deletions(-) diff --git a/NEWS b/NEWS index 69856917f6..c910af0f4e 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,29 @@ support for X86/macOS 10.13, AMD64/macOS 10.13 and nanoMIPS/Linux. * ==================== CORE CHANGES =================== +* DWARF version 5 support + + - Valgrind can now read DWARF version 5 debuginfo as produced by GCC 11 + +* ================== PLATFORM CHANGES ================= + +* s390: + + - Implement the new instructions/features that were added to + z/Architecture with the vector-enhancements facility 1. Also + cover the instructions from the vector-packed-decimal facility + that are defined outside the chapter "Vector Decimal + Instructions", but not the ones from that chapter itself. + + For a detailed list of newly supported instructions see the + updates to `docs/internals/s390-opcodes.csv'. + + Since the miscellaneous instruction extensions facility 2 was + already added in Valgrind 3.16.0, this completes the support + necessary to run general programs built with `--march=z14' under + Valgrind. The vector-packed-decimal facility is currently not + exploited by the standard toolchain and libraries. + * ==================== TOOL CHANGES ==================== * DHAT: @@ -56,50 +79,64 @@ where XXXXXX is the bug number as listed below. 217695 malloc/calloc/realloc/memalign failure doesn't set errno to ENOMEM 345077 linux syscall execveat support (linux 3.19) 369029 handle linux syscalls sched_getattr and sched_setattr -n-i-bz helgrind: If hg_cli__realloc fails, return NULL. - 384729 __libc_freeres inhibits cross-platform valgrind +391853 Makefile.all.am:L247 and @SOLARIS_UNDEF_LARGESOURCE@ being empty 397605 ioctl FICLONE mishandled 408663 Suppression file for musl libc 404076 s390x: z14 vector instructions not implemented 410743 shmat() calls for 32-bit programs fail when running in 64-bit valgrind (actually affected all x86 and nanomips regardless of host bitness) +413547 regression test does not check for Arm 64 features. +414268 Enable AArch64 feature detection and decoding for v8.x instructions 415293 Incorrect call-graph tracking due to new _dl_runtime_resolve_xsave* 422174 unhandled instruction bytes: 0x48 0xE9 (REX prefixed JMP instruction) 422261 platform selection fails for unqualified client name 422623 epoll_ctl warns for uninitialized padding on non-amd64 64bit arches 423021 PPC: Add missing ISA 3.0 documentation link and HWCAPS test. -424298 amd64: Implement RDSEED -426144 Fix "condition variable has not been initialized" on Fedora 33. 423195 PPC ISA 3.1 support is missing, part 1 423361 Adds io_uring support on arm64/aarch64 (and all other arches) +424012 crash with readv/writev having invalid but not NULL arg2 iovec +424298 amd64: Implement RDSEED 425232 PPC ISA 3.1 support is missing, part 2 +425820 Failure to recognize vpcmpeqq as a dependency breaking idiom. +426014 arm64: implement fmadd and fmsub as Iop_MAdd/Sub 426123 PPC ISA 3.1 support is missing, part 3 -427787 Support new faccessat2 linux syscall (439) -428035 drd: Unbreak the musl build -428648 s390_emit_load_mem panics due to 20-bit offset for vector load +426144 Fix "condition variable has not been initialized" on Fedora 33. 427400 PPC ISA 3.1 support is missing, part 4 427401 PPC ISA 3.1 support is missing, part 5 -427870 lmw, lswi and related PowerPC insns aren't allowed on ppc64le 427404 PPC ISA 3.1 support is missing, part 6 -429692 unhandled ppc64le-linux syscall: 147 (getsid) +427870 lmw, lswi and related PowerPC insns aren't allowed on ppc64le +427787 Support new faccessat2 linux syscall (439) +428035 drd: Unbreak the musl build +428648 s390_emit_load_mem panics due to 20-bit offset for vector load +428716 cppcheck detects potential leak in VEX/useful/smchash.c 428909 helgrind: need to intercept duplicate libc definitions for Fedora 33 +429692 unhandled ppc64le-linux syscall: 147 (getsid) 429864 s390x: C++ atomic test_and_set yields false-positive memcheck diagnostics +429952 Errors when building regtest with clang 430354 ppc stxsibx and stxsihx instructions write too much data 430485 expr_is_guardable doesn't handle Iex_Qop +431556 Complete arm64 FADDP v8.2 instruction support +432102 Add support for DWARF5 as produced by GCC11 +432161 Addition of arm64 v8.2 FADDP, FNEG and FSQRT 432672 vg_regtest: test-specific environment variables not reset between tests 432809 VEX should support REX.W + POPF 432861 PPC modsw and modsd give incorrect results for 1 mod 12 +n-i-bz helgrind: If hg_cli__realloc fails, return NULL. -Release 3.16.1 (?? June 2020) + + +Release 3.16.1 (22 June 2020) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -3.16.1 is identical to 3.16.0, except that it fixes the following bug that -was discovered late in the 3.16.0 release process: +3.16.1 fixes two critical bugs discovered after 3.16.0 was frozen. It also +fixes character encoding problems in the documentation HTML. + +422677 PPC sync instruction L field should only be 2 bits in ISA 3.0 +422715 32-bit x86: vex: the `impossible' happened: expr_is_guardable: unhandled expr -422715 valgrind 3.16.0 on 32-bit x86: vex: the `impossible' happened: - expr_is_guardable: unhandled expr +(3.16.1, 22 June 2020, 36d6727e1d768333a536f274491e5879cab2c2f7) |
|
From: Mark W. <ma...@so...> - 2021-02-20 15:18:18
|
The unsigned tag 'VALGRIND_3_16_1' was created pointing to:
24f63fd435... -> 3.16.1
Tagger: Mark Wielaard <ma...@kl...>
Date: Sat Feb 20 16:16:49 2021 +0100
valgrind 3.16.1 final release
|
|
From: Mark W. <ma...@so...> - 2021-02-20 15:17:57
|
The unsigned tag 'VALGRIND_3_16_0' was created pointing to:
108b4a0880... -> 3.16.0 final
Tagger: Mark Wielaard <ma...@kl...>
Date: Sat Feb 20 16:17:13 2021 +0100
valgrind 3.16.0 final release
|