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
(2) |
2
|
|
3
(5) |
4
(1) |
5
(2) |
6
(1) |
7
(2) |
8
|
9
|
|
10
|
11
|
12
|
13
|
14
|
15
(1) |
16
|
|
17
|
18
|
19
|
20
|
21
|
22
|
23
|
|
24
|
25
|
26
|
27
(1) |
28
|
29
|
30
|
|
31
|
|
|
|
|
|
|
|
From: Paul F. <pa...@so...> - 2022-07-03 19:36:20
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=5d058e63324d16748fb9d6cae682f17f7f6095cc commit 5d058e63324d16748fb9d6cae682f17f7f6095cc Author: Paul Floyd <pj...@wa...> Date: Sun Jul 3 21:28:57 2022 +0200 Backout synthesizing AT_BSDFLAGS auxv entry This was causing a crash on several FreeBSD 13.1 testcases (but not 13.0). Probably related to "sig fastblock". Diff: --- coregrind/m_initimg/initimg-freebsd.c | 4 +++- none/tests/freebsd/auxv.stderr.exp-freebsd13 | 2 +- none/tests/freebsd/auxv.stderr.exp-freebsd131 | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/coregrind/m_initimg/initimg-freebsd.c b/coregrind/m_initimg/initimg-freebsd.c index d77ce3c28e..f315a147ff 100644 --- a/coregrind/m_initimg/initimg-freebsd.c +++ b/coregrind/m_initimg/initimg-freebsd.c @@ -685,7 +685,9 @@ Addr setup_client_stack( void* init_sp, #endif #if (FREEBSD_VERS >= FREEBSD_13_0) - case AT_BSDFLAGS: + /* @todo PJF BSDFLAGS causes serveral testcases to crash. + Not sure why, it seems to be used for sigfastblock */ + // case AT_BSDFLAGS: case AT_ARGC: case AT_ENVC: break; diff --git a/none/tests/freebsd/auxv.stderr.exp-freebsd13 b/none/tests/freebsd/auxv.stderr.exp-freebsd13 index 9248b17a58..b4a0a68601 100644 --- a/none/tests/freebsd/auxv.stderr.exp-freebsd13 +++ b/none/tests/freebsd/auxv.stderr.exp-freebsd13 @@ -15,7 +15,7 @@ val: AT_PAGESIZES int: 20 ptr: 0x........ val: AT_PAGESIZESLEN int: 21 ptr: 0x........ val: AT_IGNORE int: 01 ptr: 0x........ val: AT_STACKPROT int: 23 ptr: 0x........ -val: AT_BSDFLAGS int: 27 ptr: 0x........ +val: AT_IGNORE int: 01 ptr: 0x........ val: AT_ARGC int: 28 ptr: 0x........ val: AT_ARGV int: 29 ptr: 0x........ val: AT_ENVC int: 30 ptr: 0x........ diff --git a/none/tests/freebsd/auxv.stderr.exp-freebsd131 b/none/tests/freebsd/auxv.stderr.exp-freebsd131 index af70ce3160..2dd0b3c2df 100644 --- a/none/tests/freebsd/auxv.stderr.exp-freebsd131 +++ b/none/tests/freebsd/auxv.stderr.exp-freebsd131 @@ -15,7 +15,7 @@ val: AT_PAGESIZES int: 20 ptr: 0x........ val: AT_PAGESIZESLEN int: 21 ptr: 0x........ val: AT_IGNORE int: 01 ptr: 0x........ val: AT_STACKPROT int: 23 ptr: 0x........ -val: AT_BSDFLAGS int: 27 ptr: 0x........ +val: AT_IGNORE int: 01 ptr: 0x........ val: AT_ARGC int: 28 ptr: 0x........ val: AT_ARGV int: 29 ptr: 0x........ val: AT_ENVC int: 30 ptr: 0x........ |
|
From: Paul F. <pa...@so...> - 2022-07-03 14:26:08
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=db0bfcc6a50e56e2f1f82ea3ccb20fefb936db4b commit db0bfcc6a50e56e2f1f82ea3ccb20fefb936db4b Author: Paul Floyd <pj...@wa...> Date: Sun Jul 3 16:25:10 2022 +0200 Fix a couple of compiler warnings because of some missed size_t -> SizeT changes. Diff: --- coregrind/m_syswrap/syswrap-freebsd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/coregrind/m_syswrap/syswrap-freebsd.c b/coregrind/m_syswrap/syswrap-freebsd.c index b963f56763..375057fecb 100644 --- a/coregrind/m_syswrap/syswrap-freebsd.c +++ b/coregrind/m_syswrap/syswrap-freebsd.c @@ -2034,7 +2034,7 @@ PRE(sys___sysctl) if (SARG2 >= 2 && ML_(safe_to_deref)(name, 2*sizeof(int))) { if (name[0] == 1 && name[1] == 33) { // kern.userstack - sysctl_kern_usrstack((size_t*)ARG3, (size_t*)ARG4); + sysctl_kern_usrstack((SizeT*)ARG3, (SizeT*)ARG4); SET_STATUS_Success(0); } } @@ -6289,7 +6289,7 @@ PRE(sys___sysctlbyname) if (ML_(safe_to_deref)(name, sizeof("kern.usrstack")) && VG_(strcmp)(name, "kern.usrstack") == 0) { - sysctl_kern_usrstack((size_t*)ARG3, (size_t*)ARG4); + sysctl_kern_usrstack((SizeT*)ARG3, (SizeT*)ARG4); SET_STATUS_Success(0); } |
|
From: Paul F. <pa...@so...> - 2022-07-03 13:14:55
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=b29a1e1cf5f36a347275bcc4f6135705e4dedba9 commit b29a1e1cf5f36a347275bcc4f6135705e4dedba9 Author: Paul Floyd <pj...@wa...> Date: Sun Jul 3 13:58:18 2022 +0200 Improve FreeBSD sysctl kern.usrstack This was handled by sysctl but not sysctlbyname. The value returned was wrong. Added a regtest. Diff: --- .gitignore | 1 + coregrind/m_main.c | 2 +- coregrind/m_syswrap/syswrap-freebsd.c | 20 +++++++++++----- none/tests/freebsd/Makefile.am | 7 ++++-- none/tests/freebsd/usrstack.c | 43 ++++++++++++++++++++++++++++++++++ none/tests/freebsd/usrstack.stderr.exp | 0 none/tests/freebsd/usrstack.stdout.exp | 2 ++ none/tests/freebsd/usrstack.vgtest | 3 +++ 8 files changed, 69 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index b749c130c9..d816acf815 100644 --- a/.gitignore +++ b/.gitignore @@ -2083,6 +2083,7 @@ /none/tests/freebsd/fexecve /none/tests/freebsd/hello_world /none/tests/freebsd/452275 +/none/tests/freebsd/usrstack # /none/tests/x86/ /none/tests/x86/*.dSYM diff --git a/coregrind/m_main.c b/coregrind/m_main.c index d0fbc0c56c..f12ba01b5f 100644 --- a/coregrind/m_main.c +++ b/coregrind/m_main.c @@ -3897,7 +3897,7 @@ UWord voucher_mach_msg_set ( UWord arg1 ) Word VG_(get_usrstack)(void) { - return VG_PGROUNDDN(the_iicii.clstack_end - the_iifii.clstack_max_size); + return VG_PGROUNDDN(the_iicii.clstack_end) + VKI_PAGE_SIZE; } diff --git a/coregrind/m_syswrap/syswrap-freebsd.c b/coregrind/m_syswrap/syswrap-freebsd.c index aeb2a1cd62..b963f56763 100644 --- a/coregrind/m_syswrap/syswrap-freebsd.c +++ b/coregrind/m_syswrap/syswrap-freebsd.c @@ -1960,6 +1960,12 @@ static Bool sysctl_kern_ps_strings(SizeT* out, SizeT* outlen) return False; } +static void sysctl_kern_usrstack(SizeT* out, SizeT* outlen) +{ + *out = VG_(get_usrstack)(); + *outlen = sizeof(ULong); +} + // SYS___sysctl 202 /* int __sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, size_t newlen); */ /* ARG1 ARG2 ARG3 ARG4 ARG5 ARG6 */ @@ -2028,11 +2034,7 @@ PRE(sys___sysctl) if (SARG2 >= 2 && ML_(safe_to_deref)(name, 2*sizeof(int))) { if (name[0] == 1 && name[1] == 33) { // kern.userstack - Word tmp = VG_(get_usrstack)(); - size_t* out = (size_t*)ARG3; - size_t* outlen = (size_t*)ARG4; - *out = tmp; - *outlen = sizeof(ULong); + sysctl_kern_usrstack((size_t*)ARG3, (size_t*)ARG4); SET_STATUS_Success(0); } } @@ -6281,10 +6283,16 @@ PRE(sys___sysctlbyname) if (ML_(safe_to_deref)(name, sizeof("kern.ps_strings")) && VG_(strcmp)(name, "kern.ps_strings") == 0) { if (sysctl_kern_ps_strings((SizeT*)ARG3, (SizeT*)ARG4)) { - SET_STATUS_Success(0); + SET_STATUS_Success(0); } } + if (ML_(safe_to_deref)(name, sizeof("kern.usrstack")) && + VG_(strcmp)(name, "kern.usrstack") == 0) { + sysctl_kern_usrstack((size_t*)ARG3, (size_t*)ARG4); + SET_STATUS_Success(0); + } + // read number of ints specified in ARG2 from mem pointed to by ARG1 PRE_MEM_READ("__sysctlbyname(name)", (Addr)ARG1, ARG2 * sizeof(int)); diff --git a/none/tests/freebsd/Makefile.am b/none/tests/freebsd/Makefile.am index 4a29928238..f1f8a5628b 100644 --- a/none/tests/freebsd/Makefile.am +++ b/none/tests/freebsd/Makefile.am @@ -30,10 +30,13 @@ EXTRA_DIST = \ fexecve_txt.vgtest \ fexecve_txt.stderr.exp \ 452275.vgtest \ - 452275.stderr.exp + 452275.stderr.exp \ + usrstack.vgtest \ + usrstack.stderr.exp \ + usrstack.stdout.exp check_PROGRAMS = \ - auxv osrel swapcontext hello_world fexecve 452275 + auxv osrel swapcontext hello_world fexecve 452275 usrstack AM_CFLAGS += $(AM_FLAG_M3264_PRI) AM_CXXFLAGS += $(AM_FLAG_M3264_PRI) diff --git a/none/tests/freebsd/usrstack.c b/none/tests/freebsd/usrstack.c new file mode 100644 index 0000000000..4f3d69225a --- /dev/null +++ b/none/tests/freebsd/usrstack.c @@ -0,0 +1,43 @@ +#include <sys/types.h> +#include <sys/sysctl.h> +#include <unistd.h> +#include <stdarg.h> +#include <stdlib.h> +#include <stdio.h> + +int main(void) +{ + int stack_variable = 1; + unsigned long v1; + unsigned long v2; + int name[] = {CTL_KERN, KERN_USRSTACK}; + size_t len = sizeof(unsigned long); + + if (sysctlbyname("kern.usrstack", &v1, &len, NULL, 0) < 0) { + perror("sysctlbyname failed:"); + exit(-1); + } + + if (sysctl(name, 2, &v2, &len, NULL, 0) < 0) { + perror("sysctl failed:"); + exit(-1); + } + + if (v1 == v2) { + printf("OK 1\n"); + } else { + printf("FAIL usrstack different\n"); + printf("v1 %lx v2 %lx\n", v1, v2); + } + + + /* the purpose of this is to check that the sysctl isn't + returning the host stack. I expec the difference to be less than 0x1000 */ + if (v1 - (unsigned long)&stack_variable > 0x2000U) { + printf("FAIL usrstack fishy\n"); + printf("v1 %lx stack_variable %p diff %lx\n", v1, &stack_variable, v1 - (unsigned long)&stack_variable); + } else { + printf("OK 2\n"); + } +} + diff --git a/none/tests/freebsd/usrstack.stderr.exp b/none/tests/freebsd/usrstack.stderr.exp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/none/tests/freebsd/usrstack.stdout.exp b/none/tests/freebsd/usrstack.stdout.exp new file mode 100644 index 0000000000..58ff19a75f --- /dev/null +++ b/none/tests/freebsd/usrstack.stdout.exp @@ -0,0 +1,2 @@ +OK 1 +OK 2 diff --git a/none/tests/freebsd/usrstack.vgtest b/none/tests/freebsd/usrstack.vgtest new file mode 100644 index 0000000000..fd256549e4 --- /dev/null +++ b/none/tests/freebsd/usrstack.vgtest @@ -0,0 +1,3 @@ +prog: usrstack +vgopts: -q + |
|
From: Paul F. <pa...@so...> - 2022-07-03 11:18:58
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=9f27d8fbc733165d7b1afbc86f1b3cdcd3837cd1 commit 9f27d8fbc733165d7b1afbc86f1b3cdcd3837cd1 Author: Paul Floyd <pj...@wa...> Date: Sun Jul 3 13:05:54 2022 +0200 Bug-456171 [PATCH] FreeBSD: Don't record address errors when accessing the 'kern.ps_strings' sysctl struct There is quite a lot of stuff here. The problem is that setproctitle and kern.ps_strings were using the Valgrind host auxv rather than the guest. The proposed patch would have just ignored those memory ranges. I've gone a fair bit further than that 1. refactored the initimg code for building the client auxv. Previously we were simply ignoring any non-scalar entries. Now we copy most of thse as well. That means that 'strtab' built on the client stack no longet only contains strings, at can also now contain binary structures. Note I was a bit concerned that there may be some alignment issues, but I haven't seen any problems so far. 2. Added intercepts to sysctl and sysctlbyname for kern.ps_strings, then find AT_PS_STRINGS from the client auxv that is now usable from step 1. 3. Some refactoring of sysctl and sysctlbyname syscall wrappers. More to do there! 4. Added a setproctitle testcase (that also tests the sysctls). 5. Updated the auxv testcase now that more AT_* entries are handled. Diff: --- .gitignore | 1 + NEWS | 1 + coregrind/m_initimg/initimg-freebsd.c | 194 +++++++++++++------------ coregrind/m_syswrap/priv_syswrap-freebsd.h | 2 +- coregrind/m_syswrap/syswrap-freebsd.c | 51 ++++++- coregrind/m_ume/elf.c | 1 + coregrind/pub_core_libcproc.h | 9 ++ include/vki/vki-amd64-freebsd.h | 25 ++++ include/vki/vki-freebsd.h | 17 +++ include/vki/vki-x86-freebsd.h | 30 ++++ memcheck/tests/freebsd/Makefile.am | 8 +- memcheck/tests/freebsd/scalar.stderr.exp | 2 +- memcheck/tests/freebsd/scalar.stderr.exp-x86 | 2 +- memcheck/tests/freebsd/setproctitle.c | 48 ++++++ memcheck/tests/freebsd/setproctitle.stderr.exp | 0 memcheck/tests/freebsd/setproctitle.stdout.exp | 1 + memcheck/tests/freebsd/setproctitle.vgtest | 2 + none/tests/freebsd/auxv.stderr.exp | 10 +- none/tests/freebsd/auxv.stderr.exp-freebsd13 | 16 +- none/tests/freebsd/auxv.stderr.exp-freebsd131 | 16 +- 20 files changed, 314 insertions(+), 122 deletions(-) diff --git a/.gitignore b/.gitignore index 8accdba2b7..b749c130c9 100644 --- a/.gitignore +++ b/.gitignore @@ -1347,6 +1347,7 @@ /memcheck/tests/freebsd/scalar_13_plus /memcheck/tests/freebsd/452275 /memcheck/tests/freebsd/errno_aligned_allocs +/memcheck/tests/freebsd/setproctitle # /memcheck/tests/amd64-freebsd /memcheck/tests/amd64-freebsd/*.stderr.diff diff --git a/NEWS b/NEWS index eb098b1d07..13b576e873 100644 --- a/NEWS +++ b/NEWS @@ -42,6 +42,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. 453055 shared_timed_mutex drd test fails with "Lock shared failed" message 453602 Missing command line option to enable/disable debuginfod 452802 Handle lld 9+ split RW PT_LOAD segments correctly +456171 [PATCH] FreeBSD: Don't record address errors when accessing the 'kern.ps_strings' sysctl struct n-i-bz Implement vgdb invoker on FreeBSD To see details of a given bug, visit diff --git a/coregrind/m_initimg/initimg-freebsd.c b/coregrind/m_initimg/initimg-freebsd.c index fcf05c86ac..d77ce3c28e 100644 --- a/coregrind/m_initimg/initimg-freebsd.c +++ b/coregrind/m_initimg/initimg-freebsd.c @@ -298,6 +298,19 @@ static HChar *copy_str(HChar **tab, const HChar *str) return orig; } +/* Add byte onto the string table, and return its address */ +static HChar *copy_bytes(HChar **tab, const HChar *src, SizeT size) +{ + HChar *cp = *tab; + /*VG_ROUNDUP(cp, sizeof(Word));*/ + HChar *orig = cp; + + VG_(memcpy)(cp, src, size); + + *tab = cp+size; + + return orig; +} /* ---------------------------------------------------------------- @@ -308,25 +321,25 @@ static HChar *copy_str(HChar **tab, const HChar *str) higher address +-----------------+ <- clstack_end | | - : string table : - | | - +-----------------+ - | AT_NULL | - - - - | auxv | - +-----------------+ - | NULL | - - - - | envp | - +-----------------+ - | NULL | - - - - | argv | - +-----------------+ - | argc | + : string table : + | | + +-----------------+ + | AT_NULL | + - - + | auxv | + +-----------------+ + | NULL | + - - + | envp | + +-----------------+ + | NULL | + - - + | argv | + +-----------------+ + | argc | lower address +-----------------+ <- sp | undefined | - : : + : : Allocate and create the initial client stack. It is allocated down from clstack_end, which was previously determined by the address @@ -336,14 +349,6 @@ static HChar *copy_str(HChar **tab, const HChar *str) ---------------------------------------------------------------- */ -struct auxv { - Word a_type; - union { - void *a_ptr; - Word a_val; - } u; -}; - static struct auxv *find_auxv(UWord* sp) { @@ -385,6 +390,7 @@ Addr setup_client_stack( void* init_sp, Addr clstack_start; Int i; Bool have_exename; + Word client_argv; vg_assert(VG_IS_PAGE_ALIGNED(clstack_end+1)); vg_assert( VG_(args_for_client) ); @@ -428,10 +434,45 @@ Addr setup_client_stack( void* init_sp, stringsize += VG_(strlen)(*cpp) + 1; } + Int canarylen = -1; + Int pagesizeslen = -1; + /* now, how big is the auxv? */ auxsize = sizeof(*auxv); /* there's always at least one entry: AT_NULL */ for (cauxv = orig_auxv; cauxv->a_type != AT_NULL; cauxv++) { auxsize += sizeof(*cauxv); + switch(cauxv->a_type) { + case AT_EXECPATH: + stringsize += VG_(strlen)(cauxv->u.a_ptr) + 1; + break; + case AT_CANARYLEN: + canarylen = cauxv->u.a_val; + /*VG_ROUNDUP(stringsize, sizeof(Word));*/ + stringsize += canarylen; + break; + case AT_PAGESIZESLEN: + pagesizeslen = cauxv->u.a_val; + /*VG_ROUNDUP(stringsize, sizeof(Word));*/ + stringsize += pagesizeslen; + break; +#if 0 + case AT_TIMEKEEP: + /*VG_ROUNDUP(stringsize, sizeof(Word));*/ + stringsize += sizeof(struct vki_vdso_timehands); + break; +#endif +#if (FREEBSD_VERS >= FREEBSD_13_0) + case AT_PS_STRINGS: + stringsize += sizeof(struct vki_ps_strings); + break; +#endif +#if (FREEBSD_VERS >= FREEBSD_13_1) + // case AT_FXRNG: + // case AT_KPRELOAD: +#endif + default: + break; + } } /* OK, now we know how big the client stack is */ @@ -553,6 +594,7 @@ Addr setup_client_stack( void* init_sp, *ptr++ = argc + (have_exename ? 1 : 0); /* --- client argv --- */ + client_argv = (Word)ptr; if (info->interp_name) *ptr++ = (Addr)copy_str(&strtab, info->interp_name); if (info->interp_args) @@ -578,50 +620,7 @@ Addr setup_client_stack( void* init_sp, /* --- auxv --- */ auxv = (struct auxv *)ptr; *client_auxv = (UInt *)auxv; -#if defined(VGP_x86_freebsd) && (VGO_freebsd <= FREEBSD_13_0) - int* pagesizes = NULL; -#endif - - /* - * The PAGESIZES hack - PJF - * - * Normally a standalone application has a full auxv which, among - * many other things contains a vector of integers (PAGESIZES) - * of a platform dependent length (PAGESIZESLEN). On x86 the - * length is 2, on amd64 the length is 3 (there are other lengths - * for architectures not supported on Valgrind). - * - * When the dynamic loader executes it will run a routine - * static void init_pagesizes(Elf_Auxinfo **aux_info) - * (see /usr/src/libexec/rtld-elf/rltd.c). If the PAGESIZES info is in - * auxv, init_pagesizes will use that. However, normally this loop - * does not copy 'pointered' elements (because that would generate - * 'Invalid reads' in the guest). This means that the auxv that - * Valgrind provides to ldrt *doesn't* normally contain - * PAGESIZES. - * - * So init_pagesizes falls back to using sysctlnametomib/sysctl - * to read "hw.pagesizes". Unfortunately there seems to be a bug - * in this for an x86 executable compiled and running on an amd64 - * kernel. - * - * The application sees MAXPAGESLEN as 3 (from the amd64 headers) - * but the x86 kernel sees MAXPAGESLEN as 2. The routine that - * copies out the data for a sysctl sees this discrepancy and - * sets an ENOMEM error. So guest execution doesn't even get past - * executing the dynamic linker. - * - * This was fixed in the kernel in May 2020, see - * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246215 - * - * That means this workaround is not needed for - * FreeBSD 13 or later, any version - * FreeBSD 12 1201515 and later - * FreeBSD 11 1104501 and later - * - * Because this is rather complicated I've just disabled the hack - * for 13 and later - */ + VG_(client_auxv) = (UWord *)*client_auxv; for (; orig_auxv->a_type != AT_NULL; auxv++, orig_auxv++) { @@ -650,6 +649,9 @@ Addr setup_client_stack( void* init_sp, case AT_STACKPROT: case AT_NCPUS: case AT_OSRELDATE: + case AT_PAGESIZESLEN: + case AT_CANARYLEN: + #if (FREEBSD_VERS >= FREEBSD_11) // FreeBSD 11+ also have HWCAP and HWCAP2 case AT_EHDRFLAGS: @@ -657,41 +659,47 @@ Addr setup_client_stack( void* init_sp, /* All these are pointerless, so we don't need to do anything about them. */ break; - // case AT_CANARYLEN: - // case AT_EXECPATH: - // case AT_CANARY: -#if defined(VGP_x86_freebsd) && (VGO_freebsd <= FREEBSD_13_0) - case AT_PAGESIZESLEN: - if (!VG_(is32on64)()) { - VG_(debugLog)(2, "initimg", - "stomping auxv entry %llu\n", - (ULong)auxv->a_type); + + case AT_EXECPATH: + auxv->u.a_ptr = copy_str(&strtab, orig_auxv->u.a_ptr); + break; + case AT_CANARY: + if (canarylen >= 1) + auxv->u.a_ptr = copy_bytes(&strtab, orig_auxv->u.a_ptr, canarylen); + else auxv->a_type = AT_IGNORE; - } break; case AT_PAGESIZES: - if (VG_(is32on64)()) { - pagesizes = VG_(malloc)("initimg-freebsd.cpauxv.1", 2*sizeof(int)); - pagesizes[0] = ((int*)auxv->u.a_ptr)[0]; - pagesizes[1] = ((int*)auxv->u.a_ptr)[1]; - } else { - VG_(debugLog)(2, "initimg", - "stomping auxv entry %llu\n", - (ULong)auxv->a_type); + if (pagesizeslen >= 1) + auxv->u.a_ptr = copy_bytes(&strtab, orig_auxv->u.a_ptr, pagesizeslen); + else auxv->a_type = AT_IGNORE; - } break; -#endif - // case AT_TIMEKEEP: +#if 0 + /* + * @todo PJF this crashes intermittently + */ + case AT_TIMEKEEP: + auxv->u.a_ptr = copy_bytes(&strtab, orig_auxv->u.a_ptr, sizeof(struct vki_vdso_timehands)); break; +#endif #if (FREEBSD_VERS >= FREEBSD_13_0) case AT_BSDFLAGS: case AT_ARGC: - // case AT_ARGV: case AT_ENVC: - // case AT_ENVV: - // case AT_PS_STRINGS: + break; + case AT_PS_STRINGS: + auxv->u.a_ptr = copy_bytes(&strtab, orig_auxv->u.a_ptr, sizeof(struct vki_ps_strings)); + ((struct vki_ps_strings*)auxv->u.a_ptr)->ps_envstr = (char**)VG_(client_envp); + ((struct vki_ps_strings*)auxv->u.a_ptr)->ps_argvstr = (char**)client_argv; + break; + case AT_ARGV: + auxv->u.a_val = client_argv; + break; + case AT_ENVV: + auxv->u.a_val = (Word)VG_(client_envp); + break; #endif #if (FREEBSD_VERS >= FREEBSD_13_1) diff --git a/coregrind/m_syswrap/priv_syswrap-freebsd.h b/coregrind/m_syswrap/priv_syswrap-freebsd.h index 437047c533..5bce4ef80e 100644 --- a/coregrind/m_syswrap/priv_syswrap-freebsd.h +++ b/coregrind/m_syswrap/priv_syswrap-freebsd.h @@ -535,7 +535,7 @@ DECL_TEMPLATE(freebsd, sys___sysctlbyname) // 570 // to 12.2 leaving these 4 marked as UNIMPL in 12.2 DECL_TEMPLATE(freebsd, sys_shm_open2) // 571 // unimpl __NR_shm_rename 572 -// unimpl __NR_sigfastblock 573 +DECL_TEMPLATE(freebsd, sys_sigfastblock) // 573 DECL_TEMPLATE(freebsd, sys___realpathat) // 574 #endif diff --git a/coregrind/m_syswrap/syswrap-freebsd.c b/coregrind/m_syswrap/syswrap-freebsd.c index 0481b1c512..aeb2a1cd62 100644 --- a/coregrind/m_syswrap/syswrap-freebsd.c +++ b/coregrind/m_syswrap/syswrap-freebsd.c @@ -1943,6 +1943,23 @@ POST(sys_getdirentries) // freebsd6_ftruncate 201 FREEBSD_VERS <= 10 // x86/amd64 +static Bool sysctl_kern_ps_strings(SizeT* out, SizeT* outlen) +{ + Word tmp = -1; + const struct auxv *cauxv; + + for (cauxv = (struct auxv*)VG_(client_auxv); cauxv->a_type != VKI_AT_NULL; cauxv++) { + if (cauxv->a_type == VKI_AT_PS_STRINGS) { + tmp = (Word)cauxv->u.a_ptr; + + *out = tmp; + *outlen = sizeof(size_t); + return True; + } + } + return False; +} + // SYS___sysctl 202 /* int __sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, size_t newlen); */ /* ARG1 ARG2 ARG3 ARG4 ARG5 ARG6 */ @@ -2015,11 +2032,21 @@ PRE(sys___sysctl) size_t* out = (size_t*)ARG3; size_t* outlen = (size_t*)ARG4; *out = tmp; - *outlen = sizeof(size_t); + *outlen = sizeof(ULong); SET_STATUS_Success(0); } } + /* + * 2. kern.ps_strings + */ + if (SARG2 >= 2 && ML_(safe_to_deref)(name, 2*sizeof(int))) { + if (name[0] == 1 && name[1] == 32) { + if (sysctl_kern_ps_strings((SizeT*)ARG3, (SizeT*)ARG4)) { + SET_STATUS_Success(0); + } + } + } PRE_REG_READ6(int, "__sysctl", int *, name, vki_u_int32_t, namelen, void *, oldp, vki_size_t *, oldlenp, void *, newp, vki_size_t, newlen); @@ -6248,6 +6275,16 @@ PRE(sys___sysctlbyname) PRE_REG_READ6(int, "__sysctlbyname", const char *, name, vki_size_t, namelen, void *, oldp, vki_size_t *, oldlenp, void *, newp, vki_size_t, newlen); + + + const char* name = (const char*)ARG1; + if (ML_(safe_to_deref)(name, sizeof("kern.ps_strings")) && + VG_(strcmp)(name, "kern.ps_strings") == 0) { + if (sysctl_kern_ps_strings((SizeT*)ARG3, (SizeT*)ARG4)) { + SET_STATUS_Success(0); + } + } + // read number of ints specified in ARG2 from mem pointed to by ARG1 PRE_MEM_READ("__sysctlbyname(name)", (Addr)ARG1, ARG2 * sizeof(int)); @@ -6270,7 +6307,7 @@ PRE(sys___sysctlbyname) if (ML_(safe_to_deref)((void*)(Addr)ARG4, sizeof(vki_size_t))) { PRE_MEM_WRITE("__sysctlbyname(oldp)", (Addr)ARG3, *(vki_size_t *)ARG4); } else { - VG_(dmsg)("Warning: Bad oldlenp address %p in sysctl\n", + VG_(dmsg)("Warning: Bad oldlenp address %p in sysctlbyname\n", (void *)(Addr)ARG4); SET_STATUS_Failure ( VKI_EFAULT ); } @@ -6334,6 +6371,14 @@ POST(sys_shm_open2) } } +// SYS_sigfastblock +// int sigfastblock(int cmd, void *ptr); +PRE(sys_sigfastblock) +{ + PRINT("sys_sigfastblock ( %" FMT_REGWORD "d, %#" FMT_REGWORD "x )", SARG1, ARG2); + PRE_REG_READ2(int, "sigfasblock", int, cmd, void*, ptr); +} + // SYS___realpathat 574 // from syscalls.master // int __realpathat(int fd, @@ -7084,7 +7129,7 @@ const SyscallTableEntry ML_(syscall_table)[] = { #if (FREEBSD_VERS >= FREEBSD_13_0) BSDXY(__NR_shm_open2, sys_shm_open2), // 571 // unimpl __NR_shm_rename 572 - // unimpl __NR_sigfastblock 573 + BSDX_(__NR_sigfastblock, sys_sigfastblock), // 573 BSDXY( __NR___realpathat, sys___realpathat), // 574 #endif // unimpl __NR_close_range 575 diff --git a/coregrind/m_ume/elf.c b/coregrind/m_ume/elf.c index 694c71d5bc..a850a50cfa 100644 --- a/coregrind/m_ume/elf.c +++ b/coregrind/m_ume/elf.c @@ -653,6 +653,7 @@ Int VG_(load_ELF)(Int fd, const HChar* name, /*MOD*/ExeInfo* info) if (sr_isError(sres)) #endif sres = VG_(open)(buf, VKI_O_RDONLY, 0); + //sres = VG_(open)("/usr/home/paulf/build/src/obj/usr/home/paulf/build/src/amd64.amd64/libexec/rtld-elf/ld-elf.so.1.full", VKI_O_RDONLY, 0); if (sr_isError(sres)) { VG_(printf)("valgrind: m_ume.c: can't open interpreter\n"); VG_(exit)(1); diff --git a/coregrind/pub_core_libcproc.h b/coregrind/pub_core_libcproc.h index 29cc2a4494..d63a4f7c47 100644 --- a/coregrind/pub_core_libcproc.h +++ b/coregrind/pub_core_libcproc.h @@ -90,6 +90,15 @@ extern void VG_(do_atfork_child) ( ThreadId tid ); extern Int VG_(sysctlbyname)(const HChar *name, void *oldp, SizeT *oldlenp, const void *newp, SizeT newlen); extern Int VG_(getosreldate)(void); extern Bool VG_(is32on64)(void); + +struct auxv { + Word a_type; + union { + void *a_ptr; + Word a_val; + } u; +}; + #endif // icache invalidation diff --git a/include/vki/vki-amd64-freebsd.h b/include/vki/vki-amd64-freebsd.h index 374e7eeb50..213c805cdf 100644 --- a/include/vki/vki-amd64-freebsd.h +++ b/include/vki/vki-amd64-freebsd.h @@ -219,4 +219,29 @@ struct vki_sigaction_base { typedef struct vki_sigaction_base vki_sigaction_toK_t; typedef struct vki_sigaction_base vki_sigaction_fromK_t; +//---------------------------------------------------------------------- +// sys/vdso.h +//---------------------------------------------------------------------- +#define VKI_VDSO_TIMEHANDS_MD \ + vki_uint32_t th_x86_shift; \ + vki_uint32_t th_x86_hpet_idx; \ + vki_uint32_t th_res[6]; + +struct vki_bintime { + vki_time_t sec; + vki_uint64_t frac; +}; + +struct vki_vdso_timehands { + vki_uint32_t th_algo; + vki_uint32_t th_gen; + vki_uint64_t th_scale; + vki_uint32_t th_offset_count; + vki_uint32_t th_counter_mask; + struct vki_bintime th_offset; + struct vki_bintime th_boottime; + VKI_VDSO_TIMEHANDS_MD +}; + + #endif /* VKI_AMD64_FREEBSD_H */ diff --git a/include/vki/vki-freebsd.h b/include/vki/vki-freebsd.h index ef5b27d6a7..c2234664d6 100644 --- a/include/vki/vki-freebsd.h +++ b/include/vki/vki-freebsd.h @@ -2466,7 +2466,24 @@ struct vki_jail { struct in6_addr *ip6; }; +//---------------------------------------------------------------------- +// From sys/exec.h +//---------------------------------------------------------------------- + +struct vki_ps_strings { + char** ps_argvstr; + unsigned int ps_nargvstr; + + char** ps_envstr; + unsigned int ps_nenvstr; +}; + +//---------------------------------------------------------------------- +// From sys/elf_common.h +//---------------------------------------------------------------------- +#define VKI_AT_NULL 0 +#define VKI_AT_PS_STRINGS 32 // See syswrap-freebsd.c PRE/POST(sys_ioctl) #if 0 diff --git a/include/vki/vki-x86-freebsd.h b/include/vki/vki-x86-freebsd.h index 638cea6bc5..60ca1040ba 100644 --- a/include/vki/vki-x86-freebsd.h +++ b/include/vki/vki-x86-freebsd.h @@ -243,6 +243,36 @@ struct vki_sigaction_base { typedef struct vki_sigaction_base vki_sigaction_toK_t; typedef struct vki_sigaction_base vki_sigaction_fromK_t; +//---------------------------------------------------------------------- +// sys/vdso.h +//---------------------------------------------------------------------- +#define VKI_VDSO_TIMEHANDS_MD \ + vki_uint32_t th_x86_shift; \ + vki_uint32_t th_x86_hpet_idx; \ + vki_uint32_t th_res[6]; + +struct vki_bintime32 { +#if defined(__amd64__) + vki_uint32_t sec; +#else + vki_uint64_t sec; +#endif + vki_uint32_t frac[2]; +}; + +struct vki_vdso_timehands { + vki_uint32_t th_algo; + vki_uint32_t th_gen; + vki_uint32_t th_scale[2]; + vki_uint32_t th_offset_count; + vki_uint32_t th_counter_mask; + struct vki_bintime32 th_offset; + struct vki_bintime32 th_boottime; + VKI_VDSO_TIMEHANDS_MD +}; + + + #endif // VKI_X86_FREEBSD_H /*--------------------------------------------------------------------*/ diff --git a/memcheck/tests/freebsd/Makefile.am b/memcheck/tests/freebsd/Makefile.am index cf32e115da..a5a06f7777 100644 --- a/memcheck/tests/freebsd/Makefile.am +++ b/memcheck/tests/freebsd/Makefile.am @@ -81,14 +81,18 @@ EXTRA_DIST = \ eventfd2.vgtest \ eventfd2.stderr.exp eventfd2.stdout.exp \ errno_aligned_allocs.vgtest \ - errno_aligned_allocs.stderr.exp + errno_aligned_allocs.stderr.exp \ + setproctitle.vgtest \ + setproctitle.stderr.exp \ + setproctitle.stdout.exp check_PROGRAMS = \ statfs pdfork_pdkill getfsstat inlinfo inlinfo_nested.so extattr \ sigwait chflags get_set_login revoke scalar capsicum getfh \ linkat scalar_fork scalar_thr_exit scalar_abort2 scalar_pdfork \ scalar_vfork stat file_locking_wait6 utimens access chmod_chown \ - misc get_set_context utimes static_allocs fexecve errno_aligned_allocs + misc get_set_context utimes static_allocs fexecve errno_aligned_allocs \ + setproctitle AM_CFLAGS += $(AM_FLAG_M3264_PRI) AM_CXXFLAGS += $(AM_FLAG_M3264_PRI) diff --git a/memcheck/tests/freebsd/scalar.stderr.exp b/memcheck/tests/freebsd/scalar.stderr.exp index 869b48d416..80fdf09af2 100644 --- a/memcheck/tests/freebsd/scalar.stderr.exp +++ b/memcheck/tests/freebsd/scalar.stderr.exp @@ -5290,7 +5290,7 @@ Syscall param __sysctlbyname(oldlenp) points to unaddressable byte(s) ... Address 0x........ is not stack'd, malloc'd or (recently) free'd -Warning: Bad oldlenp address 0x........ in sysctl +Warning: Bad oldlenp address 0x........ in sysctlbyname --------------------------------------------------------- 570: SYS___sysctlbyname (putnew) 4s 2m --------------------------------------------------------- diff --git a/memcheck/tests/freebsd/scalar.stderr.exp-x86 b/memcheck/tests/freebsd/scalar.stderr.exp-x86 index a5e1e25f0c..9e0b3acb78 100644 --- a/memcheck/tests/freebsd/scalar.stderr.exp-x86 +++ b/memcheck/tests/freebsd/scalar.stderr.exp-x86 @@ -5351,7 +5351,7 @@ Syscall param __sysctlbyname(oldlenp) points to unaddressable byte(s) ... Address 0x........ is not stack'd, malloc'd or (recently) free'd -Warning: Bad oldlenp address 0x........ in sysctl +Warning: Bad oldlenp address 0x........ in sysctlbyname --------------------------------------------------------- 570: SYS___sysctlbyname (putnew) 4s 2m --------------------------------------------------------- diff --git a/memcheck/tests/freebsd/setproctitle.c b/memcheck/tests/freebsd/setproctitle.c new file mode 100644 index 0000000000..19d5114985 --- /dev/null +++ b/memcheck/tests/freebsd/setproctitle.c @@ -0,0 +1,48 @@ +#include <sys/types.h> +#include <sys/sysctl.h> +#include <sys/elf_common.h> +#include <sys/auxv.h> +#include <unistd.h> +#include <stdarg.h> +#include <stdlib.h> +#include <stdio.h> +#include "../../../config.h" + +int main(void) +{ +#if (FREEBSD_VERS >= FREEBSD_13_0) + unsigned long ul_ps_strings; + struct ps_strings* v1; + struct ps_strings* v2; + struct ps_strings* v3; + int name[] = {CTL_KERN, KERN_PS_STRINGS}; + + size_t struct_len = sizeof(ul_ps_strings); + + if (sysctlbyname("kern.ps_strings", &ul_ps_strings, &struct_len, NULL, 0) < 0) { + perror("sysctlbyname failed:"); + exit(-1); + } + v1 = (struct ps_strings*)ul_ps_strings; + + (void)elf_aux_info(AT_PS_STRINGS, &v2, sizeof(v2)); + + if (sysctl(name, 2, &ul_ps_strings, &struct_len, NULL, 0) < 0) { + perror("sysctl failed:"); + exit(-1); + } + v3 = (struct ps_strings*)ul_ps_strings; + + if (v1 == v2 && v1 == v2) { + printf("OK\n"); + } else { + printf("FAIL ps_strings different\n"); + printf("v1 %p v2 %p v3 %p\n", v1, v2, v3); + } +#else + printf("OK\n"); +#endif + + setproctitle("foo %s %d", "bar", 42); +} + diff --git a/memcheck/tests/freebsd/setproctitle.stderr.exp b/memcheck/tests/freebsd/setproctitle.stderr.exp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/memcheck/tests/freebsd/setproctitle.stdout.exp b/memcheck/tests/freebsd/setproctitle.stdout.exp new file mode 100644 index 0000000000..d86bac9de5 --- /dev/null +++ b/memcheck/tests/freebsd/setproctitle.stdout.exp @@ -0,0 +1 @@ +OK diff --git a/memcheck/tests/freebsd/setproctitle.vgtest b/memcheck/tests/freebsd/setproctitle.vgtest new file mode 100644 index 0000000000..62b733fc7e --- /dev/null +++ b/memcheck/tests/freebsd/setproctitle.vgtest @@ -0,0 +1,2 @@ +prog: setproctitle +vgopts: -q diff --git a/none/tests/freebsd/auxv.stderr.exp b/none/tests/freebsd/auxv.stderr.exp index 28d14b006e..6c45cf0c4e 100644 --- a/none/tests/freebsd/auxv.stderr.exp +++ b/none/tests/freebsd/auxv.stderr.exp @@ -6,12 +6,12 @@ val: AT_FLAGS int: 08 ptr: 0x........ val: AT_ENTRY int: 09 ptr: 0x........ val: AT_BASE int: 07 ptr: 0x........ val: AT_EHDRFLAGS int: 24 ptr: 0x........ -val: AT_IGNORE int: 01 ptr: 0x........ +val: AT_EXECPATH int: 15 ptr: 0x........ val: AT_OSRELDATE int: 18 ptr: 0x........ -val: AT_IGNORE int: 01 ptr: 0x........ -val: AT_IGNORE int: 01 ptr: 0x........ +val: AT_CANARY int: 16 ptr: 0x........ +val: AT_CANARYLEN int: 17 ptr: 0x........ val: AT_NCPUS int: 19 ptr: 0x........ -val: AT_IGNORE int: 01 ptr: 0x........ -val: AT_IGNORE int: 01 ptr: 0x........ +val: AT_PAGESIZES int: 20 ptr: 0x........ +val: AT_PAGESIZESLEN int: 21 ptr: 0x........ val: AT_IGNORE int: 01 ptr: 0x........ val: AT_STACKPROT int: 23 ptr: 0x........ diff --git a/none/tests/freebsd/auxv.stderr.exp-freebsd13 b/none/tests/freebsd/auxv.stderr.exp-freebsd13 index 3fe4642e7d..9248b17a58 100644 --- a/none/tests/freebsd/auxv.stderr.exp-freebsd13 +++ b/none/tests/freebsd/auxv.stderr.exp-freebsd13 @@ -6,18 +6,18 @@ val: AT_FLAGS int: 08 ptr: 0x........ val: AT_ENTRY int: 09 ptr: 0x........ val: AT_BASE int: 07 ptr: 0x........ val: AT_EHDRFLAGS int: 24 ptr: 0x........ -val: AT_IGNORE int: 01 ptr: 0x........ +val: AT_EXECPATH int: 15 ptr: 0x........ val: AT_OSRELDATE int: 18 ptr: 0x........ -val: AT_IGNORE int: 01 ptr: 0x........ -val: AT_IGNORE int: 01 ptr: 0x........ +val: AT_CANARY int: 16 ptr: 0x........ +val: AT_CANARYLEN int: 17 ptr: 0x........ val: AT_NCPUS int: 19 ptr: 0x........ -val: AT_IGNORE int: 01 ptr: 0x........ -val: AT_IGNORE int: 01 ptr: 0x........ +val: AT_PAGESIZES int: 20 ptr: 0x........ +val: AT_PAGESIZESLEN int: 21 ptr: 0x........ val: AT_IGNORE int: 01 ptr: 0x........ val: AT_STACKPROT int: 23 ptr: 0x........ val: AT_BSDFLAGS int: 27 ptr: 0x........ val: AT_ARGC int: 28 ptr: 0x........ -val: AT_IGNORE int: 01 ptr: 0x........ +val: AT_ARGV int: 29 ptr: 0x........ val: AT_ENVC int: 30 ptr: 0x........ -val: AT_IGNORE int: 01 ptr: 0x........ -val: AT_IGNORE int: 01 ptr: 0x........ +val: AT_ENVV int: 31 ptr: 0x........ +val: AT_PS_STRINGS int: 32 ptr: 0x........ diff --git a/none/tests/freebsd/auxv.stderr.exp-freebsd131 b/none/tests/freebsd/auxv.stderr.exp-freebsd131 index f35916f4b3..af70ce3160 100644 --- a/none/tests/freebsd/auxv.stderr.exp-freebsd131 +++ b/none/tests/freebsd/auxv.stderr.exp-freebsd131 @@ -6,19 +6,19 @@ val: AT_FLAGS int: 08 ptr: 0x........ val: AT_ENTRY int: 09 ptr: 0x........ val: AT_BASE int: 07 ptr: 0x........ val: AT_EHDRFLAGS int: 24 ptr: 0x........ -val: AT_IGNORE int: 01 ptr: 0x........ +val: AT_EXECPATH int: 15 ptr: 0x........ val: AT_OSRELDATE int: 18 ptr: 0x........ -val: AT_IGNORE int: 01 ptr: 0x........ -val: AT_IGNORE int: 01 ptr: 0x........ +val: AT_CANARY int: 16 ptr: 0x........ +val: AT_CANARYLEN int: 17 ptr: 0x........ val: AT_NCPUS int: 19 ptr: 0x........ -val: AT_IGNORE int: 01 ptr: 0x........ -val: AT_IGNORE int: 01 ptr: 0x........ +val: AT_PAGESIZES int: 20 ptr: 0x........ +val: AT_PAGESIZESLEN int: 21 ptr: 0x........ val: AT_IGNORE int: 01 ptr: 0x........ val: AT_STACKPROT int: 23 ptr: 0x........ val: AT_BSDFLAGS int: 27 ptr: 0x........ val: AT_ARGC int: 28 ptr: 0x........ -val: AT_IGNORE int: 01 ptr: 0x........ +val: AT_ARGV int: 29 ptr: 0x........ val: AT_ENVC int: 30 ptr: 0x........ -val: AT_IGNORE int: 01 ptr: 0x........ -val: AT_IGNORE int: 01 ptr: 0x........ +val: AT_ENVV int: 31 ptr: 0x........ +val: AT_PS_STRINGS int: 32 ptr: 0x........ val: AT_IGNORE int: 01 ptr: 0x........ |
|
From: Paul F. <pa...@so...> - 2022-07-03 07:06:25
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=0ed32f4b21b51edb3fe370c372fceb6bdb6e079d commit 0ed32f4b21b51edb3fe370c372fceb6bdb6e079d Author: Paul Floyd <pj...@wa...> Date: Sun Jul 3 09:04:33 2022 +0200 Simplify FreeeBSD Helgrind suppresssions Also add a file for debug builds of the runtime link editor rtld. This is not used by default. Diff: --- freebsd-helgrind-dbgrtld.supp | 90 +++++++++++++++++++++++++++++++++++++++ freebsd-helgrind.supp | 98 ++----------------------------------------- 2 files changed, 94 insertions(+), 94 deletions(-) diff --git a/freebsd-helgrind-dbgrtld.supp b/freebsd-helgrind-dbgrtld.supp new file mode 100644 index 0000000000..ed16159c07 --- /dev/null +++ b/freebsd-helgrind-dbgrtld.supp @@ -0,0 +1,90 @@ +{ + HELGRIND-LIB-RTLD2 + Helgrind:Race + fun:allocate_tls +} +{ + HELGRIND-LIB-RTLD3 + Helgrind:Race + fun:symlook_obj +} +{ + HELGRIND-LIB-RTLD4 + Helgrind:Race + fun:objlist_call_fini +} +{ + HELGRIND-LIB-RTLD5 + Helgrind:Race + fun:_rtld_error +} +{ + HELGRIND-LIB-RTLD6 + Helgrind:Race + fun:errmsg_save +} +{ + HELGRIND-LIB-RTLD7 + Helgrind:Race + fun:rtld_vsnprintf +} +{ + HELGRIND-LIB-RTLD8 + Helgrind:Race + fun:snprintf_func +} +{ + HELGRIND-LIB-RTLD9 + Helgrind:Race + fun:strlen +} +{ + HELGRIND-LIB-RTLD10 + Helgrind:Race + fun:symlook_default +} +{ + HELGRIND-LIB-RTLD11 + Helgrind:Race + ... + fun:dl_iterate_phdr +} +{ + HELGRIND-LIB-RTLD12 + Helgrind:Race + fun:morecore +} +{ + HELGRIND-LIB-RTLD13 + Helgrind:Race + fun:__crt_malloc +} +{ + HELGRIND-LIB-RTLD14 + Helgrind:Race + fun:globallist_curr +} +{ + HELGRIND-LIB-RTLD15 + Helgrind:Race + fun:tls_get_addr_common +} +{ + HELGRIND-LIB-RTLD16 + Helgrind:Race + fun:memset + ... + fun:allocate_tls +} +{ + HELGRIND-LIB-RTLD17 + Helgrind:Race + fun:__crt_free +} +{ + HELGRIND-LIB-RTLD18 + Helgrind:Race + ... + fun:free_tls +} + diff --git a/freebsd-helgrind.supp b/freebsd-helgrind.supp index ee6c424957..6c51bfbd01 100644 --- a/freebsd-helgrind.supp +++ b/freebsd-helgrind.supp @@ -6,7 +6,7 @@ obj:*/lib*/libthr.so.3* } { - HELGRIND-LIB-LDRT1 + HELGRIND-LIB-RTLD1 Helgrind:Race obj:/libexec/ld-elf*.so.1 } @@ -18,20 +18,7 @@ obj:*/lib*/libthr.so.3 } { - HELGRIND-PTHREAD-EXIT1 - Helgrind:Race - fun:_pthread_exit_mask - fun:pthread_exit -} -{ - HELGRIND-PTHREAD-EXIT2 - Helgrind:Race - fun:__sys_thr_exit - fun:_pthread_exit_mask - fun:pthread_exit -} -{ - HELGRIND-PTHREAD-EXIT4 + HELGRIND-PTHREAD-JOIN Helgrind:Race fun:_thr_try_gc obj:*/lib*/libthr.so.3 @@ -39,65 +26,11 @@ fun:pthread_join } { - HELGRIND-PTHREAD-EXIT5 - Helgrind:Race - fun:__sys_thr_exit - obj:*/lib*/libthr.so.3* - fun:_pthread_exit_mask - fun:pthread_exit -} -{ - HELGRIND-PTHREAD-EXIT6 - Helgrind:Race - obj:*/lib*/libcxxrt.so.1 - obj:*/lib*/libthr.so.3 - obj:*/lib*/libthr.so.3 - obj:*/lib*/libthr.so.3 - obj:*/lib*/libgcc_s.so.1 - fun:_Unwind_ForcedUnwind - obj:*/lib*/libthr.so.3 - obj:*/lib*/libthr.so.3 - fun:pthread_exit -} -{ - HELGRIND-PTHREAD-EXIT7 + HELGRIND-PTHREAD-EXIT Helgrind:Race - obj:*/lib*/libc.so.7 - fun:_malloc_thread_cleanup - obj:*/lib*/libthr.so.3 - obj:*/lib*/libthr.so.3 + ... fun:pthread_exit } -{ - HELGRIND-PTHREAD-EXIT8 - Helgrind:Race - fun:__cxa_thread_call_dtors - obj:*/lib*/libthr.so.3 - fun:pthread_exit -} -{ - HELGRIND-PTHREAD-EXIT9 - Helgrind:Race - fun:thr_exit - obj:*/lib*/libthr.so.3* - fun:_pthread_exit_mask -} -{ - HELGRIND-PTHREAD-EXIT10 - Helgrind:Race - obj:*/lib*/libc.so.7 - fun:_malloc_thread_cleanup - obj:*/lib*/libthr.so.3* - fun:_pthread_exit_mask - fun:_Tthr_exit -} -{ - HELGRIND-PTHREAD-EXIT11 - Helgrind:Race - fun:__cxa_thread_call_dtors - fun:_pthread_exit_mask - fun:_Tthr_exit -} { HELGRIND-PTHREAD-BARRIER2 Helgrind:Race @@ -161,21 +94,6 @@ obj:*/lib*/libthr.so.3 fun:pthread_create } -# same as previous, but with debug build of libthr -{ - HELGRIND-PTHREAD-CREATE3 - Helgrind:Race - fun:memset - fun:_thr_alloc - fun:pthread_create -} -# another for debug build of libthr -{ - HELGRIND-PTHREAD-CREATE4 - Helgrind:Race - fun:thr_new - fun:pthread_create -} # PJF again a pthread_self() hazard { HELGRIND-PTHREAD-SELF1 @@ -219,14 +137,6 @@ fun:memset obj:*/lib*/libthr.so.3 } -{ - HELGRIND-MUTEX-LOCK2 - Helgrind:Race - fun:memset - fun:__crt_calloc - fun:__thr_calloc - fun:mutex_init -} { HELGRIND-LIBOMP Helgrind:Race |