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
|
3
|
|
4
|
5
|
6
|
7
(1) |
8
|
9
|
10
|
|
11
|
12
|
13
|
14
|
15
|
16
|
17
|
|
18
|
19
|
20
|
21
|
22
(4) |
23
(3) |
24
(2) |
|
25
(9) |
26
(2) |
27
(1) |
28
|
29
(7) |
30
(5) |
31
(2) |
|
From: Mark W. <ma...@kl...> - 2022-12-25 00:33:48
|
Hi Bart, On Sat, Dec 24, 2022 at 11:37:34PM +0000, Bart Van Assche wrote: > https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=2bd7f7042125c99326ffa21c52f368f0721040ca > > commit 2bd7f7042125c99326ffa21c52f368f0721040ca > Author: Bart Van Assche <bva...@ac...> > Date: Mon Jun 20 12:46:40 2022 -0700 > > syscall Could you explain this commit a bit more? It seems to have broken the build on at least debian-i386: In file included from scalar.c:4: scalar.c: In function ‘main’: scalar.c:1272:7: error: ‘__NR_sys_kexec_load’ undeclared (first use in this function) 1272 | GO(__NR_sys_kexec_load, "ni"); | ^~~~~~~~~~~~~~~~~~~ scalar.h:21:20: note: in definition of macro ‘GO’ 21 | __NR_xxx, #__NR_xxx, s); | ^~~~~~~~ scalar.c:1272:7: note: each undeclared identifier is reported only once for each function it appears in 1272 | GO(__NR_sys_kexec_load, "ni"); | ^~~~~~~~~~~~~~~~~~~ scalar.h:21:20: note: in definition of macro ‘GO’ 21 | __NR_xxx, #__NR_xxx, s); | ^~~~~~~~ make[5]: *** [Makefile:755: scalar.o] Error 1 Thanks, Mark > Diff: > --- > memcheck/tests/arm64-linux/scalar.h | 8 +------- > memcheck/tests/x86-linux/scalar.h | 7 +------ > 2 files changed, 2 insertions(+), 13 deletions(-) > > diff --git a/memcheck/tests/arm64-linux/scalar.h b/memcheck/tests/arm64-linux/scalar.h > index 9008816d6e..3dbfa79673 100644 > --- a/memcheck/tests/arm64-linux/scalar.h > +++ b/memcheck/tests/arm64-linux/scalar.h > @@ -1,6 +1,3 @@ > -/* This is the arm64 variant of memcheck/tests/x86-linux/scalar.h */ > -#include "../../../include/vki/vki-scnums-arm64-linux.h" > - > #include <assert.h> > #include <errno.h> > #include <fcntl.h> > @@ -11,10 +8,7 @@ > #include <sys/ptrace.h> > #include <sys/types.h> > #include <sys/mman.h> > - > -// Since we use vki_unistd.h, we can't include <unistd.h>. So we have to > -// declare this ourselves. > -extern long int syscall (long int __sysno, ...) __THROW; > +#include <unistd.h> > > // Thorough syscall scalar arg checking. Also serves as thorough checking > // for (very) basic syscall use. Generally not trying to do anything > diff --git a/memcheck/tests/x86-linux/scalar.h b/memcheck/tests/x86-linux/scalar.h > index ef28b03550..3dbfa79673 100644 > --- a/memcheck/tests/x86-linux/scalar.h > +++ b/memcheck/tests/x86-linux/scalar.h > @@ -1,5 +1,3 @@ > -#include "../../../include/vki/vki-scnums-x86-linux.h" > - > #include <assert.h> > #include <errno.h> > #include <fcntl.h> > @@ -10,10 +8,7 @@ > #include <sys/ptrace.h> > #include <sys/types.h> > #include <sys/mman.h> > - > -// Since we use vki_unistd.h, we can't include <unistd.h>. So we have to > -// declare this ourselves. > -extern long int syscall (long int __sysno, ...) __THROW; > +#include <unistd.h> > > // Thorough syscall scalar arg checking. Also serves as thorough checking > // for (very) basic syscall use. Generally not trying to do anything > > > _______________________________________________ > Valgrind-developers mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-developers |
|
From: Bart V. A. <bva...@so...> - 2022-12-24 23:37:53
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=72b556ab15f120d6ffe5eecaed2f0e2c3f9dc975 commit 72b556ab15f120d6ffe5eecaed2f0e2c3f9dc975 Author: Bart Van Assche <bva...@ac...> Date: Sat Dec 24 14:43:40 2022 -0800 drd: Improve barrier support Make test drd/tests/pth_barrier_thr_cr pass on Fedora 38. Diff: --- NEWS | 1 + drd/drd_barrier.c | 19 ------------------- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/NEWS b/NEWS index 4dd33a364e..e1befb56f5 100644 --- a/NEWS +++ b/NEWS @@ -26,6 +26,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. 351857 confusing error message about valid command line option 444110 priv/guest_ppc_toIR.c:36198:31: warning: duplicated 'if' condition. 444488 Use glibc.pthread.stack_cache_size tunable +444568 drd/tests/pth_barrier_thr_cr fails on Fedora 38 459476 vgdb: allow address reuse to avoid "address already in use" errorsuse" errors 462830 WARNING: unhandled amd64-freebsd syscall: 474 463027 broken check for MPX instruction support in assembler diff --git a/drd/drd_barrier.c b/drd/drd_barrier.c index 4602837244..0d6d2136ae 100644 --- a/drd/drd_barrier.c +++ b/drd/drd_barrier.c @@ -431,25 +431,6 @@ void DRD_(barrier_post_wait)(const DrdThreadId tid, const Addr barrier, oset = p->oset[p->post_iteration & 1]; q = VG_(OSetGen_Lookup)(oset, &word_tid); - if (p->pre_iteration - p->post_iteration > 1) { - BarrierErrInfo bei = { DRD_(thread_get_running_tid)(), p->a1, 0, 0 }; - VG_(maybe_record_error)(VG_(get_running_tid)(), - BarrierErr, - VG_(get_IP)(VG_(get_running_tid)()), - "Number of concurrent pthread_barrier_wait()" - " calls exceeds the barrier count", - &bei); - } else if (q == NULL) { - BarrierErrInfo bei = { DRD_(thread_get_running_tid)(), p->a1, 0, 0 }; - VG_(maybe_record_error)(VG_(get_running_tid)(), - BarrierErr, - VG_(get_IP)(VG_(get_running_tid)()), - "Error in barrier implementation" - " -- barrier_wait() started before" - " barrier_destroy() and finished after" - " barrier_destroy()", - &bei); - } if (q == NULL) { q = VG_(OSetGen_AllocNode)(oset, sizeof(*q)); DRD_(barrier_thread_initialize)(q, tid); |
|
From: Bart V. A. <bva...@so...> - 2022-12-24 23:37:45
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=2bd7f7042125c99326ffa21c52f368f0721040ca commit 2bd7f7042125c99326ffa21c52f368f0721040ca Author: Bart Van Assche <bva...@ac...> Date: Mon Jun 20 12:46:40 2022 -0700 syscall Diff: --- memcheck/tests/arm64-linux/scalar.h | 8 +------- memcheck/tests/x86-linux/scalar.h | 7 +------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/memcheck/tests/arm64-linux/scalar.h b/memcheck/tests/arm64-linux/scalar.h index 9008816d6e..3dbfa79673 100644 --- a/memcheck/tests/arm64-linux/scalar.h +++ b/memcheck/tests/arm64-linux/scalar.h @@ -1,6 +1,3 @@ -/* This is the arm64 variant of memcheck/tests/x86-linux/scalar.h */ -#include "../../../include/vki/vki-scnums-arm64-linux.h" - #include <assert.h> #include <errno.h> #include <fcntl.h> @@ -11,10 +8,7 @@ #include <sys/ptrace.h> #include <sys/types.h> #include <sys/mman.h> - -// Since we use vki_unistd.h, we can't include <unistd.h>. So we have to -// declare this ourselves. -extern long int syscall (long int __sysno, ...) __THROW; +#include <unistd.h> // Thorough syscall scalar arg checking. Also serves as thorough checking // for (very) basic syscall use. Generally not trying to do anything diff --git a/memcheck/tests/x86-linux/scalar.h b/memcheck/tests/x86-linux/scalar.h index ef28b03550..3dbfa79673 100644 --- a/memcheck/tests/x86-linux/scalar.h +++ b/memcheck/tests/x86-linux/scalar.h @@ -1,5 +1,3 @@ -#include "../../../include/vki/vki-scnums-x86-linux.h" - #include <assert.h> #include <errno.h> #include <fcntl.h> @@ -10,10 +8,7 @@ #include <sys/ptrace.h> #include <sys/types.h> #include <sys/mman.h> - -// Since we use vki_unistd.h, we can't include <unistd.h>. So we have to -// declare this ourselves. -extern long int syscall (long int __sysno, ...) __THROW; +#include <unistd.h> // Thorough syscall scalar arg checking. Also serves as thorough checking // for (very) basic syscall use. Generally not trying to do anything |
|
From: Paul F. <pa...@so...> - 2022-12-23 15:53:51
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=2de91d914cc5ed4ed7ea8e70d5e06c46e991f39f commit 2de91d914cc5ed4ed7ea8e70d5e06c46e991f39f Author: Paul Floyd <pj...@wa...> Date: Fri Dec 23 16:49:20 2022 +0100 Bug 444488 - Use glibc.pthread.stack_cache_size tunable Try to use GLIBC_TUNABLES to disable the pthread stack cache. Diff: --- NEWS | 1 + coregrind/m_clientstate.c | 2 ++ coregrind/m_initimg/initimg-linux.c | 61 +++++++++++++++++++++++++++++-------- coregrind/m_redir.c | 19 +++++++++++- coregrind/m_scheduler/scheduler.c | 32 +++++++++++++++++-- coregrind/pub_core_clientstate.h | 2 ++ 6 files changed, 102 insertions(+), 15 deletions(-) diff --git a/NEWS b/NEWS index c9376dcca9..4dd33a364e 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. 170510 Don't warn about ioctl of size 0 without direction hint 351857 confusing error message about valid command line option 444110 priv/guest_ppc_toIR.c:36198:31: warning: duplicated 'if' condition. +444488 Use glibc.pthread.stack_cache_size tunable 459476 vgdb: allow address reuse to avoid "address already in use" errorsuse" errors 462830 WARNING: unhandled amd64-freebsd syscall: 474 463027 broken check for MPX instruction support in assembler diff --git a/coregrind/m_clientstate.c b/coregrind/m_clientstate.c index 23c846d6b8..93662dcb3d 100644 --- a/coregrind/m_clientstate.c +++ b/coregrind/m_clientstate.c @@ -121,6 +121,8 @@ Addr VG_(client__dl_sysinfo_int80) = 0; in nptl/allocatestack.c */ SizeT* VG_(client__stack_cache_actsize__addr) = 0; +client__gnu_get_libc_version_type VG_(client__gnu_get_libc_version_addr) = 0; + #if defined(VGO_solaris) /* Address of variable vg_vfork_fildes in vgpreload_core.so.0 (vg_preloaded.c). */ diff --git a/coregrind/m_initimg/initimg-linux.c b/coregrind/m_initimg/initimg-linux.c index 48df8c1225..4da9a8b976 100644 --- a/coregrind/m_initimg/initimg-linux.c +++ b/coregrind/m_initimg/initimg-linux.c @@ -120,19 +120,19 @@ static void load_client ( /*MOD*/ExeInfo* info, If this needs to handle any more variables it should be hacked into something table driven. The copy is VG_(malloc)'d space. */ -static HChar** setup_client_env ( HChar** origenv, const HChar* toolname) +static HChar** setup_client_env ( HChar** origenv, const HChar* toolname, Bool use_stack_cache_tunable) { vg_assert(origenv); vg_assert(toolname); - const HChar* preload_core = "vgpreload_core"; - const HChar* ld_preload = "LD_PRELOAD="; - const HChar* v_launcher = VALGRIND_LAUNCHER "="; - Int ld_preload_len = VG_(strlen)( ld_preload ); - Int v_launcher_len = VG_(strlen)( v_launcher ); - Bool ld_preload_done = False; - Int vglib_len = VG_(strlen)(VG_(libdir)); - Bool debug = False; + const HChar* preload_core = "vgpreload_core"; + const HChar* ld_preload = "LD_PRELOAD="; + const HChar* v_launcher = VALGRIND_LAUNCHER "="; + Int ld_preload_len = VG_(strlen)( ld_preload ); + Int v_launcher_len = VG_(strlen)( v_launcher ); + Bool ld_preload_done = False; + Int vglib_len = VG_(strlen)(VG_(libdir)); + Bool debug = False; HChar** cpp; HChar** ret; @@ -175,9 +175,10 @@ static HChar** setup_client_env ( HChar** origenv, const HChar* toolname) if (debug) VG_(printf)("XXXXXXXXX: BEFORE %s\n", *cpp); } - /* Allocate a new space */ + /* Allocate a new space + * Size is envc + 1 new entry + maybe one for GLIBC_TUNABLES + NULL */ ret = VG_(malloc) ("initimg-linux.sce.3", - sizeof(HChar *) * (envc+1+1)); /* 1 new entry + NULL */ + sizeof(HChar *) * (envc+1+1+(use_stack_cache_tunable ? 1 : 0))); /* copy it over */ for (cpp = ret; *origenv; ) { @@ -201,6 +202,18 @@ static HChar** setup_client_env ( HChar** origenv, const HChar* toolname) ld_preload_done = True; } + if (use_stack_cache_tunable) { + /* overwrite value found with zeroes */ + const HChar* search_string = "glibc.pthread.stack_cache_size="; + HChar* val; + if ((val = VG_(strstr)(*cpp, search_string))) { + val += VG_(strlen)(search_string); + while (*val != '\0' && *val != ':') { + *val++ = '0'; + } + use_stack_cache_tunable = False; + } + } if (debug) VG_(printf)("XXXXXXXXX: MASH %s\n", *cpp); } @@ -215,6 +228,10 @@ static HChar** setup_client_env ( HChar** origenv, const HChar* toolname) if (debug) VG_(printf)("XXXXXXXXX: ADD %s\n", cp); } + if (use_stack_cache_tunable) { + ret[envc++] = VG_(strdup)("initimg-linux.sce.6", "GLIBC_TUNABLES=glibc.pthread.stack_cache_size=0"); + } + /* ret[0 .. envc-1] is live now. */ /* Find and remove a binding for VALGRIND_LAUNCHER. */ for (i = 0; i < envc; i++) @@ -1004,6 +1021,26 @@ static void setup_client_dataseg ( SizeT max_size ) vg_assert(sr_Res(sres) == anon_start); } +/* + * In glibc 2.34 we need to use the TUNABLE mechanism to + * disable stack cache when --sim-hints=no-nptl-pthread-stackcache + * is specified. This needs to be done in the same manner + * as LD_PRELOAD. + * + * See https://bugs.kde.org/show_bug.cgi?id=444488 + */ +static Bool need_stack_cache_tunable(HChar** argv) +{ + while (argv && *argv) { + if (VG_(strncmp)(*argv, "--sim-hints=", VG_(strlen)("--sim-hints=")) == 0) { + if (VG_(strstr)(*argv, "no-nptl-pthread-stackcache")) { + return True; + } + } + ++argv; + } + return False; +} /*====================================================================*/ /*=== TOP-LEVEL: VG_(setup_client_initial_image) ===*/ @@ -1046,7 +1083,7 @@ IIFinaliseImageInfo VG_(ii_create_image)( IICreateImageInfo iicii, // p: get_helprequest_and_toolname [for toolname] //-------------------------------------------------------------- VG_(debugLog)(1, "initimg", "Setup client env\n"); - env = setup_client_env(iicii.envp, iicii.toolname); + env = setup_client_env(iicii.envp, iicii.toolname, need_stack_cache_tunable(iicii.argv)); //-------------------------------------------------------------- // Setup client stack, eip, and VG_(client_arg[cv]) diff --git a/coregrind/m_redir.c b/coregrind/m_redir.c index 66a3c0c4f9..37c67f4c13 100644 --- a/coregrind/m_redir.c +++ b/coregrind/m_redir.c @@ -405,6 +405,8 @@ void VG_(redir_notify_new_DebugInfo)( const DebugInfo* newdi ) const HChar* const pthread_soname = "libpthread.so.0"; const HChar* const pthread_stack_cache_actsize_varname = "stack_cache_actsize"; + const HChar* const libc_soname = "libc.so.6"; + const HChar* const libc_gnu_get_libc_version_funcname = "gnu_get_libc_version"; #if defined(VGO_solaris) Bool vg_vfork_fildes_var_search = False; const HChar* const vg_preload_core_soname = "vgpreload_core.so.0"; @@ -506,7 +508,8 @@ void VG_(redir_notify_new_DebugInfo)( const DebugInfo* newdi ) dehacktivate_pthread_stack_cache_var_search = SimHintiS(SimHint_no_nptl_pthread_stackcache, VG_(clo_sim_hints)) - && 0 == VG_(strcmp)(newdi_soname, pthread_soname); + && (0 == VG_(strcmp)(newdi_soname, pthread_soname) || + 0 == VG_(strcmp)(newdi_soname, libc_soname)); #if defined(VGO_solaris) vg_vfork_fildes_var_search = @@ -529,6 +532,20 @@ void VG_(redir_notify_new_DebugInfo)( const DebugInfo* newdi ) &demangled_sopatt, &demangled_fnpatt, &isWrap, &becTag, &becPrio ); + + if (isText && dehacktivate_pthread_stack_cache_var_search) { + if (0 == VG_(strcmp)(*names, libc_gnu_get_libc_version_funcname)) { + if ( VG_(clo_verbosity) > 1 ) { + VG_(message)( Vg_DebugMsg, + "deactivate nptl pthread stackcache via tunable:" + " found symbol %s at addr %p\n", + *names, (void*) sym_avmas.main); + } + VG_(client__gnu_get_libc_version_addr) = (client__gnu_get_libc_version_type) sym_avmas.main; + dehacktivate_pthread_stack_cache_var_search = False; + } + } + /* ignore data symbols */ if (!isText) { /* But search for dehacktivate stack cache var if needed. */ diff --git a/coregrind/m_scheduler/scheduler.c b/coregrind/m_scheduler/scheduler.c index 00cc0c6889..027560c2ad 100644 --- a/coregrind/m_scheduler/scheduler.c +++ b/coregrind/m_scheduler/scheduler.c @@ -1348,8 +1348,36 @@ VgSchedReturnCode VG_(scheduler) ( ThreadId tid ) to be added without risk of overflow. */ } } else { - VG_(debugLog)(0,"sched", - "WARNING: pthread stack cache cannot be disabled!\n"); + /* + * glibc 2.34 no longer has stack_cache_actsize as a visible variable + * so we switch to using the GLIBC_TUNABLES env var. Processing for that + * is done in initimg-linux.c / setup_client_env for all glibc + * + * If we don't detect stack_cache_actsize we want to be able to tell + * whether it is an unexpected error or if it is no longer there. + * In the latter case we don't print a warning. + */ + Bool print_warning = True; + if (VG_(client__gnu_get_libc_version_addr) != NULL) { + const HChar* gnu_libc_version = VG_(client__gnu_get_libc_version_addr)(); + if (gnu_libc_version != NULL) { + HChar* glibc_version_tok = VG_(strdup)("scheduler.1", gnu_libc_version); + const HChar* str_major = VG_(strtok)(glibc_version_tok, "."); + Long major = VG_(strtoll10)(str_major, NULL); + const HChar* str_minor = VG_(strtok)(NULL, "."); + Long minor = VG_(strtoll10)(str_minor, NULL); + if (major >= 2 && minor >= 34) { + print_warning = False; + } + VG_(free)(glibc_version_tok); + } + } else { + + } + if (print_warning) { + VG_(debugLog)(0,"sched", + "WARNING: pthread stack cache cannot be disabled!\n"); + } VG_(clo_sim_hints) &= ~SimHint2S(SimHint_no_nptl_pthread_stackcache); /* Remove SimHint_no_nptl_pthread_stackcache from VG_(clo_sim_hints) to avoid having a msg for all following threads. */ diff --git a/coregrind/pub_core_clientstate.h b/coregrind/pub_core_clientstate.h index fb83a9ea23..824ce1e05f 100644 --- a/coregrind/pub_core_clientstate.h +++ b/coregrind/pub_core_clientstate.h @@ -118,6 +118,8 @@ extern Addr VG_(get_initial_client_SP)(void); It would be much cleaner to have a documented and supported way to disable the pthread stack cache. */ extern SizeT* VG_(client__stack_cache_actsize__addr); +typedef const HChar* (*client__gnu_get_libc_version_type)(void); +extern client__gnu_get_libc_version_type VG_(client__gnu_get_libc_version_addr); #if defined(VGO_solaris) /* Address of variable vg_vfork_fildes in vgpreload_core.so.0 |
|
From: Philippe W. <phi...@so...> - 2022-12-23 15:15:52
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=7e03a15d8d4f9a6fb50b59353a13f93ed0bafc3c commit 7e03a15d8d4f9a6fb50b59353a13f93ed0bafc3c Author: Philippe Waroquiers <phi...@sk...> Date: Fri Dec 23 16:12:53 2022 +0100 Pass a dummy process_option_state for dynamic options The process_option_state is functionally needed during initial parsing of CLO options. When later changing them, only changing the CLO itself is good enough. But the processing of option needs to have a state. Diff: --- coregrind/m_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/coregrind/m_main.c b/coregrind/m_main.c index f02a8b0eb5..2b4a8748ff 100644 --- a/coregrind/m_main.c +++ b/coregrind/m_main.c @@ -889,9 +889,9 @@ static void process_option (Clo_Mode mode, void VG_(process_dynamic_option) (Clo_Mode mode, HChar *value) { - process_option (mode, value, NULL); - // This is not supposed to change values in process_option_state, - // so we can give a NULL. + struct process_option_state dummy; + process_option (mode, value, &dummy); + // No need to handle a process_option_state once valgrind has started. } /* Peer at previously set up VG_(args_for_valgrind) and do some |
|
From: Paul F. <pa...@so...> - 2022-12-23 13:51:14
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=316282cd3b357fe94cac466754adb42c17fad7d2 commit 316282cd3b357fe94cac466754adb42c17fad7d2 Author: Paul Floyd <pj...@wa...> Date: Fri Dec 23 14:49:39 2022 +0100 Bug 463027 - broken check for MPX instruction support in assembler Diff: --- NEWS | 1 + configure.ac | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index d777d9160c..c9376dcca9 100644 --- a/NEWS +++ b/NEWS @@ -27,6 +27,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. 444110 priv/guest_ppc_toIR.c:36198:31: warning: duplicated 'if' condition. 459476 vgdb: allow address reuse to avoid "address already in use" errorsuse" errors 462830 WARNING: unhandled amd64-freebsd syscall: 474 +463027 broken check for MPX instruction support in assembler To see details of a given bug, visit https://bugs.kde.org/show_bug.cgi?id=XXXXXX diff --git a/configure.ac b/configure.ac index 41047dc2c6..5ae9377119 100755 --- a/configure.ac +++ b/configure.ac @@ -3410,9 +3410,9 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ asm ("bndmov %bnd0,(%rsp)"); asm ("bndldx 3(%rbx,%rdx), %bnd2"); asm ("bnd call foo\n" - bnd jmp end\n" - foo: bnd ret\n" - end: nop"); + "bnd jmp end\n" + "foo: bnd ret\n" + "end: nop"); } while (0) ]])], [ ac_have_as_mpx=yes |
|
From: Paul F. <pa...@so...> - 2022-12-22 22:40:13
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=8b0105ba63ab18af6a17e55daafda6ab1371c141 commit 8b0105ba63ab18af6a17e55daafda6ab1371c141 Author: Paul Floyd <pj...@wa...> Date: Thu Dec 22 23:38:54 2022 +0100 Improve FreeBSD preadv/pwritev error messages Also correct a copy paste error in generic readv. Diff: --- coregrind/m_syswrap/syswrap-amd64-freebsd.c | 17 ++++++++++------- coregrind/m_syswrap/syswrap-generic.c | 4 ++-- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/coregrind/m_syswrap/syswrap-amd64-freebsd.c b/coregrind/m_syswrap/syswrap-amd64-freebsd.c index 2ef0f89451..3b2f9397d1 100644 --- a/coregrind/m_syswrap/syswrap-amd64-freebsd.c +++ b/coregrind/m_syswrap/syswrap-amd64-freebsd.c @@ -321,6 +321,7 @@ PRE(sys_preadv) { Int i; struct vki_iovec * vec; + char buf[sizeof("preadv(iov[])") + 11]; *flags |= SfMayBlock; PRINT("sys_preadv ( %" FMT_REGWORD "d, %#" FMT_REGWORD "x, %" FMT_REGWORD "d, %" FMT_REGWORD "d )", SARG1, ARG2, SARG3, SARG4); @@ -333,12 +334,12 @@ PRE(sys_preadv) if ((Int)ARG3 > 0) PRE_MEM_READ( "preadv(iov)", ARG2, ARG3 * sizeof(struct vki_iovec) ); - // @todo PJF improve this like readv if (ML_(safe_to_deref)((struct vki_iovec *)ARG2, ARG3 * sizeof(struct vki_iovec))) { vec = (struct vki_iovec *)(Addr)ARG2; - for (i = 0; i < (Int)ARG3; i++) - PRE_MEM_WRITE( "preadv(iov[...])", - (Addr)vec[i].iov_base, vec[i].iov_len ); + for (i = 0; i < (Int)ARG3; i++) { + VG_(sprintf)(buf, "preadv(iov[%d])", i); + PRE_MEM_WRITE(buf, (Addr)vec[i].iov_base, vec[i].iov_len); + } } } } @@ -368,6 +369,7 @@ PRE(sys_pwritev) { Int i; struct vki_iovec * vec; + char buf[sizeof("pwritev(iov[])") + 11]; *flags |= SfMayBlock; PRINT("sys_pwritev ( %" FMT_REGWORD "d, %#" FMT_REGWORD "x, %" FMT_REGWORD "d, %" FMT_REGWORD "d )", SARG1, ARG2, SARG3, SARG4); @@ -383,9 +385,10 @@ PRE(sys_pwritev) PRE_MEM_READ( "pwritev(vector)", ARG2, ARG3 * sizeof(struct vki_iovec) ); if (ML_(safe_to_deref)((struct vki_iovec *)ARG2, ARG3 * sizeof(struct vki_iovec))) { vec = (struct vki_iovec *)(Addr)ARG2; - for (i = 0; i < (Int)ARG3; i++) - PRE_MEM_READ( "pwritev(iov[...])", - (Addr)vec[i].iov_base, vec[i].iov_len ); + for (i = 0; i < (Int)ARG3; i++) { + VG_(sprintf)(buf, "pwritev(iov[%d])", i); + PRE_MEM_READ(buf, (Addr)vec[i].iov_base, vec[i].iov_len ); + } } } } diff --git a/coregrind/m_syswrap/syswrap-generic.c b/coregrind/m_syswrap/syswrap-generic.c index 4e10eea9fe..efdae60e10 100644 --- a/coregrind/m_syswrap/syswrap-generic.c +++ b/coregrind/m_syswrap/syswrap-generic.c @@ -4409,7 +4409,7 @@ PRE(sys_readv) { Int i; struct vki_iovec * vec; - char buf[sizeof("writev(vector[])") + 11]; + char buf[sizeof("readv(vector[])") + 11]; *flags |= SfMayBlock; PRINT("sys_readv ( %" FMT_REGWORD "u, %#" FMT_REGWORD "x, %" FMT_REGWORD "u )", ARG1, ARG2, ARG3); @@ -4425,7 +4425,7 @@ PRE(sys_readv) if (ML_(safe_to_deref)((const void*)ARG2, ARG3*sizeof(struct vki_iovec *))) { vec = (struct vki_iovec *)(Addr)ARG2; for (i = 0; i < (Int)ARG3; i++) { - VG_(sprintf)(buf, "writev(vector[%d])", i); + VG_(sprintf)(buf, "readv(vector[%d])", i); PRE_MEM_WRITE(buf, (Addr)vec[i].iov_base, vec[i].iov_len ); } } |
|
From: Paul F. <pa...@so...> - 2022-12-22 22:10:45
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=5b524084061b9d6d40d30cf41e2da70bce4682e0 commit 5b524084061b9d6d40d30cf41e2da70bce4682e0 Author: Paul Floyd <pj...@wa...> Date: Thu Dec 22 23:08:45 2022 +0100 Bug 462830 - WARNING: unhandled amd64-freebsd syscall: 474 Add syscall wrappers for sctp_generic_recvmsg and sctp_generic_sendmsg on FreeBSD. Diff: --- .gitignore | 2 + NEWS | 1 + coregrind/m_syswrap/priv_syswrap-freebsd.h | 2 + coregrind/m_syswrap/priv_syswrap-generic.h | 3 + coregrind/m_syswrap/syswrap-amd64-freebsd.c | 5 +- coregrind/m_syswrap/syswrap-freebsd.c | 75 +++++++++++++- coregrind/m_syswrap/syswrap-generic.c | 13 ++- coregrind/m_syswrap/syswrap-x86-freebsd.c | 4 +- include/vki/vki-freebsd.h | 22 ++++ memcheck/tests/freebsd/Makefile.am | 10 +- memcheck/tests/freebsd/scalar.c | 16 +++ memcheck/tests/freebsd/scalar.stderr.exp | 145 ++++++++++++++++++++++++++- memcheck/tests/freebsd/scalar.stderr.exp-x86 | 143 ++++++++++++++++++++++++++ memcheck/tests/freebsd/sctp.c | 122 ++++++++++++++++++++++ memcheck/tests/freebsd/sctp.stderr.exp | 0 memcheck/tests/freebsd/sctp.stdout.exp | 3 + memcheck/tests/freebsd/sctp.vgtest | 3 + memcheck/tests/freebsd/sctp2.c | 42 ++++++++ memcheck/tests/freebsd/sctp2.stderr.exp | 75 ++++++++++++++ memcheck/tests/freebsd/sctp2.stdout.exp | 0 memcheck/tests/freebsd/sctp2.vgtest | 2 + 21 files changed, 669 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index 01d47ebf85..a72b1dcae0 100644 --- a/.gitignore +++ b/.gitignore @@ -1349,6 +1349,8 @@ /memcheck/tests/freebsd/452275 /memcheck/tests/freebsd/errno_aligned_allocs /memcheck/tests/freebsd/setproctitle +/memcheck/tests/freebsd/sctp +/memcheck/tests/freebsd/sctp2 # /memcheck/tests/amd64-freebsd /memcheck/tests/amd64-freebsd/*.stderr.diff diff --git a/NEWS b/NEWS index 2fb98e3aba..d777d9160c 100644 --- a/NEWS +++ b/NEWS @@ -26,6 +26,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. 351857 confusing error message about valid command line option 444110 priv/guest_ppc_toIR.c:36198:31: warning: duplicated 'if' condition. 459476 vgdb: allow address reuse to avoid "address already in use" errorsuse" errors +462830 WARNING: unhandled amd64-freebsd syscall: 474 To see details of a given bug, visit https://bugs.kde.org/show_bug.cgi?id=XXXXXX diff --git a/coregrind/m_syswrap/priv_syswrap-freebsd.h b/coregrind/m_syswrap/priv_syswrap-freebsd.h index 5bce4ef80e..dd065c6f58 100644 --- a/coregrind/m_syswrap/priv_syswrap-freebsd.h +++ b/coregrind/m_syswrap/priv_syswrap-freebsd.h @@ -419,6 +419,8 @@ DECL_TEMPLATE(freebsd, sys_abort2) // 463 DECL_TEMPLATE(freebsd, sys_thr_set_name) // 464 DECL_TEMPLATE(freebsd, sys_aio_fsync) // 465 DECL_TEMPLATE(freebsd, sys_rtprio_thread) // 466 +DECL_TEMPLATE(freebsd, sys_sctp_generic_sendmsg) // 472 +DECL_TEMPLATE(freebsd, sys_sctp_generic_recvmsg) // 474 DECL_TEMPLATE(freebsd, sys_pread) // 475 DECL_TEMPLATE(freebsd, sys_pwrite) // 476 DECL_TEMPLATE(freebsd, sys_mmap) // 477 diff --git a/coregrind/m_syswrap/priv_syswrap-generic.h b/coregrind/m_syswrap/priv_syswrap-generic.h index 5d2709adb7..41d1bb8f2c 100644 --- a/coregrind/m_syswrap/priv_syswrap-generic.h +++ b/coregrind/m_syswrap/priv_syswrap-generic.h @@ -86,6 +86,9 @@ ML_(notify_core_and_tool_of_munmap) ( Addr a, SizeT len ); extern void ML_(notify_core_and_tool_of_mprotect) ( Addr a, SizeT len, Int prot ); +extern void +ML_(pre_mem_read_sockaddr) ( ThreadId tid, const HChar *description, + struct vki_sockaddr *sa, UInt salen ); extern void ML_(buf_and_len_pre_check) ( ThreadId tid, Addr buf_p, Addr buflen_p, const HChar* buf_s, const HChar* buflen_s ); diff --git a/coregrind/m_syswrap/syswrap-amd64-freebsd.c b/coregrind/m_syswrap/syswrap-amd64-freebsd.c index 9ddd34c77a..2ef0f89451 100644 --- a/coregrind/m_syswrap/syswrap-amd64-freebsd.c +++ b/coregrind/m_syswrap/syswrap-amd64-freebsd.c @@ -325,14 +325,15 @@ PRE(sys_preadv) PRINT("sys_preadv ( %" FMT_REGWORD "d, %#" FMT_REGWORD "x, %" FMT_REGWORD "d, %" FMT_REGWORD "d )", SARG1, ARG2, SARG3, SARG4); PRE_REG_READ4(ssize_t, "preadv", - int, fd, const struct iovec *, iovr, + int, fd, const struct iovec *, iov, int, iovcnt, vki_off_t, offset); if (!ML_(fd_allowed)(ARG1, "preadv", tid, False)) { SET_STATUS_Failure( VKI_EBADF ); } else { - if ((Int)ARG3 >= 0) + if ((Int)ARG3 > 0) PRE_MEM_READ( "preadv(iov)", ARG2, ARG3 * sizeof(struct vki_iovec) ); + // @todo PJF improve this like readv if (ML_(safe_to_deref)((struct vki_iovec *)ARG2, ARG3 * sizeof(struct vki_iovec))) { vec = (struct vki_iovec *)(Addr)ARG2; for (i = 0; i < (Int)ARG3; i++) diff --git a/coregrind/m_syswrap/syswrap-freebsd.c b/coregrind/m_syswrap/syswrap-freebsd.c index 0dc76854ef..dc43050070 100644 --- a/coregrind/m_syswrap/syswrap-freebsd.c +++ b/coregrind/m_syswrap/syswrap-freebsd.c @@ -4770,11 +4770,28 @@ POST(sys_rtprio_thread) // int sctp_peeloff(int s, sctp_assoc_t id); // @todo + // SYS_sctp_generic_sendmsg 472 // int sctp_generic_sendmsg(int s, void *msg, int msglen, struct sockaddr *to, // socklen_t len, struct sctp_sndrcvinfo *sinfo, int flags); -// @tdo +// +// Not called directly from libc +PRE(sys_sctp_generic_sendmsg) +{ + *flags |= SfMayBlock; + PRINT("sys_sctp_generic_sendmsg ( %" FMT_REGWORD "d, %#" FMT_REGWORD "x, %" FMT_REGWORD "d, %#" FMT_REGWORD "x, %" FMT_REGWORD "d, %#" FMT_REGWORD "x, %" FMT_REGWORD "d )",SARG1,ARG2,ARG3,ARG4,SARG5,ARG6,SARG7); + PRE_REG_READ7(ssize_t, "sctp_generic_sendmsg", + int, s, void *, msg, int, msglen, + struct sockaddr *, to, socklen_t, len, + struct sctp_sndrcvinfo *, sinfo, int, flags); + + PRE_MEM_READ( "sctp_generic_sendmsg(msg)", ARG2, ARG3); + ML_(pre_mem_read_sockaddr) (tid, "sctp_generic_sendmsg(to)", (struct vki_sockaddr *)ARG4, ARG5); + + if (ARG6 != (Addr)NULL) + PRE_MEM_READ( "sctp_generic_sendmsg(sinfo)", ARG6, sizeof(struct vki_sctp_sndrcvinfo)); +} // SYS_sctp_generic_sendmsg_iov 473 // int sctp_generic_sendmsg_iov(int s, struct iovec *iov, int iovlen, @@ -4785,7 +4802,56 @@ POST(sys_rtprio_thread) // int sctp_generic_recvmsg(int s, struct iovec *iov, int iovlen, // struct sockaddr *from, socklen_t *fromlen, // struct sctp_sndrcvinfo *sinfo, int *msgflags); -// @todo +// +// Not called directly from libc +PRE(sys_sctp_generic_recvmsg) +{ + *flags |= SfMayBlock; + PRINT("sys_sctp_generic_recvmsg ( %" FMT_REGWORD "d, %#" FMT_REGWORD "x, %" FMT_REGWORD "d, %#" FMT_REGWORD "x, %#" FMT_REGWORD "x, %#" FMT_REGWORD "x, %#" FMT_REGWORD "x )",SARG1,ARG2,SARG3,ARG4,ARG5,ARG6,ARG7); + PRE_REG_READ7(ssize_t, "sctp_generic_recvmsg", + int, s, struct iovec *, iov, int, iovlen, + struct sockaddr *, from, socklen_t *, fromlen, + struct sctp_sndrcvinfo *, sinfo, int *, msgflags); + + // in the sctp_recvmsg libc wrapper this is always 1 + if ((Int)ARG3 > 0) { + PRE_MEM_READ( "sctp_generic_recvmsg(iov)", ARG2, ARG3 * sizeof(struct vki_iovec) ); + } + if (ML_(safe_to_deref)((const void*)ARG2, ARG3 * sizeof(struct vki_iovec))) { + struct vki_iovec* iovec = (struct vki_iovec*)ARG2; + PRE_MEM_WRITE("sctp_generic_recvmsg(iov.iov_base)", (Addr)iovec->iov_base, iovec->iov_len); + } + + if (ARG4 != (Addr)NULL) + ML_(buf_and_len_pre_check) (tid, ARG4, ARG5, + "sctp_generic_recvmsg(from)", + "sctp_generic_recvmsg(fromlen_in)"); + + if (ARG6 != (Addr)NULL) + PRE_MEM_WRITE("sctp_generic_recvmsg(sinfo)", ARG6, sizeof(struct vki_sctp_sndrcvinfo)); + + if (ARG7 != (Addr)NULL) + PRE_MEM_WRITE("sctp_generic_recvmsg(msgflags)", ARG7, sizeof(int)); +} + +POST(sys_sctp_generic_recvmsg) +{ + vg_assert(SUCCESS); + struct vki_iovec* iovec = (struct vki_iovec*)ARG2; + POST_MEM_WRITE((Addr)iovec->iov_base, iovec->iov_len); + + POST_MEM_WRITE( ARG2, ARG3*sizeof(struct vki_iovec) ); + + if (ARG4 != (Addr)NULL) + ML_(buf_and_len_post_check) (tid, VG_(mk_SysRes_Success)(RES), ARG4, ARG5, + "sctp_generic_recvmsg(fromlen_out)"); + + if (ARG6 != (Addr)NULL) + POST_MEM_WRITE(ARG6, sizeof(struct vki_sctp_sndrcvinfo)); + + if (ARG7 != (Addr)NULL) + POST_MEM_WRITE(ARG7, sizeof(int)); +} // SYS_pread 475 // x86/amd64 @@ -7000,10 +7066,9 @@ const SyscallTableEntry ML_(syscall_table)[] = { BSDXY(__NR_rtprio_thread, sys_rtprio_thread), // 466 // unimpl sctp_peeloff 471 - - // unimpl sctp_generic_sendmsg 472 + BSDX_(__NR_sctp_generic_sendmsg, sys_sctp_generic_sendmsg), // 472 // unimpl sctp_generic_sendmsg_iov 473 - // unimpl sctp_generic_recvmsg 474 + BSDXY(__NR_sctp_generic_recvmsg, sys_sctp_generic_recvmsg), // 474 BSDXY(__NR_pread, sys_pread), // 475 BSDX_(__NR_pwrite, sys_pwrite), // 476 diff --git a/coregrind/m_syswrap/syswrap-generic.c b/coregrind/m_syswrap/syswrap-generic.c index f0796f8ebc..4e10eea9fe 100644 --- a/coregrind/m_syswrap/syswrap-generic.c +++ b/coregrind/m_syswrap/syswrap-generic.c @@ -1121,10 +1121,9 @@ static void check_cmsg_for_fds(ThreadId tid, struct vki_msghdr *msg) } /* GrP kernel ignores sa_len (at least on Darwin); this checks the rest */ -static -void pre_mem_read_sockaddr ( ThreadId tid, - const HChar *description, - struct vki_sockaddr *sa, UInt salen ) +void ML_(pre_mem_read_sockaddr) ( ThreadId tid, + const HChar *description, + struct vki_sockaddr *sa, UInt salen ) { HChar outmsg[VG_(strlen)( description ) + 30]; // large enough struct vki_sockaddr_un* saun = (struct vki_sockaddr_un *)sa; @@ -1524,7 +1523,7 @@ ML_(generic_PRE_sys_bind) ( ThreadId tid, { /* int bind(int sockfd, struct sockaddr *my_addr, int addrlen); */ - pre_mem_read_sockaddr( + ML_(pre_mem_read_sockaddr) ( tid, "socketcall.bind(my_addr.%s)", (struct vki_sockaddr *) arg1, arg2 ); @@ -1580,7 +1579,7 @@ ML_(generic_PRE_sys_sendto) ( ThreadId tid, PRE_MEM_READ( "socketcall.sendto(msg)", arg1, /* msg */ arg2 /* len */ ); - pre_mem_read_sockaddr( + ML_(pre_mem_read_sockaddr) ( tid, "socketcall.sendto(to.%s)", (struct vki_sockaddr *) arg4, arg5 ); @@ -1673,7 +1672,7 @@ ML_(generic_PRE_sys_connect) ( ThreadId tid, { /* int connect(int sockfd, struct sockaddr *serv_addr, int addrlen ); */ - pre_mem_read_sockaddr( tid, + ML_(pre_mem_read_sockaddr) ( tid, "socketcall.connect(serv_addr.%s)", (struct vki_sockaddr *) arg1, arg2); } diff --git a/coregrind/m_syswrap/syswrap-x86-freebsd.c b/coregrind/m_syswrap/syswrap-x86-freebsd.c index 4a2c35d58c..0e92270144 100644 --- a/coregrind/m_syswrap/syswrap-x86-freebsd.c +++ b/coregrind/m_syswrap/syswrap-x86-freebsd.c @@ -750,13 +750,13 @@ PRE(sys_preadv) PRINT("sys_preadv ( %" FMT_REGWORD "d, %#" FMT_REGWORD "x, %" FMT_REGWORD "d, %llu )", SARG1, ARG2, SARG3, MERGE64(ARG4,ARG5)); PRE_REG_READ5(ssize_t, "preadv", - int, fd, const struct iovec *, iovr, + int, fd, const struct iovec *, iov, int, iovcnt, vki_uint32_t, MERGE64_FIRST(offset), vki_uint32_t, MERGE64_SECOND(offset)); if (!ML_(fd_allowed)(ARG1, "preadv", tid, False)) { SET_STATUS_Failure( VKI_EBADF ); } else { - if ((Int)ARG3 >= 0) + if ((Int)ARG3 > 0) PRE_MEM_READ( "preadv(iov)", ARG2, ARG3 * sizeof(struct vki_iovec) ); if (ML_(safe_to_deref)((struct vki_iovec *)ARG2, ARG3 * sizeof(struct vki_iovec))) { diff --git a/include/vki/vki-freebsd.h b/include/vki/vki-freebsd.h index 72633d471d..936abc8e3a 100644 --- a/include/vki/vki-freebsd.h +++ b/include/vki/vki-freebsd.h @@ -771,6 +771,28 @@ struct vki_sockaddr_in6 { vki_uint32_t sin6_scope_id; /* scope id (new in RFC2553) */ }; +//---------------------------------------------------------------------- +// From netinet/sctp_uio.h +//---------------------------------------------------------------------- +#define VKI_SCTP_ALIGN_RESV_PAD 92 + +typedef vki_uint32_t vki_sctp_assoc_t; + +struct vki_sctp_sndrcvinfo { + vki_uint16_t sinfo_stream; + vki_uint16_t sinfo_ssn; + vki_uint16_t sinfo_flags; + vki_uint32_t sinfo_ppid; + vki_uint32_t sinfo_context; + vki_uint32_t sinfo_timetolive; + vki_uint32_t sinfo_tsn; + vki_uint32_t sinfo_cumtsn; + vki_sctp_assoc_t sinfo_assoc_id; + vki_uint16_t sinfo_keynumber; + vki_uint16_t sinfo_keynumber_valid; + vki_uint8_t __reserve_pad[VKI_SCTP_ALIGN_RESV_PAD]; +}; + //---------------------------------------------------------------------- // From sys/un.h //---------------------------------------------------------------------- diff --git a/memcheck/tests/freebsd/Makefile.am b/memcheck/tests/freebsd/Makefile.am index a5a06f7777..5a6f29549f 100644 --- a/memcheck/tests/freebsd/Makefile.am +++ b/memcheck/tests/freebsd/Makefile.am @@ -84,7 +84,13 @@ EXTRA_DIST = \ errno_aligned_allocs.stderr.exp \ setproctitle.vgtest \ setproctitle.stderr.exp \ - setproctitle.stdout.exp + setproctitle.stdout.exp \ + sctp.vgtest \ + sctp.stderr.exp \ + sctp.stdout.exp \ + sctp2.vgtest \ + sctp2.stderr.exp \ + sctp2.stdout.exp check_PROGRAMS = \ statfs pdfork_pdkill getfsstat inlinfo inlinfo_nested.so extattr \ @@ -92,7 +98,7 @@ check_PROGRAMS = \ 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 \ - setproctitle + setproctitle sctp sctp2 AM_CFLAGS += $(AM_FLAG_M3264_PRI) AM_CXXFLAGS += $(AM_FLAG_M3264_PRI) diff --git a/memcheck/tests/freebsd/scalar.c b/memcheck/tests/freebsd/scalar.c index 0a6eabeeb0..d75a894b09 100644 --- a/memcheck/tests/freebsd/scalar.c +++ b/memcheck/tests/freebsd/scalar.c @@ -1571,11 +1571,27 @@ int main(void) // sctp_peeloff 471 // sctp_generic_sendmsg 472 + GO(SYS_sctp_generic_sendmsg, "7s 1m"); + SY(SYS_sctp_generic_sendmsg, x0+1, x0+2, x0+3, x0+4, x0+5, x0+6, x0+7); FAIL; // sctp_generic_sendmsg_iov 473 // sctp_generic_recvmsg 474 + GO(SYS_sctp_generic_recvmsg, "7s 4m"); + SY(SYS_sctp_generic_recvmsg, x0+1, x0+2, x0+300, x0+4, x0+5, x0+6, x0+7); FAIL; + { + socklen_t fromlen = 64; + struct iovec iov; + GO(SYS_sctp_generic_recvmsg, "6s 4m"); + SY(SYS_sctp_generic_recvmsg, x0+1, x0+2, x0+300, x0+4, &fromlen, x0+6, x0+7); FAIL; + + iov.iov_base = x0+8; + iov.iov_len = x0+9; + + GO(SYS_sctp_generic_recvmsg, "6s 6m"); + SY(SYS_sctp_generic_recvmsg, x0+1, &iov, 1, x0+4, x0+5, x0+6, x0+7); FAIL; + } /* SYS_pread 475 */ GO(SYS_pread, "4s 1m"); diff --git a/memcheck/tests/freebsd/scalar.stderr.exp b/memcheck/tests/freebsd/scalar.stderr.exp index 80fdf09af2..2595bd38c5 100644 --- a/memcheck/tests/freebsd/scalar.stderr.exp +++ b/memcheck/tests/freebsd/scalar.stderr.exp @@ -2030,7 +2030,7 @@ Syscall param lutimes(times) points to unaddressable byte(s) Syscall param preadv(fd) contains uninitialised byte(s) ... -Syscall param preadv(iovr) contains uninitialised byte(s) +Syscall param preadv(iov) contains uninitialised byte(s) ... Syscall param preadv(iovcnt) contains uninitialised byte(s) @@ -3680,6 +3680,149 @@ Syscall param rtprio_thread(rtp#set) points to unaddressable byte(s) ... Address 0x........ is not stack'd, malloc'd or (recently) free'd +--------------------------------------------------------- +472:SYS_sctp_generic_sendmsg 7s 1m +--------------------------------------------------------- +Syscall param sctp_generic_sendmsg(s) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_sendmsg(msg) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_sendmsg(msglen) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_sendmsg(to) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_sendmsg(len) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_sendmsg(sinfo) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_sendmsg(flags) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_sendmsg(sinfo) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +--------------------------------------------------------- +474:SYS_sctp_generic_recvmsg 7s 4m +--------------------------------------------------------- +Syscall param sctp_generic_recvmsg(s) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_recvmsg(iov) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_recvmsg(iovlen) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_recvmsg(from) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_recvmsg(fromlen) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_recvmsg(sinfo) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_recvmsg(msgflags) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_recvmsg(iov) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +Syscall param sctp_generic_recvmsg(fromlen_in) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +Syscall param sctp_generic_recvmsg(sinfo) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +Syscall param sctp_generic_recvmsg(msgflags) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +--------------------------------------------------------- +474:SYS_sctp_generic_recvmsg 6s 4m +--------------------------------------------------------- +Syscall param sctp_generic_recvmsg(s) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_recvmsg(iov) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_recvmsg(iovlen) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_recvmsg(from) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_recvmsg(sinfo) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_recvmsg(msgflags) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_recvmsg(iov) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +Syscall param sctp_generic_recvmsg(from) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +Syscall param sctp_generic_recvmsg(sinfo) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +Syscall param sctp_generic_recvmsg(msgflags) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +--------------------------------------------------------- +474:SYS_sctp_generic_recvmsg 6s 6m +--------------------------------------------------------- +Syscall param sctp_generic_recvmsg(s) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_recvmsg(from) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_recvmsg(fromlen) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_recvmsg(sinfo) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_recvmsg(msgflags) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_recvmsg(iov) points to uninitialised byte(s) + ... + Address 0x........ is on thread 1's stack + +Syscall param sctp_generic_recvmsg(iov.iov_base) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +Syscall param sctp_generic_recvmsg(fromlen_in) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +Syscall param sctp_generic_recvmsg(sinfo) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +Syscall param sctp_generic_recvmsg(msgflags) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + --------------------------------------------------------- 475: SYS_pread 4s 1m --------------------------------------------------------- diff --git a/memcheck/tests/freebsd/scalar.stderr.exp-x86 b/memcheck/tests/freebsd/scalar.stderr.exp-x86 index 9e0b3acb78..25687fec67 100644 --- a/memcheck/tests/freebsd/scalar.stderr.exp-x86 +++ b/memcheck/tests/freebsd/scalar.stderr.exp-x86 @@ -3689,6 +3689,149 @@ Syscall param rtprio_thread(rtp#set) points to unaddressable byte(s) ... Address 0x........ is not stack'd, malloc'd or (recently) free'd +--------------------------------------------------------- +472:SYS_sctp_generic_sendmsg 7s 1m +--------------------------------------------------------- +Syscall param sctp_generic_sendmsg(s) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_sendmsg(msg) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_sendmsg(msglen) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_sendmsg(to) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_sendmsg(len) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_sendmsg(sinfo) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_sendmsg(flags) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_sendmsg(sinfo) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +--------------------------------------------------------- +474:SYS_sctp_generic_recvmsg 7s 4m +--------------------------------------------------------- +Syscall param sctp_generic_recvmsg(s) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_recvmsg(iov) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_recvmsg(iovlen) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_recvmsg(from) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_recvmsg(fromlen) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_recvmsg(sinfo) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_recvmsg(msgflags) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_recvmsg(iov) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +Syscall param sctp_generic_recvmsg(fromlen_in) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +Syscall param sctp_generic_recvmsg(sinfo) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +Syscall param sctp_generic_recvmsg(msgflags) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +--------------------------------------------------------- +474:SYS_sctp_generic_recvmsg 6s 4m +--------------------------------------------------------- +Syscall param sctp_generic_recvmsg(s) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_recvmsg(iov) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_recvmsg(iovlen) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_recvmsg(from) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_recvmsg(sinfo) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_recvmsg(msgflags) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_recvmsg(iov) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +Syscall param sctp_generic_recvmsg(from) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +Syscall param sctp_generic_recvmsg(sinfo) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +Syscall param sctp_generic_recvmsg(msgflags) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +--------------------------------------------------------- +474:SYS_sctp_generic_recvmsg 6s 6m +--------------------------------------------------------- +Syscall param sctp_generic_recvmsg(s) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_recvmsg(from) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_recvmsg(fromlen) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_recvmsg(sinfo) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_recvmsg(msgflags) contains uninitialised byte(s) + ... + +Syscall param sctp_generic_recvmsg(iov) points to uninitialised byte(s) + ... + Address 0x........ is on thread 1's stack + +Syscall param sctp_generic_recvmsg(iov.iov_base) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +Syscall param sctp_generic_recvmsg(fromlen_in) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +Syscall param sctp_generic_recvmsg(sinfo) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + +Syscall param sctp_generic_recvmsg(msgflags) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + --------------------------------------------------------- 475: SYS_pread 4s 1m --------------------------------------------------------- diff --git a/memcheck/tests/freebsd/sctp.c b/memcheck/tests/freebsd/sctp.c new file mode 100644 index 0000000000..1a74c86a19 --- /dev/null +++ b/memcheck/tests/freebsd/sctp.c @@ -0,0 +1,122 @@ +/* This is based on /src/tools/test/stress2/misc/sctp.sh + * but it uses fork and the server exits rather than + * loops indefinitely */ + +#include <sys/types.h> +#include <sys/socket.h> +#include <unistd.h> +#include <arpa/inet.h> +#include <libgen.h> +#include <netinet/in.h> +#include <netinet/sctp.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +static int my_port_num = 62324; + +static void +die(const char *s) +{ + perror(s); + exit(1); +} + +static void +server(void) +{ + struct sctp_sndrcvinfo sndrcvinfo; + struct sockaddr_in servaddr = { + .sin_family = AF_INET, + .sin_addr.s_addr = htonl(INADDR_ANY), + .sin_port = htons(my_port_num), + }; + struct sctp_initmsg initmsg = { + .sinit_num_ostreams = 5, + .sinit_max_instreams = 5, + .sinit_max_attempts = 4, + }; + int listen_fd, conn_fd, flags, ret, in; + + listen_fd = socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP); + if (listen_fd < 0) + die("socket"); + + ret = bind(listen_fd, (struct sockaddr *) &servaddr, sizeof(servaddr)); + if (ret < 0) + die("bind"); + + ret = setsockopt(listen_fd, IPPROTO_SCTP, SCTP_INITMSG, &initmsg, + sizeof(initmsg)); + if (ret < 0) + die("setsockopt"); + + ret = listen(listen_fd, initmsg.sinit_max_instreams); + if (ret < 0) + die("listen"); + + char buffer[1024]; + + printf("Waiting for connection\n"); + fflush(stdout); + + conn_fd = accept(listen_fd, (struct sockaddr *) NULL, NULL); + if(conn_fd < 0) + die("accept()"); + + printf("New client connected\n"); + fflush(stdout); + + /* Note that flags is uninitialized here */ + in = sctp_recvmsg(conn_fd, buffer, sizeof(buffer), NULL, 0, + &sndrcvinfo, &flags); + if (in > 0) { + printf("Received data: %s\n", buffer); + fflush(stdout); + } + + close(conn_fd); +} + +static void +client(void) +{ + struct sockaddr_in servaddr = { + .sin_family = AF_INET, + .sin_port = htons(my_port_num), + .sin_addr.s_addr = inet_addr("127.0.0.1"), + }; + int conn_fd, ret; + const char *msg = "Hello, Server!"; + + conn_fd = socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP); + if (conn_fd < 0) + die("socket()"); + + ret = connect(conn_fd, (struct sockaddr *) &servaddr, sizeof(servaddr)); + if (ret < 0) + die("connect()"); + + ret = sctp_sendmsg(conn_fd, (void *) msg, strlen(msg) + 1, NULL, 0, 0, 0, 0, 0, 0 ); + if (ret < 0) + die("sctp_sendmsg"); + + close(conn_fd); +} + +int +main(int argc __unused, char *argv[]) +{ + switch (fork()) + { + case 0: + sleep(1); + client(); + exit(EXIT_SUCCESS); + default: + server(); + exit(EXIT_SUCCESS); + case -1: + exit(EXIT_FAILURE); + } +} diff --git a/memcheck/tests/freebsd/sctp.stderr.exp b/memcheck/tests/freebsd/sctp.stderr.exp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/memcheck/tests/freebsd/sctp.stdout.exp b/memcheck/tests/freebsd/sctp.stdout.exp new file mode 100644 index 0000000000..a4b95fadf3 --- /dev/null +++ b/memcheck/tests/freebsd/sctp.stdout.exp @@ -0,0 +1,3 @@ +Waiting for connection +New client connected +Received data: Hello, Server! diff --git a/memcheck/tests/freebsd/sctp.vgtest b/memcheck/tests/freebsd/sctp.vgtest new file mode 100644 index 0000000000..a96b5c1054 --- /dev/null +++ b/memcheck/tests/freebsd/sctp.vgtest @@ -0,0 +1,3 @@ +prereq: kldstat -m sctp > /dev/null +vgopts: -q --trace-children=yes +prog: sctp diff --git a/memcheck/tests/freebsd/sctp2.c b/memcheck/tests/freebsd/sctp2.c new file mode 100644 index 0000000000..4c4b3299f6 --- /dev/null +++ b/memcheck/tests/freebsd/sctp2.c @@ -0,0 +1,42 @@ + +#include <sys/types.h> +#include <sys/socket.h> +#include <unistd.h> +#include <arpa/inet.h> +#include <libgen.h> +#include <netinet/in.h> +#include <netinet/sctp.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <stdint.h> +#include "../../memcheck.h" + +int main() +{ + int conn_fd; + char msg[10]; + char buffer[10]; + struct sockaddr to; + socklen_t tolen = sizeof (struct sockaddr); + uint32_t ppid; + uint32_t flags; + uint16_t stream_no; + uint32_t timetolive; + uint32_t context; + struct sctp_sndrcvinfo sinfo; + int rflags; + size_t undef_size = 10U; + + VALGRIND_MAKE_MEM_UNDEFINED(&undef_size, sizeof(undef_size)); + VALGRIND_MAKE_MEM_UNDEFINED(&tolen, sizeof(tolen)); + + sctp_sendmsg(conn_fd, msg, undef_size, &to, tolen, ppid, flags, stream_no, timetolive, context); + + VALGRIND_MAKE_MEM_NOACCESS(&to, sizeof(to)); + VALGRIND_MAKE_MEM_UNDEFINED(&tolen, sizeof(tolen)); + VALGRIND_MAKE_MEM_NOACCESS(&sinfo, sizeof(sinfo)); + VALGRIND_MAKE_MEM_NOACCESS(&rflags, sizeof(rflags)); + + sctp_recvmsg(conn_fd, buffer, undef_size, &to, &tolen, &sinfo, &rflags); +} diff --git a/memcheck/tests/freebsd/sctp2.stderr.exp b/memcheck/tests/freebsd/sctp2.stderr.exp new file mode 100644 index 0000000000..d13a4e0f87 --- /dev/null +++ b/memcheck/tests/freebsd/sctp2.stderr.exp @@ -0,0 +1,75 @@ + +Syscall param sctp_generic_sendmsg(s) contains uninitialised byte(s) + ... + by 0x........: main (sctp2.c:34) + +Syscall param sctp_generic_sendmsg(msglen) contains uninitialised byte(s) + ... + by 0x........: main (sctp2.c:34) + +Syscall param sctp_generic_sendmsg(len) contains uninitialised byte(s) + ... + by 0x........: main (sctp2.c:34) + +Syscall param sctp_generic_sendmsg(msg) points to uninitialised byte(s) + ... + by 0x........: main (sctp2.c:34) + Address 0x........ is on thread 1's stack + in frame #2, created by main (sctp2.c:16) + +Syscall param sctp_generic_sendmsg(to) points to uninitialised byte(s) + ... + by 0x........: main (sctp2.c:34) + Address 0x........ is on thread 1's stack + in frame #2, created by main (sctp2.c:16) + +Syscall param sctp_generic_sendmsg(sinfo) points to uninitialised byte(s) + ... + by 0x........: main (sctp2.c:34) + Address 0x........ is on thread 1's stack + in frame #1, created by sctp_sendmsg (???:) + +Syscall param sctp_generic_recvmsg(s) contains uninitialised byte(s) + ... + by 0x........: main (sctp2.c:41) + +Syscall param sctp_generic_recvmsg(iov) points to uninitialised byte(s) + ... + by 0x........: main (sctp2.c:41) + Address 0x........ is on thread 1's stack + in frame #1, created by sctp_recvmsg (???:) + +Syscall param sctp_generic_recvmsg(fromlen_in) points to uninitialised byte(s) + ... + by 0x........: main (sctp2.c:41) + Address 0x........ is on thread 1's stack + in frame #2, created by main (sctp2.c:16) + +Syscall param sctp_generic_recvmsg(from) points to unaddressable byte(s) + ... + by 0x........: main (sctp2.c:41) + Address 0x........ is on thread 1's stack + in frame #2, created by main (sctp2.c:16) + +Syscall param sctp_generic_recvmsg(sinfo) points to unaddressable byte(s) + ... + by 0x........: main (sctp2.c:41) + Address 0x........ is on thread 1's stack + in frame #2, created by main (sctp2.c:16) + +Syscall param sctp_generic_recvmsg(msgflags) points to unaddressable byte(s) + ... + by 0x........: main (sctp2.c:41) + Address 0x........ is on thread 1's stack + in frame #2, created by main (sctp2.c:16) + + +HEAP SUMMARY: + in use at exit: 0 bytes in 0 blocks + total heap usage: 0 allocs, 0 frees, 0 bytes allocated + +For a detailed leak analysis, rerun with: --leak-check=full + +Use --track-origins=yes to see where uninitialised values come from +For lists of detected and suppressed errors, rerun with: -s +ERROR SUMMARY: 14 errors from 12 contexts (suppressed: 0 from 0) diff --git a/memcheck/tests/freebsd/sctp2.stdout.exp b/memcheck/tests/freebsd/sctp2.stdout.exp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/memcheck/tests/freebsd/sctp2.vgtest b/memcheck/tests/freebsd/sctp2.vgtest new file mode 100644 index 0000000000..5c39f1203c --- /dev/null +++ b/memcheck/tests/freebsd/sctp2.vgtest @@ -0,0 +1,2 @@ +prereq: kldstat -m sctp > /dev/null +prog: sctp2 |
|
From: Paul F. <pa...@so...> - 2022-12-22 08:31:43
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=35bb01dd450bfe3ba658ec5b58bc9f47dfc4c2aa commit 35bb01dd450bfe3ba658ec5b58bc9f47dfc4c2aa Author: Paul Floyd <pj...@wa...> Date: Thu Dec 22 09:30:45 2022 +0100 FreeBSD: make amd64 aspace max mem 128Gbytes Diff: --- NEWS | 2 ++ coregrind/m_aspacemgr/aspacemgr-linux.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 40603494b5..2fb98e3aba 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,8 @@ AMD64/macOS 10.13 and nanoMIPS/Linux. * ==================== CORE CHANGES =================== +* Make the address space limit on FreeBSD amd64 128Gbytes + (the same as Linux and Solaris, it was 32Gbytes) * ==================== FIXED BUGS ==================== diff --git a/coregrind/m_aspacemgr/aspacemgr-linux.c b/coregrind/m_aspacemgr/aspacemgr-linux.c index 933d6d9de2..00a42ffe6e 100644 --- a/coregrind/m_aspacemgr/aspacemgr-linux.c +++ b/coregrind/m_aspacemgr/aspacemgr-linux.c @@ -1662,7 +1662,7 @@ Addr VG_(am_startup) ( Addr sp_at_startup ) aspacem_maxAddr = VG_PGROUNDDN( sp_at_startup ) - 1; # else - aspacem_maxAddr = (Addr) (Addr)0x800000000UL - 1; // 32G + aspacem_maxAddr = (Addr)0x2000000000ULL - 1; // 128G # ifdef ENABLE_INNER { Addr cse = VG_PGROUNDDN( sp_at_startup ) - 1; if (aspacem_maxAddr > cse) |
|
From: Paul F. <pa...@so...> - 2022-12-22 08:10:59
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=1c61a442b1973d9269140b332fbc6acc64286f08 commit 1c61a442b1973d9269140b332fbc6acc64286f08 Author: Paul Floyd <pj...@wa...> Date: Thu Dec 22 09:09:52 2022 +0100 FreeBSD: add a check that the mqueuefs kernel module is loaded for the none/tests/mq regtest Diff: --- none/tests/mq.vgtest | 1 + 1 file changed, 1 insertion(+) diff --git a/none/tests/mq.vgtest b/none/tests/mq.vgtest index 8a5fe3fc3e..9ff20e38c8 100644 --- a/none/tests/mq.vgtest +++ b/none/tests/mq.vgtest @@ -1 +1,2 @@ +prereq: ( ! ../../tests/os_test freebsd ) || ( kldstat -m mqueuefs > /dev/null ) prog: mq |
|
From: Feiyang C. <chr...@gm...> - 2022-12-07 02:27:41
|
Ping :) |