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
(32) |
Oct
|
Nov
|
Dec
|
|
From: Nicholas N. <n.n...@gm...> - 2023-04-03 09:29:43
|
Hi, Cachegrind has an option `--cache-sim`. If you run with `--cache-sim=yes` (the default) it tells it Cachegrind to do a full cache simulation with lots of events: Ir, I1mr, ILmr, Dr, D1mr, DLmr, Dw, D1mw, DLmw. If you run with `--cache-sim=no` then the cache simulation is disabled and you just get one event: Ir. (This is "instruction cache reads", which is equivalent to "instructions executed".) I have been using `--cache-sim=no` almost exclusively for a long time. The cache simulation done by Valgrind is an approximation of the memory hierarchy of a 2002 AMD Athlon processor. Its accuracy for a modern memory hierarchy with three levels of cache, prefetching, non-LRU replacement, and who-knows-what-else is likely to be low. If you want to accurately know about cache behaviour you'd be much better off using hardware counters via `perf` or some other profiler. But `--cache-sim=no` is still very useful because instruction execution counts are still very useful. Therefore, I propose changing the default to `--cache-sim=no`. Does anyone have any objections to this? Thanks. Nick |
|
From: Paul F. <pa...@so...> - 2023-04-02 13:28:48
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=0641a27ffb1969f6a6ff26fc3831588beb11ed29 commit 0641a27ffb1969f6a6ff26fc3831588beb11ed29 Author: Paul Floyd <pj...@wa...> Date: Sun Apr 2 15:28:21 2023 +0200 Darwin regtest: update strchr filter Diff: --- memcheck/tests/filter_strchr | 1 + 1 file changed, 1 insertion(+) diff --git a/memcheck/tests/filter_strchr b/memcheck/tests/filter_strchr index b770c32051..a00d7d01a5 100755 --- a/memcheck/tests/filter_strchr +++ b/memcheck/tests/filter_strchr @@ -6,4 +6,5 @@ sed -e "s/: strchr (vg_replace_strmem.c:/: index (vg_replace_strmem.c:/; s/: _platform_strchr (vg_replace_strmem.c:/: index (vg_replace_strmem.c:/; s/: _platform_strchr\$VARIANT\$Generic (vg_replace_strmem.c:/: index (vg_replace_strmem.c:/; s/: _platform_strchr\$VARIANT\$Haswell (vg_replace_strmem.c:/: index (vg_replace_strmem.c:/; + s/: _platform_strchr\$VARIANT\$Base (vg_replace_strmem.c:/: index (vg_replace_strmem.c:/; s/: strrchr (vg_replace_strmem.c:/: rindex (vg_replace_strmem.c:/" |
|
From: Paul F. <pa...@so...> - 2023-04-02 13:23:41
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=b32875d20cf8288b05ed2e5846454ba93d7aad30 commit b32875d20cf8288b05ed2e5846454ba93d7aad30 Author: Paul Floyd <pj...@wa...> Date: Sun Apr 2 15:22:54 2023 +0200 Darwin: more suppressions for Darwin 17, and another strchr wrapper Diff: --- darwin17.supp | 47 ++++++++++++++++++++++++++++++++++++++++++++++ shared/vg_replace_strmem.c | 1 + 2 files changed, 48 insertions(+) diff --git a/darwin17.supp b/darwin17.supp index 78f33477ca..5e9f3c0960 100644 --- a/darwin17.supp +++ b/darwin17.supp @@ -766,3 +766,50 @@ macos-__pthread_rwlock_init-see-our-bug-196528 Memcheck:Cond fun:pthread_rwlock_init } + +# macOS 10.13 mach-o loader at startup +{ + OSX1013:map_images-1 + Memcheck:Leak + match-leak-kinds: all + fun:*alloc + fun:NXCreate*TableFromZone +} + +{ + OSX1013:map_images-2 + Memcheck:Leak + match-leak-kinds: possible + fun:calloc + fun:map_images_nolock + fun:map_images +} +{ + OSX1013:map_images-3 + Memcheck:Leak + match-leak-kinds: definite + fun:calloc + fun:_ZL12realizeClassP10objc_class +} +{ + OSX1013:map_images-4 + Memcheck:Leak + match-leak-kinds: indirect + fun:malloc_zone_malloc + ... + fun:map_images_nolock +} +{ + OSX1013:map_images-5 + Memcheck:Leak + match-leak-kinds: indirect + fun:malloc_zone_calloc + fun:*NXHash* +} + +{ + OSX1013:_pthread_start + Helgrind:Race + fun:_pthread_start + fun:thread_start +} diff --git a/shared/vg_replace_strmem.c b/shared/vg_replace_strmem.c index 71b0e14cf5..30065d537a 100644 --- a/shared/vg_replace_strmem.c +++ b/shared/vg_replace_strmem.c @@ -293,6 +293,7 @@ static inline void my_exit ( int x ) /* _platform_strchr$VARIANT$Haswell */ STRCHR(libsystemZuplatformZddylib, _platform_strchr$VARIANT$Haswell) # endif + STRCHR(libsystemZuplatformZddylib, _platform_strchr$VARIANT$Base) #elif defined(VGO_solaris) STRCHR(VG_Z_LIBC_SONAME, strchr) |
|
From: Paul F. <pa...@so...> - 2023-04-02 12:06:00
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=28a164761f9357646920111610339a8d9e8b4579 commit 28a164761f9357646920111610339a8d9e8b4579 Author: Paul Floyd <pj...@wa...> Date: Sun Apr 2 14:03:14 2023 +0200 Darwin: missed removing a couple of delete wrappers Diff: --- coregrind/m_replacemalloc/vg_replace_malloc.c | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/coregrind/m_replacemalloc/vg_replace_malloc.c b/coregrind/m_replacemalloc/vg_replace_malloc.c index eed82381af..78d0b33104 100644 --- a/coregrind/m_replacemalloc/vg_replace_malloc.c +++ b/coregrind/m_replacemalloc/vg_replace_malloc.c @@ -1034,15 +1034,6 @@ extern int * __error(void) __attribute__((weak)); FREE(VG_Z_LIBSTDCXX_SONAME, _ZdlPv, __builtin_delete ); FREE(VG_Z_LIBCXX_SONAME, _ZdlPv, __builtin_delete ); FREE(SO_SYN_MALLOC, _ZdlPv, __builtin_delete ); -#if __SIZEOF_SIZE_T__ == 4 - FREE(VG_Z_LIBSTDCXX_SONAME, _ZdlPvj, __builtin_delete ); - FREE(VG_Z_LIBCXX_SONAME, _ZdlPvj, __builtin_delete ); - FREE(SO_SYN_MALLOC, _ZdlPvj, __builtin_delete ); -#elif __SIZEOF_SIZE_T__ == 8 - FREE(VG_Z_LIBSTDCXX_SONAME, _ZdlPvm, __builtin_delete ); - FREE(VG_Z_LIBCXX_SONAME, _ZdlPvm, __builtin_delete ); - FREE(SO_SYN_MALLOC, _ZdlPvm, __builtin_delete ); -#endif #elif defined(VGO_solaris) // operator delete(void*) @@ -1307,17 +1298,6 @@ extern int * __error(void) __attribute__((weak)); FREE(VG_Z_LIBSTDCXX_SONAME, _ZdaPv, __builtin_vec_delete ); FREE(VG_Z_LIBCXX_SONAME, _ZdaPv, __builtin_vec_delete ); FREE(SO_SYN_MALLOC, _ZdaPv, __builtin_vec_delete ); - #if __SIZEOF_SIZE_T__ == 4 - FREE(VG_Z_LIBSTDCXX_SONAME, _ZdaPvj, __builtin_vec_delete ); - FREE(VG_Z_LIBCXX_SONAME, _ZdaPvj, __builtin_vec_delete ); - FREE(SO_SYN_MALLOC, _ZdaPvj, __builtin_vec_delete ); - - #elif __SIZEOF_SIZE_T__ == 8 - FREE(VG_Z_LIBSTDCXX_SONAME, _ZdaPvm, __builtin_vec_delete ); - FREE(VG_Z_LIBCXX_SONAME, _ZdaPvm, __builtin_vec_delete ); - FREE(SO_SYN_MALLOC, _ZdaPvm, __builtin_vec_delete ); - #endif - #elif defined(VGO_solaris) // operator delete[](void*) |
|
From: Paul F. <pa...@so...> - 2023-04-02 11:44:54
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=e27f24c1653d55854bd823231ca574b22128f70c commit e27f24c1653d55854bd823231ca574b22128f70c Author: Paul Floyd <pj...@wa...> Date: Sun Apr 2 13:43:14 2023 +0200 Darwin and FreeBSD: new / delete wrappers A few typos in the FreeBSD soname wrappers Many missing Darwin wrappers And no need to repeat that GNU mangling is used Diff: --- coregrind/m_replacemalloc/vg_replace_malloc.c | 386 +++++++++++++++++--------- 1 file changed, 261 insertions(+), 125 deletions(-) diff --git a/coregrind/m_replacemalloc/vg_replace_malloc.c b/coregrind/m_replacemalloc/vg_replace_malloc.c index 64d9b67c1e..eed82381af 100644 --- a/coregrind/m_replacemalloc/vg_replace_malloc.c +++ b/coregrind/m_replacemalloc/vg_replace_malloc.c @@ -457,14 +457,14 @@ extern int * __error(void) __attribute__((weak)); ALLOC_or_BOMB(VG_Z_LIBC_SONAME, builtin_new, __builtin_new); ALLOC_or_BOMB(VG_Z_LIBSTDCXX_SONAME, __builtin_new, __builtin_new); ALLOC_or_BOMB(VG_Z_LIBC_SONAME, __builtin_new, __builtin_new); - // operator new(unsigned int), GNU mangling + // operator new(unsigned int) #if VG_WORDSIZE == 4 ALLOC_or_BOMB(VG_Z_LIBSTDCXX_SONAME, _Znwj, __builtin_new); ALLOC_or_BOMB(VG_Z_LIBCXX_SONAME, _Znwj, __builtin_new); ALLOC_or_BOMB(VG_Z_LIBC_SONAME, _Znwj, __builtin_new); ALLOC_or_BOMB(SO_SYN_MALLOC, _Znwj, __builtin_new); #endif - // operator new(unsigned long), GNU mangling + // operator new(unsigned long) #if VG_WORDSIZE == 8 ALLOC_or_BOMB(VG_Z_LIBSTDCXX_SONAME, _Znwm, __builtin_new); ALLOC_or_BOMB(VG_Z_LIBCXX_SONAME, _Znwm, __builtin_new); @@ -473,13 +473,13 @@ extern int * __error(void) __attribute__((weak)); #endif #elif defined(VGO_freebsd) - // operator new(unsigned int), GNU mangling + // operator new(unsigned int) #if VG_WORDSIZE == 4 ALLOC_or_BOMB(VG_Z_LIBSTDCXX_SONAME, _Znwj, __builtin_new); ALLOC_or_BOMB(VG_Z_LIBCXX_SONAME, _Znwj, __builtin_new); ALLOC_or_BOMB(SO_SYN_MALLOC, _Znwj, __builtin_new); #endif - // operator new(unsigned long), GNU mangling + // operator new(unsigned long) #if VG_WORDSIZE == 8 ALLOC_or_BOMB(VG_Z_LIBSTDCXX_SONAME, _Znwm, __builtin_new); ALLOC_or_BOMB(VG_Z_LIBCXX_SONAME, _Znwm, __builtin_new); @@ -487,24 +487,26 @@ extern int * __error(void) __attribute__((weak)); #endif #elif defined(VGO_darwin) - // operator new(unsigned int), GNU mangling + // operator new(unsigned int) #if VG_WORDSIZE == 4 - //ALLOC_or_BOMB(VG_Z_LIBSTDCXX_SONAME, _Znwj, __builtin_new); - //ALLOC_or_BOMB(VG_Z_LIBC_SONAME, _Znwj, __builtin_new); + ALLOC_or_BOMB(VG_Z_LIBSTDCXX_SONAME, _Znwj, __builtin_new); + ALLOC_or_BOMB(VG_Z_LIBCXX_SONAME, _Znwj, __builtin_new); + ALLOC_or_BOMB(VG_Z_LIBC_SONAME, _Znwj, __builtin_new); #endif - // operator new(unsigned long), GNU mangling - #if 1 // FIXME: is this right? - //ALLOC_or_BOMB(VG_Z_LIBSTDCXX_SONAME, _Znwm, __builtin_new); - //ALLOC_or_BOMB(VG_Z_LIBC_SONAME, _Znwm, __builtin_new); + // operator new(unsigned long) + #if VG_WORDSIZE == 8 + ALLOC_or_BOMB(VG_Z_LIBSTDCXX_SONAME, _Znwm, __builtin_new); + ALLOC_or_BOMB(VG_Z_LIBCXX_SONAME, _Znwm, __builtin_new); + ALLOC_or_BOMB(SO_SYN_MALLOC, _Znwm, __builtin_new); #endif #elif defined(VGO_solaris) - // operator new(unsigned int), GNU mangling + // operator new(unsigned int) #if VG_WORDSIZE == 4 ALLOC_or_BOMB(VG_Z_LIBSTDCXX_SONAME, _Znwj, __builtin_new); ALLOC_or_BOMB(SO_SYN_MALLOC, _Znwj, __builtin_new); #endif - // operator new(unsigned long), GNU mangling + // operator new(unsigned long) #if VG_WORDSIZE == 8 ALLOC_or_BOMB(VG_Z_LIBSTDCXX_SONAME, _Znwm, __builtin_new); ALLOC_or_BOMB(SO_SYN_MALLOC, _Znwm, __builtin_new); @@ -515,14 +517,14 @@ extern int * __error(void) __attribute__((weak)); /*------------------- C++17 new aligned -------------------*/ #if defined(VGO_linux) - // operator new(unsigned int, std::align_val_t), GNU mangling + // operator new(unsigned int, std::align_val_t) #if VG_WORDSIZE == 4 ALLOC_or_BOMB_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnwjSt11align_val_t, __builtin_new_aligned); ALLOC_or_BOMB_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnwjSt11align_val_t, __builtin_new_aligned); ALLOC_or_BOMB_ALIGNED(VG_Z_LIBC_SONAME, _ZnwjSt11align_val_t, __builtin_new_aligned); ALLOC_or_BOMB_ALIGNED(SO_SYN_MALLOC, _ZnwjSt11align_val_t, __builtin_new_aligned); #endif - // operator new(unsigned long, std::align_val_t), GNU mangling + // operator new(unsigned long, std::align_val_t) #if VG_WORDSIZE == 8 ALLOC_or_BOMB_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnwmSt11align_val_t, __builtin_new_aligned); ALLOC_or_BOMB_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnwmSt11align_val_t, __builtin_new_aligned); @@ -531,13 +533,13 @@ extern int * __error(void) __attribute__((weak)); #endif #elif defined(VGO_freebsd) - // operator new(unsigned int), GNU mangling + // operator new(unsigned int) #if VG_WORDSIZE == 4 ALLOC_or_BOMB_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnwjSt11align_val_t, __builtin_new_aligned); ALLOC_or_BOMB_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnwjSt11align_val_t, __builtin_new_aligned); ALLOC_or_BOMB_ALIGNED(SO_SYN_MALLOC, _ZnwjSt11align_val_t, __builtin_new_aligned); #endif - // operator new(unsigned long), GNU mangling + // operator new(unsigned long) #if VG_WORDSIZE == 8 ALLOC_or_BOMB_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnwmSt11align_val_t, __builtin_new_aligned); ALLOC_or_BOMB_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnwmSt11align_val_t, __builtin_new_aligned); @@ -545,14 +547,24 @@ extern int * __error(void) __attribute__((weak)); #endif #elif defined(VGO_darwin) + #if VG_WORDSIZE == 4 + ALLOC_or_BOMB_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnwjSt11align_val_t, __builtin_new_aligned); + ALLOC_or_BOMB_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnwjSt11align_val_t, __builtin_new_aligned); + ALLOC_or_BOMB_ALIGNED(SO_SYN_MALLOC, _ZnwjSt11align_val_t, __builtin_new_aligned); + #endif + #if VG_WORDSIZE == 8 + ALLOC_or_BOMB_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnwmSt11align_val_t, __builtin_new_aligned); + ALLOC_or_BOMB_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnwmSt11align_val_t, __builtin_new_aligned); + ALLOC_or_BOMB_ALIGNED(SO_SYN_MALLOC, _ZnwmSt11align_val_t, __builtin_new_aligned); + #endif #elif defined(VGO_solaris) - // operator new(unsigned int, std::align_val_t), GNU mangling + // operator new(unsigned int, std::align_val_t) #if VG_WORDSIZE == 4 ALLOC_or_BOMB_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnwjSt11align_val_t, __builtin_new_aligned); ALLOC_or_BOMB_ALIGNED(SO_SYN_MALLOC, _ZnwjSt11align_val_t, __builtin_new_aligned); #endif - // operator new(unsigned long, std::align_val_t), GNU mangling + // operator new(unsigned long, std::align_val_t) #if VG_WORDSIZE == 8 ALLOC_or_BOMB_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnwmSt11align_val_t, __builtin_new_aligned); ALLOC_or_BOMB_ALIGNED(SO_SYN_MALLOC, _ZnwmSt11align_val_t, __builtin_new_aligned); @@ -565,14 +577,14 @@ extern int * __error(void) __attribute__((weak)); /*---------------------- new nothrow ----------------------*/ #if defined(VGO_linux) - // operator new(unsigned, std::nothrow_t const&), GNU mangling + // operator new(unsigned, std::nothrow_t const&) #if VG_WORDSIZE == 4 ALLOC_or_NULL(VG_Z_LIBSTDCXX_SONAME, _ZnwjRKSt9nothrow_t, __builtin_new); ALLOC_or_NULL(VG_Z_LIBCXX_SONAME, _ZnwjRKSt9nothrow_t, __builtin_new); ALLOC_or_NULL(VG_Z_LIBC_SONAME, _ZnwjRKSt9nothrow_t, __builtin_new); ALLOC_or_NULL(SO_SYN_MALLOC, _ZnwjRKSt9nothrow_t, __builtin_new); #endif - // operator new(unsigned long, std::nothrow_t const&), GNU mangling + // operator new(unsigned long, std::nothrow_t const&) #if VG_WORDSIZE == 8 ALLOC_or_NULL(VG_Z_LIBSTDCXX_SONAME, _ZnwmRKSt9nothrow_t, __builtin_new); ALLOC_or_NULL(VG_Z_LIBCXX_SONAME, _ZnwmRKSt9nothrow_t, __builtin_new); @@ -581,38 +593,40 @@ extern int * __error(void) __attribute__((weak)); #endif #elif defined(VGO_freebsd) - // operator new(unsigned, std::nothrow_t const&), GNU mangling + // operator new(unsigned, std::nothrow_t const&) #if VG_WORDSIZE == 4 ALLOC_or_NULL(VG_Z_LIBSTDCXX_SONAME, _ZnwjRKSt9nothrow_t, __builtin_new); ALLOC_or_BOMB(VG_Z_LIBCXX_SONAME, _ZnwjRKSt9nothrow_t, __builtin_new); ALLOC_or_NULL(SO_SYN_MALLOC, _ZnwjRKSt9nothrow_t, __builtin_new); #endif - // operator new(unsigned long, std::nothrow_t const&), GNU mangling + // operator new(unsigned long, std::nothrow_t const&) #if VG_WORDSIZE == 8 ALLOC_or_NULL(VG_Z_LIBSTDCXX_SONAME, _ZnwmRKSt9nothrow_t, __builtin_new); ALLOC_or_NULL(VG_Z_LIBCXX_SONAME, _ZnwmRKSt9nothrow_t, __builtin_new); - ALLOC_or_NULL(SO_SYN_MALLOC, _ZnwjRKSt9nothrow_t, __builtin_new); + ALLOC_or_NULL(SO_SYN_MALLOC, _ZnwmRKSt9nothrow_t, __builtin_new); #endif #elif defined(VGO_darwin) - // operator new(unsigned, std::nothrow_t const&), GNU mangling + // operator new(unsigned, std::nothrow_t const&) #if VG_WORDSIZE == 4 - //ALLOC_or_NULL(VG_Z_LIBSTDCXX_SONAME, _ZnwjRKSt9nothrow_t, __builtin_new); - //ALLOC_or_NULL(VG_Z_LIBC_SONAME, _ZnwjRKSt9nothrow_t, __builtin_new); + ALLOC_or_NULL(VG_Z_LIBSTDCXX_SONAME, _ZnwjRKSt9nothrow_t, __builtin_new); + ALLOC_or_NULL(VG_Z_LIBCXX_SONAME, _ZnwjRKSt9nothrow_t, __builtin_new); + ALLOC_or_NULL(VG_Z_LIBC_SONAME, _ZnwjRKSt9nothrow_t, __builtin_new); #endif - // operator new(unsigned long, std::nothrow_t const&), GNU mangling - #if 1 // FIXME: is this right? - //ALLOC_or_NULL(VG_Z_LIBSTDCXX_SONAME, _ZnwmRKSt9nothrow_t, __builtin_new); - //ALLOC_or_NULL(VG_Z_LIBC_SONAME, _ZnwmRKSt9nothrow_t, __builtin_new); + // operator new(unsigned long, std::nothrow_t const&) + #if VG_WORDSIZE == 8 + ALLOC_or_NULL(VG_Z_LIBSTDCXX_SONAME, _ZnwmRKSt9nothrow_t, __builtin_new); + ALLOC_or_NULL(VG_Z_LIBCXX_SONAME, _ZnwmRKSt9nothrow_t, __builtin_new); + ALLOC_or_NULL(SO_SYN_MALLOC, _ZnwmRKSt9nothrow_t, __builtin_new); #endif #elif defined(VGO_solaris) - // operator new(unsigned, std::nothrow_t const&), GNU mangling + // operator new(unsigned, std::nothrow_t const&) #if VG_WORDSIZE == 4 ALLOC_or_NULL(VG_Z_LIBSTDCXX_SONAME, _ZnwjRKSt9nothrow_t, __builtin_new); ALLOC_or_NULL(SO_SYN_MALLOC, _ZnwjRKSt9nothrow_t, __builtin_new); #endif - // operator new(unsigned long, std::nothrow_t const&), GNU mangling + // operator new(unsigned long, std::nothrow_t const&) #if VG_WORDSIZE == 8 ALLOC_or_NULL(VG_Z_LIBSTDCXX_SONAME, _ZnwmRKSt9nothrow_t, __builtin_new); ALLOC_or_NULL(SO_SYN_MALLOC, _ZnwmRKSt9nothrow_t, __builtin_new); @@ -623,14 +637,14 @@ extern int * __error(void) __attribute__((weak)); /*----------------- C++17 new aligned nothrow -----------------*/ #if defined(VGO_linux) - // operator new(unsigned int, std::align_val_t, std::nothrow_t const&), GNU mangling + // operator new(unsigned int, std::align_val_t, std::nothrow_t const&) #if VG_WORDSIZE == 4 ALLOC_or_NULL_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnwjSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned); ALLOC_or_NULL_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnwjSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned); ALLOC_or_NULL_ALIGNED(VG_Z_LIBC_SONAME, _ZnwjSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned); ALLOC_or_NULL_ALIGNED(SO_SYN_MALLOC, _ZnwjSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned); #endif - // operator new(unsigned long, std::align_val_t, std::nothrow_t const&), GNU mangling + // operator new(unsigned long, std::align_val_t, std::nothrow_t const&) #if VG_WORDSIZE == 8 ALLOC_or_NULL_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnwmSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned); ALLOC_or_NULL_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnwmSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned); @@ -639,13 +653,13 @@ extern int * __error(void) __attribute__((weak)); #endif #elif defined(VGO_freebsd) - // operator new(unsigned int, std::align_val_t, std::nothrow_t const&), GNU mangling + // operator new(unsigned int, std::align_val_t, std::nothrow_t const&) #if VG_WORDSIZE == 4 ALLOC_or_NULL_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnwjSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned); ALLOC_or_NULL_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnwjSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned); ALLOC_or_NULL_ALIGNED(SO_SYN_MALLOC, _ZnwjSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned); #endif - // operator new(unsigned long, std::align_val_t, std::nothrow_t const&), GNU mangling + // operator new(unsigned long, std::align_val_t, std::nothrow_t const&) #if VG_WORDSIZE == 8 ALLOC_or_NULL_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnwmSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned); ALLOC_or_NULL_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnwmSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned); @@ -653,14 +667,24 @@ extern int * __error(void) __attribute__((weak)); #endif #elif defined(VGO_darwin) + #if VG_WORDSIZE == 4 + ALLOC_or_NULL_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnwjSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned); + ALLOC_or_NULL_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnwjSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned); + ALLOC_or_NULL_ALIGNED(SO_SYN_MALLOC, _ZnwjSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned); + #endif + #if VG_WORDSIZE == 8 + ALLOC_or_NULL_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnwmSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned); + ALLOC_or_NULL_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnwmSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned); + ALLOC_or_NULL_ALIGNED(SO_SYN_MALLOC, _ZnwmSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned); + #endif #elif defined(VGO_solaris) - // operator new(unsigned, std::align_val_t, std::nothrow_t const&), GNU mangling + // operator new(unsigned, std::align_val_t, std::nothrow_t const&) #if VG_WORDSIZE == 4 ALLOC_or_NULL_ALIGNED(VG_Z_LIBSTDCXX_SONAME, __ZnwjSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned); ALLOC_or_NULL_ALIGNED(SO_SYN_MALLOC, __ZnwjSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned); #endif - // operator new(unsigned long, std::align_val_t, std::nothrow_t const&), GNU mangling + // operator new(unsigned long, std::align_val_t, std::nothrow_t const&) #if VG_WORDSIZE == 8 ALLOC_or_NULL_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnwmSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned); ALLOC_or_NULL_ALIGNED(SO_SYN_MALLOC, _ZnwmSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned); @@ -675,14 +699,14 @@ extern int * __error(void) __attribute__((weak)); // operator new[](unsigned int), not mangled (for gcc 2.96) ALLOC_or_BOMB(VG_Z_LIBSTDCXX_SONAME, __builtin_vec_new, __builtin_vec_new ); ALLOC_or_BOMB(VG_Z_LIBC_SONAME, __builtin_vec_new, __builtin_vec_new ); - // operator new[](unsigned int), GNU mangling + // operator new[](unsigned int) #if VG_WORDSIZE == 4 ALLOC_or_BOMB(VG_Z_LIBSTDCXX_SONAME, _Znaj, __builtin_vec_new ); ALLOC_or_BOMB(VG_Z_LIBCXX_SONAME, _Znaj, __builtin_vec_new ); ALLOC_or_BOMB(VG_Z_LIBC_SONAME, _Znaj, __builtin_vec_new ); ALLOC_or_BOMB(SO_SYN_MALLOC, _Znaj, __builtin_vec_new ); #endif - // operator new[](unsigned long), GNU mangling + // operator new[](unsigned long), #if VG_WORDSIZE == 8 ALLOC_or_BOMB(VG_Z_LIBSTDCXX_SONAME, _Znam, __builtin_vec_new ); ALLOC_or_BOMB(VG_Z_LIBCXX_SONAME, _Znam, __builtin_vec_new ); @@ -691,38 +715,40 @@ extern int * __error(void) __attribute__((weak)); #endif #elif defined(VGO_freebsd) - // operator new[](unsigned int), GNU mangling + // operator new[](unsigned int) #if VG_WORDSIZE == 4 ALLOC_or_BOMB(VG_Z_LIBSTDCXX_SONAME, _Znaj, __builtin_vec_new ); ALLOC_or_BOMB(VG_Z_LIBCXX_SONAME, _Znaj, __builtin_vec_new ); ALLOC_or_BOMB(SO_SYN_MALLOC, _Znaj, __builtin_vec_new ); #endif - // operator new[](unsigned long), GNU mangling + // operator new[](unsigned long) #if VG_WORDSIZE == 8 ALLOC_or_BOMB(VG_Z_LIBSTDCXX_SONAME, _Znam, __builtin_vec_new ); ALLOC_or_BOMB(VG_Z_LIBCXX_SONAME, _Znam, __builtin_vec_new ); - ALLOC_or_BOMB(SO_SYN_MALLOC, _Znaj, __builtin_vec_new ); + ALLOC_or_BOMB(SO_SYN_MALLOC, _Znam, __builtin_vec_new ); #endif #elif defined(VGO_darwin) - // operator new[](unsigned int), GNU mangling + // operator new[](unsigned int) #if VG_WORDSIZE == 4 - //ALLOC_or_BOMB(VG_Z_LIBSTDCXX_SONAME, _Znaj, __builtin_vec_new ); - //ALLOC_or_BOMB(VG_Z_LIBC_SONAME, _Znaj, __builtin_vec_new ); + ALLOC_or_BOMB(VG_Z_LIBSTDCXX_SONAME, _Znaj, __builtin_vec_new ); + ALLOC_or_BOMB(VG_Z_LIBCXX_SONAME, _Znaj, __builtin_vec_new ); + ALLOC_or_BOMB(SO_SYN_MALLOC, _Znaj, __builtin_vec_new ); #endif - // operator new[](unsigned long), GNU mangling - #if 1 // FIXME: is this right? - //ALLOC_or_BOMB(VG_Z_LIBSTDCXX_SONAME, _Znam, __builtin_vec_new ); - //ALLOC_or_BOMB(VG_Z_LIBC_SONAME, _Znam, __builtin_vec_new ); + // operator new[](unsigned long) + #if VG_WORDSIZE == 8 + ALLOC_or_BOMB(VG_Z_LIBSTDCXX_SONAME, _Znam, __builtin_vec_new ); + ALLOC_or_BOMB(VG_Z_LIBCXX_SONAME, _Znam, __builtin_vec_new ); + ALLOC_or_BOMB(SO_SYN_MALLOC, _Znam, __builtin_vec_new ); #endif #elif defined(VGO_solaris) - // operator new[](unsigned int), GNU mangling + // operator new[](unsigned int) #if VG_WORDSIZE == 4 ALLOC_or_BOMB(VG_Z_LIBSTDCXX_SONAME, _Znaj, __builtin_vec_new ); ALLOC_or_BOMB(SO_SYN_MALLOC, _Znaj, __builtin_vec_new ); #endif - // operator new[](unsigned long), GNU mangling + // operator new[](unsigned long) #if VG_WORDSIZE == 8 ALLOC_or_BOMB(VG_Z_LIBSTDCXX_SONAME, _Znam, __builtin_vec_new ); ALLOC_or_BOMB(SO_SYN_MALLOC, _Znam, __builtin_vec_new ); @@ -733,14 +759,14 @@ extern int * __error(void) __attribute__((weak)); /*------------------ C++ 17 new aligned [] ------------------*/ #if defined(VGO_linux) - // operator new[](unsigned int, std::align_val_t), GNU mangling + // operator new[](unsigned int, std::align_val_t) #if VG_WORDSIZE == 4 ALLOC_or_BOMB_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnajSt11align_val_t, __builtin_vec_new_aligned ); ALLOC_or_BOMB_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnajSt11align_val_t, __builtin_vec_new_aligned ); ALLOC_or_BOMB_ALIGNED(VG_Z_LIBC_SONAME, _ZnajSt11align_val_t, __builtin_vec_new_aligned ); ALLOC_or_BOMB_ALIGNED(SO_SYN_MALLOC, _ZnajSt11align_val_t, __builtin_vec_new_aligned ); #endif - // operator new[](unsigned long, std::align_val_t), GNU mangling + // operator new[](unsigned long, std::align_val_t) #if VG_WORDSIZE == 8 ALLOC_or_BOMB_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnamSt11align_val_t, __builtin_vec_new_aligned ); ALLOC_or_BOMB_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnamSt11align_val_t, __builtin_vec_new_aligned ); @@ -749,13 +775,13 @@ extern int * __error(void) __attribute__((weak)); #endif #elif defined(VGO_freebsd) - // operator new[](unsigned int, std::align_val_t), GNU mangling + // operator new[](unsigned int, std::align_val_t) #if VG_WORDSIZE == 4 ALLOC_or_BOMB_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnajSt11align_val_t, __builtin_vec_new_aligned ); ALLOC_or_BOMB_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnajSt11align_val_t, __builtin_vec_new_aligned ); ALLOC_or_BOMB_ALIGNED(SO_SYN_MALLOC, _ZnajSt11align_val_t, __builtin_vec_new_aligned ); #endif - // operator new[](unsigned long, std::align_val_t), GNU mangling + // operator new[](unsigned long, std::align_val_t) #if VG_WORDSIZE == 8 ALLOC_or_BOMB_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnamSt11align_val_t, __builtin_vec_new_aligned ); ALLOC_or_BOMB_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnamSt11align_val_t, __builtin_vec_new_aligned ); @@ -764,13 +790,25 @@ extern int * __error(void) __attribute__((weak)); #elif defined(VGO_darwin) + #if VG_WORDSIZE == 4 + ALLOC_or_BOMB_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnajSt11align_val_t, __builtin_vec_new_aligned ); + ALLOC_or_BOMB_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnajSt11align_val_t, __builtin_vec_new_aligned ); + ALLOC_or_BOMB_ALIGNED(SO_SYN_MALLOC, _ZnajSt11align_val_t, __builtin_vec_new_aligned ); + #endif + // operator new[](unsigned long, std::align_val_t) + #if VG_WORDSIZE == 8 + ALLOC_or_BOMB_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnamSt11align_val_t, __builtin_vec_new_aligned ); + ALLOC_or_BOMB_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnamSt11align_val_t, __builtin_vec_new_aligned ); + ALLOC_or_BOMB_ALIGNED(SO_SYN_MALLOC, _ZnamSt11align_val_t, __builtin_vec_new_aligned ); + #endif + #elif defined(VGO_solaris) - // operator new[](unsigned int, std::align_val_t), GNU mangling + // operator new[](unsigned int, std::align_val_t) #if VG_WORDSIZE == 4 ALLOC_or_BOMB_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnajSt11align_val_t, __builtin_vec_new_aligned ); ALLOC_or_BOMB_ALIGNED(SO_SYN_MALLOC, _ZnajSt11align_val_t, __builtin_vec_new_aligned ); #endif - // operator new[](unsigned long, std::align_val_t), GNU mangling + // operator new[](unsigned long, std::align_val_t) #if VG_WORDSIZE == 8 ALLOC_or_BOMB_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnamSt11align_val_t, __builtin_vec_new_aligned ); ALLOC_or_BOMB_ALIGNED(SO_SYN_MALLOC, _ZnamSt11align_val_t, __builtin_vec_new_aligned ); @@ -782,14 +820,14 @@ extern int * __error(void) __attribute__((weak)); /*---------------------- new [] nothrow ----------------------*/ #if defined(VGO_linux) - // operator new[](unsigned, std::nothrow_t const&), GNU mangling + // operator new[](unsigned, std::nothrow_t const&) #if VG_WORDSIZE == 4 ALLOC_or_NULL(VG_Z_LIBSTDCXX_SONAME, _ZnajRKSt9nothrow_t, __builtin_vec_new ); ALLOC_or_NULL(VG_Z_LIBCXX_SONAME, _ZnajRKSt9nothrow_t, __builtin_vec_new ); ALLOC_or_NULL(VG_Z_LIBC_SONAME, _ZnajRKSt9nothrow_t, __builtin_vec_new ); ALLOC_or_NULL(SO_SYN_MALLOC, _ZnajRKSt9nothrow_t, __builtin_vec_new ); #endif - // operator new[](unsigned long, std::nothrow_t const&), GNU mangling + // operator new[](unsigned long, std::nothrow_t const&) #if VG_WORDSIZE == 8 ALLOC_or_NULL(VG_Z_LIBSTDCXX_SONAME, _ZnamRKSt9nothrow_t, __builtin_vec_new ); ALLOC_or_NULL(VG_Z_LIBCXX_SONAME, _ZnamRKSt9nothrow_t, __builtin_vec_new ); @@ -798,38 +836,40 @@ extern int * __error(void) __attribute__((weak)); #endif #elif defined(VGO_freebsd) - // operator new[](unsigned, std::nothrow_t const&), GNU mangling + // operator new[](unsigned, std::nothrow_t const&) #if VG_WORDSIZE == 4 ALLOC_or_NULL(VG_Z_LIBSTDCXX_SONAME, _ZnajRKSt9nothrow_t, __builtin_vec_new ); ALLOC_or_NULL(VG_Z_LIBCXX_SONAME, _ZnajRKSt9nothrow_t, __builtin_vec_new ); ALLOC_or_NULL(SO_SYN_MALLOC, _ZnajRKSt9nothrow_t, __builtin_vec_new ); #endif - // operator new[](unsigned long, std::nothrow_t const&), GNU mangling + // operator new[](unsigned long, std::nothrow_t const&) #if VG_WORDSIZE == 8 ALLOC_or_NULL(VG_Z_LIBSTDCXX_SONAME, _ZnamRKSt9nothrow_t, __builtin_vec_new ); ALLOC_or_NULL(VG_Z_LIBCXX_SONAME, _ZnamRKSt9nothrow_t, __builtin_vec_new ); - ALLOC_or_NULL(SO_SYN_MALLOC, _ZnajRKSt9nothrow_t, __builtin_vec_new ); + ALLOC_or_NULL(SO_SYN_MALLOC, _ZnamRKSt9nothrow_t, __builtin_vec_new ); #endif #elif defined(VGO_darwin) - // operator new[](unsigned, std::nothrow_t const&), GNU mangling + // operator new[](unsigned, std::nothrow_t const&) #if VG_WORDSIZE == 4 - //ALLOC_or_NULL(VG_Z_LIBSTDCXX_SONAME, _ZnajRKSt9nothrow_t, __builtin_vec_new ); - //ALLOC_or_NULL(VG_Z_LIBC_SONAME, _ZnajRKSt9nothrow_t, __builtin_vec_new ); + ALLOC_or_NULL(VG_Z_LIBSTDCXX_SONAME, _ZnajRKSt9nothrow_t, __builtin_vec_new ); + ALLOC_or_NULL(VG_Z_LIBCXX_SONAME, _ZnajRKSt9nothrow_t, __builtin_vec_new ); + ALLOC_or_NULL(VG_Z_LIBC_SONAME, _ZnajRKSt9nothrow_t, __builtin_vec_new ); #endif - // operator new[](unsigned long, std::nothrow_t const&), GNU mangling - #if 1 // FIXME: is this right? - //ALLOC_or_NULL(VG_Z_LIBSTDCXX_SONAME, _ZnamRKSt9nothrow_t, __builtin_vec_new ); - //ALLOC_or_NULL(VG_Z_LIBC_SONAME, _ZnamRKSt9nothrow_t, __builtin_vec_new ); + // operator new[](unsigned long, std::nothrow_t const&) + #if VG_WORDSIZE == 8 + ALLOC_or_NULL(VG_Z_LIBSTDCXX_SONAME, _ZnamRKSt9nothrow_t, __builtin_vec_new ); + ALLOC_or_NULL(VG_Z_LIBCXX_SONAME, _ZnamRKSt9nothrow_t, __builtin_vec_new ); + ALLOC_or_NULL(SO_SYN_MALLOC, _ZnamRKSt9nothrow_t, __builtin_vec_new ); #endif #elif defined(VGO_solaris) - // operator new[](unsigned, std::nothrow_t const&), GNU mangling + // operator new[](unsigned, std::nothrow_t const&) #if VG_WORDSIZE == 4 ALLOC_or_NULL(VG_Z_LIBSTDCXX_SONAME, _ZnajRKSt9nothrow_t, __builtin_vec_new ); ALLOC_or_NULL(SO_SYN_MALLOC, _ZnajRKSt9nothrow_t, __builtin_vec_new ); #endif - // operator new[](unsigned long, std::nothrow_t const&), GNU mangling + // operator new[](unsigned long, std::nothrow_t const&) #if VG_WORDSIZE == 8 ALLOC_or_NULL(VG_Z_LIBSTDCXX_SONAME, _ZnamRKSt9nothrow_t, __builtin_vec_new ); ALLOC_or_NULL(SO_SYN_MALLOC, _ZnamRKSt9nothrow_t, __builtin_vec_new ); @@ -840,14 +880,14 @@ extern int * __error(void) __attribute__((weak)); /*----------------- C++17 new aligned [] nothrow -----------------*/ #if defined(VGO_linux) - // operator new[](unsigned int, std::align_val_t, std::nothrow_t const&), GNU mangling + // operator new[](unsigned int, std::align_val_t, std::nothrow_t const&) #if VG_WORDSIZE == 4 ALLOC_or_NULL_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnajSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned ); ALLOC_or_NULL_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnajSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned ); ALLOC_or_NULL_ALIGNED(VG_Z_LIBC_SONAME, _ZnajSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned ); ALLOC_or_NULL_ALIGNED(SO_SYN_MALLOC, _ZnajSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned ); #endif - // operator new[](unsigned long, std::align_val_t, std::nothrow_t const&), GNU mangling + // operator new[](unsigned long, std::align_val_t, std::nothrow_t const&) #if VG_WORDSIZE == 8 ALLOC_or_NULL_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnamSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned ); ALLOC_or_NULL_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnamSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned ); @@ -856,13 +896,13 @@ extern int * __error(void) __attribute__((weak)); #endif #elif defined(VGO_freebsd) - // operator new[](unsigned int, std::align_val_t, std::nothrow_t const&), GNU mangling + // operator new[](unsigned int, std::align_val_t, std::nothrow_t const&) #if VG_WORDSIZE == 4 ALLOC_or_NULL_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnajSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned ); ALLOC_or_NULL_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnajSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned ); ALLOC_or_NULL_ALIGNED(SO_SYN_MALLOC, _ZnajSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned ); #endif - // operator new[](unsigned long, std::align_val_t, std::nothrow_t const&), GNU mangling + // operator new[](unsigned long, std::align_val_t, std::nothrow_t const&) #if VG_WORDSIZE == 8 ALLOC_or_NULL_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnamSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned ); ALLOC_or_NULL_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnamSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned ); @@ -871,13 +911,25 @@ extern int * __error(void) __attribute__((weak)); #elif defined(VGO_darwin) + #if VG_WORDSIZE == 4 + ALLOC_or_NULL_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnajSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned ); + ALLOC_or_NULL_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnajSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned ); + ALLOC_or_NULL_ALIGNED(SO_SYN_MALLOC, _ZnajSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned ); + #endif + // operator new[](unsigned long, std::align_val_t, std::nothrow_t const&) + #if VG_WORDSIZE == 8 + ALLOC_or_NULL_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnamSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned ); + ALLOC_or_NULL_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnamSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned ); + ALLOC_or_NULL_ALIGNED(SO_SYN_MALLOC, _ZnamSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned ); + #endif + #elif defined(VGO_solaris) - // operator new[](unsigned int, std::align_val_t, std::nothrow_t const&), GNU mangling + // operator new[](unsigned int, std::align_val_t, std::nothrow_t const&) #if VG_WORDSIZE == 4 ALLOC_or_NULL_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnajSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned ); ALLOC_or_NULL_ALIGNED(SO_SYN_MALLOC, _ZnajSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned ); #endif - // operator new[](unsigned long, std::align_val_t, std::nothrow_t const&), GNU mangling + // operator new[](unsigned long, std::align_val_t, std::nothrow_t const&) #if VG_WORDSIZE == 8 ALLOC_or_NULL_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnamSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned ); ALLOC_or_NULL_ALIGNED(SO_SYN_MALLOC, _ZnamSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned ); @@ -966,7 +1018,7 @@ extern int * __error(void) __attribute__((weak)); // operator delete(void*), not mangled (for gcc 2.96) FREE(VG_Z_LIBSTDCXX_SONAME, __builtin_delete, __builtin_delete ); FREE(VG_Z_LIBC_SONAME, __builtin_delete, __builtin_delete ); - // operator delete(void*), GNU mangling + // operator delete(void*) FREE(VG_Z_LIBSTDCXX_SONAME, _ZdlPv, __builtin_delete ); FREE(VG_Z_LIBCXX_SONAME, _ZdlPv, __builtin_delete ); FREE(VG_Z_LIBC_SONAME, _ZdlPv, __builtin_delete ); @@ -978,12 +1030,22 @@ extern int * __error(void) __attribute__((weak)); FREE(SO_SYN_MALLOC, _ZdlPv, __builtin_delete ); #elif defined(VGO_darwin) - // operator delete(void*), GNU mangling - //FREE(VG_Z_LIBSTDCXX_SONAME, _ZdlPv, __builtin_delete ); - //FREE(VG_Z_LIBC_SONAME, _ZdlPv, __builtin_delete ); + // operator delete(void*) + FREE(VG_Z_LIBSTDCXX_SONAME, _ZdlPv, __builtin_delete ); + FREE(VG_Z_LIBCXX_SONAME, _ZdlPv, __builtin_delete ); + FREE(SO_SYN_MALLOC, _ZdlPv, __builtin_delete ); +#if __SIZEOF_SIZE_T__ == 4 + FREE(VG_Z_LIBSTDCXX_SONAME, _ZdlPvj, __builtin_delete ); + FREE(VG_Z_LIBCXX_SONAME, _ZdlPvj, __builtin_delete ); + FREE(SO_SYN_MALLOC, _ZdlPvj, __builtin_delete ); +#elif __SIZEOF_SIZE_T__ == 8 + FREE(VG_Z_LIBSTDCXX_SONAME, _ZdlPvm, __builtin_delete ); + FREE(VG_Z_LIBCXX_SONAME, _ZdlPvm, __builtin_delete ); + FREE(SO_SYN_MALLOC, _ZdlPvm, __builtin_delete ); +#endif #elif defined(VGO_solaris) - // operator delete(void*), GNU mangling + // operator delete(void*) FREE(VG_Z_LIBSTDCXX_SONAME, _ZdlPv, __builtin_delete ); FREE(SO_SYN_MALLOC, _ZdlPv, __builtin_delete ); @@ -1033,6 +1095,17 @@ extern int * __error(void) __attribute__((weak)); #endif #elif defined(VGO_darwin) + // operator delete(void*, unsigned int) +#if __SIZEOF_SIZE_T__ == 4 + DELETE_SIZED(VG_Z_LIBSTDCXX_SONAME, _ZdlPvj, __builtin_delete ); + DELETE_SIZED(VG_Z_LIBCXX_SONAME, _ZdlPvj, __builtin_delete ); + DELETE_SIZED(SO_SYN_MALLOC, _ZdlPvj, __builtin_delete ); +#elif __SIZEOF_SIZE_T__ == 8 + // operator delete(void*, unsigned long) + DELETE_SIZED(VG_Z_LIBSTDCXX_SONAME, _ZdlPvm, __builtin_delete ); + DELETE_SIZED(VG_Z_LIBCXX_SONAME, _ZdlPvm, __builtin_delete ); + DELETE_SIZED(SO_SYN_MALLOC, _ZdlPvm, __builtin_delete ); +#endif #elif defined(VGO_solaris) // operator delete(void*, unsigned long) @@ -1076,19 +1149,19 @@ extern int * __error(void) __attribute__((weak)); } #if defined(VGO_linux) - // operator delete(void*, std::align_val_t), GNU mangling + // operator delete(void*, std::align_val_t) DELETE_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdlPvSt11align_val_t, __builtin_delete_aligned ); DELETE_ALIGNED(VG_Z_LIBCXX_SONAME, _ZdlPvSt11align_val_t, __builtin_delete_aligned ); DELETE_ALIGNED(VG_Z_LIBC_SONAME, _ZdlPvSt11align_val_t, __builtin_delete_aligned ); DELETE_ALIGNED(SO_SYN_MALLOC, _ZdlPvSt11align_val_t, __builtin_delete_aligned ); - // operator delete(void*, unsigned int, std::align_val_t), GNU mangling + // operator delete(void*, unsigned int, std::align_val_t) #if __SIZEOF_SIZE_T__ == 4 DELETE_SIZED_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdlPvjSt11align_val_t, __builtin_delete_aligned ); DELETE_SIZED_ALIGNED(VG_Z_LIBCXX_SONAME, _ZdlPvjSt11align_val_t, __builtin_delete_aligned ); DELETE_SIZED_ALIGNED(VG_Z_LIBC_SONAME, _ZdlPvjSt11align_val_t, __builtin_delete_aligned ); DELETE_SIZED_ALIGNED(SO_SYN_MALLOC, _ZdlPvjSt11align_val_t, __builtin_delete_aligned ); - // operator delete(void*, unsigned long, std::align_val_t), GNU mangling + // operator delete(void*, unsigned long, std::align_val_t) #elif __SIZEOF_SIZE_T__ == 8 DELETE_SIZED_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdlPvmSt11align_val_t, __builtin_delete_aligned ); DELETE_SIZED_ALIGNED(VG_Z_LIBCXX_SONAME, _ZdlPvmSt11align_val_t, __builtin_delete_aligned ); @@ -1097,17 +1170,17 @@ extern int * __error(void) __attribute__((weak)); #endif #elif defined(VGO_freebsd) - // operator delete(void*, std::align_val_t), GNU mangling + // operator delete(void*, std::align_val_t) DELETE_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdlPvSt11align_val_t, __builtin_delete_aligned ); DELETE_ALIGNED(VG_Z_LIBCXX_SONAME, _ZdlPvSt11align_val_t, __builtin_delete_aligned ); DELETE_ALIGNED(SO_SYN_MALLOC, _ZdlPvSt11align_val_t, __builtin_delete_aligned ); - // operator delete(void*, unsigned int, std::align_val_t), GNU mangling + // operator delete(void*, unsigned int, std::align_val_t) #if __SIZEOF_SIZE_T__ == 4 DELETE_SIZED_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdlPvjSt11align_val_t, __builtin_delete_aligned ); DELETE_SIZED_ALIGNED(VG_Z_LIBCXX_SONAME, _ZdlPvjSt11align_val_t, __builtin_delete_aligned ); DELETE_SIZED_ALIGNED(SO_SYN_MALLOC, _ZdlPvjSt11align_val_t, __builtin_delete_aligned ); - // operator delete(void*, unsigned long, std::align_val_t), GNU mangling + // operator delete(void*, unsigned long, std::align_val_t) #elif __SIZEOF_SIZE_T__ == 8 DELETE_SIZED_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdlPvmSt11align_val_t, __builtin_delete_aligned ); DELETE_SIZED_ALIGNED(VG_Z_LIBCXX_SONAME, _ZdlPvmSt11align_val_t, __builtin_delete_aligned ); @@ -1116,6 +1189,23 @@ extern int * __error(void) __attribute__((weak)); #elif defined(VGO_darwin) + // operator delete(void*, std::align_val_t) + DELETE_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdlPvSt11align_val_t, __builtin_delete_aligned ); + DELETE_ALIGNED(VG_Z_LIBCXX_SONAME, _ZdlPvSt11align_val_t, __builtin_delete_aligned ); + DELETE_ALIGNED(SO_SYN_MALLOC, _ZdlPvSt11align_val_t, __builtin_delete_aligned ); + + // operator delete(void*, unsigned int, std::align_val_t) +#if __SIZEOF_SIZE_T__ == 4 + DELETE_SIZED_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdlPvjSt11align_val_t, __builtin_delete_aligned ); + DELETE_SIZED_ALIGNED(VG_Z_LIBCXX_SONAME, _ZdlPvjSt11align_val_t, __builtin_delete_aligned ); + DELETE_SIZED_ALIGNED(SO_SYN_MALLOC, _ZdlPvjSt11align_val_t, __builtin_delete_aligned ); + // operator delete(void*, unsigned long, std::align_val_t) +#elif __SIZEOF_SIZE_T__ == 8 + DELETE_SIZED_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdlPvmSt11align_val_t, __builtin_delete_aligned ); + DELETE_SIZED_ALIGNED(VG_Z_LIBCXX_SONAME, _ZdlPvmSt11align_val_t, __builtin_delete_aligned ); + DELETE_SIZED_ALIGNED(SO_SYN_MALLOC, _ZdlPvmSt11align_val_t, __builtin_delete_aligned ); +#endif + #elif defined(VGO_solaris) // operator delete(void*, std::align_val_t) @@ -1137,25 +1227,26 @@ extern int * __error(void) __attribute__((weak)); /*---------------------- delete nothrow ----------------------*/ #if defined(VGO_linux) - // operator delete(void*, std::nothrow_t const&), GNU mangling + // operator delete(void*, std::nothrow_t const&) FREE(VG_Z_LIBSTDCXX_SONAME, _ZdlPvRKSt9nothrow_t, __builtin_delete ); FREE(VG_Z_LIBCXX_SONAME, _ZdlPvRKSt9nothrow_t, __builtin_delete ); FREE(VG_Z_LIBC_SONAME, _ZdlPvRKSt9nothrow_t, __builtin_delete ); FREE(SO_SYN_MALLOC, _ZdlPvRKSt9nothrow_t, __builtin_delete ); #elif defined(VGO_freebsd) - // operator delete(void*, std::nothrow_t const&), GNU mangling + // operator delete(void*, std::nothrow_t const&) FREE(VG_Z_LIBSTDCXX_SONAME, _ZdlPvRKSt9nothrow_t, __builtin_delete ); FREE(VG_Z_LIBCXX_SONAME, _ZdlPvRKSt9nothrow_t, __builtin_delete ); FREE(SO_SYN_MALLOC, _ZdlPvRKSt9nothrow_t, __builtin_delete ); #elif defined(VGO_darwin) - // operator delete(void*, std::nothrow_t const&), GNU mangling - //FREE(VG_Z_LIBSTDCXX_SONAME, _ZdlPvRKSt9nothrow_t, __builtin_delete ); - //FREE(VG_Z_LIBC_SONAME, _ZdlPvRKSt9nothrow_t, __builtin_delete ); + // operator delete(void*, std::nothrow_t const&) + FREE(VG_Z_LIBSTDCXX_SONAME, _ZdlPvRKSt9nothrow_t, __builtin_delete ); + FREE(VG_Z_LIBCXX_SONAME, _ZdlPvRKSt9nothrow_t, __builtin_delete ); + FREE(SO_SYN_MALLOC, _ZdlPvRKSt9nothrow_t, __builtin_delete ); #elif defined(VGO_solaris) - // operator delete(void*, std::nothrow_t const&), GNU mangling + // operator delete(void*, std::nothrow_t const&) FREE(VG_Z_LIBSTDCXX_SONAME, _ZdlPvRKSt9nothrow_t, __builtin_delete ); FREE(SO_SYN_MALLOC, _ZdlPvRKSt9nothrow_t, __builtin_delete ); @@ -1164,7 +1255,7 @@ extern int * __error(void) __attribute__((weak)); /*---------------------- C++17 delete aligned nothrow ----------------------*/ #if defined(VGO_linux) - // operator delete(void*, std::align_val_t, std::nothrow_t const&), GNU mangling + // operator delete(void*, std::align_val_t, std::nothrow_t const&) DELETE_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdlPvSt11align_val_tRKSt9nothrow_t, __builtin_delete_aligned ); DELETE_ALIGNED(VG_Z_LIBCXX_SONAME, _ZdlPvSt11align_val_tRKSt9nothrow_t, __builtin_delete_aligned ); DELETE_ALIGNED(VG_Z_LIBC_SONAME, _ZdlPvSt11align_val_tRKSt9nothrow_t, __builtin_delete_aligned ); @@ -1173,15 +1264,19 @@ extern int * __error(void) __attribute__((weak)); // no sized version of this operator #elif defined(VGO_freebsd) - // operator delete(void*, std::align_val_t, std::nothrow_t const&), GNU mangling + // operator delete(void*, std::align_val_t, std::nothrow_t const&) DELETE_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdlPvSt11align_val_tRKSt9nothrow_t, __builtin_delete_aligned ); DELETE_ALIGNED(VG_Z_LIBCXX_SONAME, _ZdlPvSt11align_val_tRKSt9nothrow_t, __builtin_delete_aligned ); DELETE_ALIGNED(SO_SYN_MALLOC, _ZdlPvSt11align_val_tRKSt9nothrow_t, __builtin_delete_aligned ); #elif defined(VGO_darwin) + DELETE_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdlPvSt11align_val_tRKSt9nothrow_t, __builtin_delete_aligned ); + DELETE_ALIGNED(VG_Z_LIBCXX_SONAME, _ZdlPvSt11align_val_tRKSt9nothrow_t, __builtin_delete_aligned ); + DELETE_ALIGNED(SO_SYN_MALLOC, _ZdlPvSt11align_val_tRKSt9nothrow_t, __builtin_delete_aligned ); + #elif defined(VGO_solaris) - // operator delete(void*, std::align_val_t, std::nothrow_t const&), GNU mangling + // operator delete(void*, std::align_val_t, std::nothrow_t const&) DELETE_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdlPvSt11align_val_tRKSt9nothrow_t, __builtin_delete_aligned ); DELETE_ALIGNED(SO_SYN_MALLOC, _ZdlPvSt11align_val_tRKSt9nothrow_t, __builtin_delete_aligned ); @@ -1196,28 +1291,36 @@ extern int * __error(void) __attribute__((weak)); // operator delete[](void*), not mangled (for gcc 2.96) FREE(VG_Z_LIBSTDCXX_SONAME, __builtin_vec_delete, __builtin_vec_delete ); FREE(VG_Z_LIBC_SONAME, __builtin_vec_delete, __builtin_vec_delete ); - // operator delete[](void*), GNU mangling + // operator delete[](void*) FREE(VG_Z_LIBSTDCXX_SONAME, _ZdaPv, __builtin_vec_delete ); FREE(VG_Z_LIBCXX_SONAME, _ZdaPv, __builtin_vec_delete ); FREE(VG_Z_LIBC_SONAME, _ZdaPv, __builtin_vec_delete ); FREE(SO_SYN_MALLOC, _ZdaPv, __builtin_vec_delete ); #elif defined(VGO_freebsd) - // operator delete[](void*), GNU mangling + // operator delete[](void*) FREE(VG_Z_LIBSTDCXX_SONAME, _ZdaPv, __builtin_vec_delete ); FREE(VG_Z_LIBCXX_SONAME, _ZdaPv, __builtin_vec_delete ); FREE(SO_SYN_MALLOC, _ZdaPv, __builtin_vec_delete ); #elif defined(VGO_darwin) - // operator delete[](void*), not mangled (for gcc 2.96) - //FREE(VG_Z_LIBSTDCXX_SONAME, __builtin_vec_delete, __builtin_vec_delete ); - //FREE(VG_Z_LIBC_SONAME, __builtin_vec_delete, __builtin_vec_delete ); - // operator delete[](void*), GNU mangling - //FREE(VG_Z_LIBSTDCXX_SONAME, _ZdaPv, __builtin_vec_delete ); - //FREE(VG_Z_LIBC_SONAME, _ZdaPv, __builtin_vec_delete ); + FREE(VG_Z_LIBSTDCXX_SONAME, _ZdaPv, __builtin_vec_delete ); + FREE(VG_Z_LIBCXX_SONAME, _ZdaPv, __builtin_vec_delete ); + FREE(SO_SYN_MALLOC, _ZdaPv, __builtin_vec_delete ); + #if __SIZEOF_SIZE_T__ == 4 + FREE(VG_Z_LIBSTDCXX_SONAME, _ZdaPvj, __builtin_vec_delete ); + FREE(VG_Z_LIBCXX_SONAME, _ZdaPvj, __builtin_vec_delete ); + FREE(SO_SYN_MALLOC, _ZdaPvj, __builtin_vec_delete ); + + #elif __SIZEOF_SIZE_T__ == 8 + FREE(VG_Z_LIBSTDCXX_SONAME, _ZdaPvm, __builtin_vec_delete ); + FREE(VG_Z_LIBCXX_SONAME, _ZdaPvm, __builtin_vec_delete ); + FREE(SO_SYN_MALLOC, _ZdaPvm, __builtin_vec_delete ); + #endif + #elif defined(VGO_solaris) - // operator delete[](void*), GNU mangling + // operator delete[](void*) FREE(VG_Z_LIBSTDCXX_SONAME, _ZdaPv, __builtin_vec_delete ); FREE(SO_SYN_MALLOC, _ZdaPv, __builtin_vec_delete ); @@ -1254,6 +1357,16 @@ extern int * __error(void) __attribute__((weak)); #elif defined(VGO_darwin) + #if __SIZEOF_SIZE_T__ == 4 + DELETE_SIZED(VG_Z_LIBSTDCXX_SONAME, _ZdaPvj, __builtin_vec_delete ); + DELETE_SIZED(VG_Z_LIBCXX_SONAME, _ZdaPvj, __builtin_vec_delete ); + DELETE_SIZED(SO_SYN_MALLOC, _ZdaPvj, __builtin_vec_delete ); + #elif __SIZEOF_SIZE_T__ == 8 + DELETE_SIZED(VG_Z_LIBSTDCXX_SONAME, _ZdaPvm, __builtin_vec_delete ); + DELETE_SIZED(VG_Z_LIBCXX_SONAME, _ZdaPvm, __builtin_vec_delete ); + DELETE_SIZED(SO_SYN_MALLOC, _ZdaPvm, __builtin_vec_delete ); + #endif + #elif defined(VGO_solaris) // operator delete[](void*, unsigned int) #if __SIZEOF_SIZE_T__ == 4 @@ -1270,19 +1383,19 @@ extern int * __error(void) __attribute__((weak)); /*---------------------- C++17 delete aligned [] ----------------------*/ #if defined(VGO_linux) - // operator delete[](void*, std::align_val_t), GNU mangling + // operator delete[](void*, std::align_val_t) DELETE_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdaPvSt11align_val_t, __builtin_vec_delete_aligned ); DELETE_ALIGNED(VG_Z_LIBCXX_SONAME, _ZdaPvSt11align_val_t, __builtin_vec_delete_aligned ); DELETE_ALIGNED(VG_Z_LIBC_SONAME, _ZdaPvSt11align_val_t, __builtin_vec_delete_aligned ); DELETE_ALIGNED(SO_SYN_MALLOC, _ZdaPvSt11align_val_t, __builtin_vec_delete_aligned ); - // operator delete[](void*, unsigned int, std::align_val_t), GNU mangling + // operator delete[](void*, unsigned int, std::align_val_t) #if __SIZEOF_SIZE_T__ == 4 DELETE_SIZED_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdaPvjSt11align_val_t, __builtin_vec_delete_aligned ); DELETE_SIZED_ALIGNED(VG_Z_LIBCXX_SONAME, _ZdaPvjSt11align_val_t, __builtin_vec_delete_aligned ); DELETE_SIZED_ALIGNED(VG_Z_LIBC_SONAME, _ZdaPvjSt11align_val_t, __builtin_vec_delete_aligned ); DELETE_SIZED_ALIGNED(SO_SYN_MALLOC, _ZdaPvjSt11align_val_t, __builtin_vec_delete_aligned ); - // operator delete[](void*, unsigned long, std::align_val_t), GNU mangling + // operator delete[](void*, unsigned long, std::align_val_t) #elif __SIZEOF_SIZE_T__ == 8 DELETE_SIZED_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdaPvmSt11align_val_t, __builtin_vec_delete_aligned ); DELETE_SIZED_ALIGNED(VG_Z_LIBCXX_SONAME, _ZdaPvmSt11align_val_t, __builtin_vec_delete_aligned ); @@ -1291,17 +1404,17 @@ extern int * __error(void) __attribute__((weak)); #endif #elif defined(VGO_freebsd) - // operator delete[](void*, std::align_val_t), GNU mangling + // operator delete[](void*, std::align_val_t) DELETE_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdaPvSt11align_val_t, __builtin_vec_delete_aligned ); DELETE_ALIGNED(VG_Z_LIBCXX_SONAME, _ZdaPvSt11align_val_t, __builtin_vec_delete_aligned ); DELETE_ALIGNED(SO_SYN_MALLOC, _ZdaPvSt11align_val_t, __builtin_vec_delete_aligned ); - // operator delete[](void*, unsigned int, std::align_val_t), GNU mangling + // operator delete[](void*, unsigned int, std::align_val_t) #if __SIZEOF_SIZE_T__ == 4 DELETE_SIZED_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdaPvjSt11align_val_t, __builtin_vec_delete_aligned ); DELETE_SIZED_ALIGNED(VG_Z_LIBCXX_SONAME, _ZdaPvjSt11align_val_t, __builtin_vec_delete_aligned ); DELETE_SIZED_ALIGNED(SO_SYN_MALLOC, _ZdaPvjSt11align_val_t, __builtin_vec_delete_aligned ); - // operator delete[](void*, unsigned long, std::align_val_t), GNU mangling + // operator delete[](void*, unsigned long, std::align_val_t) #elif __SIZEOF_SIZE_T__ == 8 DELETE_SIZED_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdaPvmSt11align_val_t, __builtin_vec_delete_aligned ); DELETE_SIZED_ALIGNED(VG_Z_LIBCXX_SONAME, _ZdaPvmSt11align_val_t, __builtin_vec_delete_aligned ); @@ -1310,8 +1423,26 @@ extern int * __error(void) __attribute__((weak)); #elif defined(VGO_darwin) + // operator delete[](void*, std::align_val_t) + DELETE_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdaPvSt11align_val_t, __builtin_vec_delete_aligned ); + DELETE_ALIGNED(VG_Z_LIBCXX_SONAME, _ZdaPvSt11align_val_t, __builtin_vec_delete_aligned ); + DELETE_ALIGNED(SO_SYN_MALLOC, _ZdaPvSt11align_val_t, __builtin_vec_delete_aligned ); + + // operator delete[](void*, unsigned int, std::align_val_t) + #if __SIZEOF_SIZE_T__ == 4 + DELETE_SIZED_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdaPvjSt11align_val_t, __builtin_vec_delete_aligned ); + DELETE_SIZED_ALIGNED(VG_Z_LIBCXX_SONAME, _ZdaPvjSt11align_val_t, __builtin_vec_delete_aligned ); + DELETE_SIZED_ALIGNED(SO_SYN_MALLOC, _ZdaPvjSt11align_val_t, __builtin_vec_delete_aligned ); + // operator delete[](void*, unsigned long, std::align_val_t) + #elif __SIZEOF_SIZE_T__ == 8 + DELETE_SIZED_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdaPvmSt11align_val_t, __builtin_vec_delete_aligned ); + DELETE_SIZED_ALIGNED(VG_Z_LIBCXX_SONAME, _ZdaPvmSt11align_val_t, __builtin_vec_delete_aligned ); + DELETE_SIZED_ALIGNED(SO_SYN_MALLOC, _ZdaPvmSt11align_val_t, __builtin_vec_delete_aligned ); +#endif + + #elif defined(VGO_solaris) - // operator delete[](void*, std::align_val_t), GNU mangling + // operator delete[](void*, std::align_val_t) DELETE_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdaPvSt11align_val_t, __builtin_vec_delete_aligned ); DELETE_ALIGNED(SO_SYN_MALLOC, _ZdaPvSt11align_val_t, __builtin_vec_delete_aligned ); @@ -1319,7 +1450,7 @@ extern int * __error(void) __attribute__((weak)); #if __SIZEOF_SIZE_T__ == 4 DELETE_SIZED_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdaPvjSt11align_val_t, __builtin_vec_delete_aligned ); DELETE_SIZED_ALIGNED(SO_SYN_MALLOC, _ZdaPvjSt11align_val_t, __builtin_vec_delete_aligned ); - // operator delete[](void*, unsigned long), GNU mangling + // operator delete[](void*, unsigned long) #elif __SIZEOF_SIZE_T__ == 8 DELETE_SIZED_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdaPvmSt11align_val_t, __builtin_vec_delete_aligned ); DELETE_SIZED_ALIGNED(SO_SYN_MALLOC, _ZdaPvmSt11align_val_t, __builtin_vec_delete_aligned ); @@ -1330,25 +1461,26 @@ extern int * __error(void) __attribute__((weak)); /*---------------------- delete [] nothrow ----------------------*/ #if defined(VGO_linux) - // operator delete[](void*, std::nothrow_t const&), GNU mangling + // operator delete[](void*, std::nothrow_t const&) FREE(VG_Z_LIBSTDCXX_SONAME, _ZdaPvRKSt9nothrow_t, __builtin_vec_delete ); FREE(VG_Z_LIBCXX_SONAME, _ZdaPvRKSt9nothrow_t, __builtin_vec_delete ); FREE(VG_Z_LIBC_SONAME, _ZdaPvRKSt9nothrow_t, __builtin_vec_delete ); FREE(SO_SYN_MALLOC, _ZdaPvRKSt9nothrow_t, __builtin_vec_delete ); #elif defined(VGO_freebsd) - // operator delete[](void*, std::nothrow_t const&), GNU mangling + // operator delete[](void*, std::nothrow_t const&) FREE(VG_Z_LIBSTDCXX_SONAME, _ZdaPvRKSt9nothrow_t, __builtin_vec_delete ); FREE(VG_Z_LIBCXX_SONAME, _ZdaPvRKSt9nothrow_t, __builtin_vec_delete ); FREE(SO_SYN_MALLOC, _ZdaPvRKSt9nothrow_t, __builtin_vec_delete ); #elif defined(VGO_darwin) - // operator delete[](void*, std::nothrow_t const&), GNU mangling - //FREE(VG_Z_LIBSTDCXX_SONAME, _ZdaPvRKSt9nothrow_t, __builtin_vec_delete ); - //FREE(VG_Z_LIBC_SONAME, _ZdaPvRKSt9nothrow_t, __builtin_vec_delete ); + // operator delete[](void*, std::nothrow_t const&) + FREE(VG_Z_LIBSTDCXX_SONAME, _ZdaPvRKSt9nothrow_t, __builtin_vec_delete ); + FREE(VG_Z_LIBCXX_SONAME, _ZdaPvRKSt9nothrow_t, __builtin_vec_delete ); + FREE(VG_Z_LIBC_SONAME, _ZdaPvRKSt9nothrow_t, __builtin_vec_delete ); #elif defined(VGO_solaris) - // operator delete[](void*, std::nothrow_t const&), GNU mangling + // operator delete[](void*, std::nothrow_t const&) FREE(VG_Z_LIBSTDCXX_SONAME, _ZdaPvRKSt9nothrow_t, __builtin_vec_delete ); FREE(SO_SYN_MALLOC, _ZdaPvRKSt9nothrow_t, __builtin_vec_delete ); @@ -1357,7 +1489,7 @@ extern int * __error(void) __attribute__((weak)); /*---------------------- C+17 delete aligned [] nothrow ----------------------*/ #if defined(VGO_linux) - // operator delete[](void*, std::align_val_t, std::nothrow_t const&), GNU mangling + // operator delete[](void*, std::align_val_t, std::nothrow_t const&) DELETE_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdaPvSt11align_val_tRKSt9nothrow_t, __builtin_vec_delete_aligned ); DELETE_ALIGNED(VG_Z_LIBCXX_SONAME, _ZdaPvSt11align_val_tRKSt9nothrow_t, __builtin_vec_delete_aligned ); DELETE_ALIGNED(VG_Z_LIBC_SONAME, _ZdaPvSt11align_val_tRKSt9nothrow_t, __builtin_vec_delete_aligned ); @@ -1366,15 +1498,19 @@ extern int * __error(void) __attribute__((weak)); // no sized version of this operator #elif defined(VGO_freebsd) - // operator delete[](void*, std::align_val_t, std::nothrow_t const&), GNU mangling + // operator delete[](void*, std::align_val_t, std::nothrow_t const&) DELETE_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdaPvSt11align_val_tRKSt9nothrow_t, __builtin_vec_delete_aligned ); DELETE_ALIGNED(VG_Z_LIBCXX_SONAME, _ZdaPvSt11align_val_tRKSt9nothrow_t, __builtin_vec_delete_aligned ); DELETE_ALIGNED(SO_SYN_MALLOC, _ZdaPvSt11align_val_tRKSt9nothrow_t, __builtin_vec_delete_aligned ); #elif defined(VGO_darwin) + DELETE_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdaPvSt11align_val_tRKSt9nothrow_t, __builtin_vec_delete_aligned ); + DELETE_ALIGNED(VG_Z_LIBCXX_SONAME, _ZdaPvSt11align_val_tRKSt9nothrow_t, __builtin_vec_delete_aligned ); + DELETE_ALIGNED(SO_SYN_MALLOC, _ZdaPvSt11align_val_tRKSt9nothrow_t, __builtin_vec_delete_aligned ); + #elif defined(VGO_solaris) - // operator delete[](void*, std::align_val_t, std::nothrow_t const&), GNU mangling + // operator delete[](void*, std::align_val_t, std::nothrow_t const&) DELETE_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdaPvSt11align_val_tRKSt9nothrow_t, __builtin_vec_delete_aligned ); DELETE_ALIGNED(SO_SYN_MALLOC, _ZdaPvSt11align_val_tRKSt9nothrow_t, __builtin_vec_delete_aligned ); |
|
From: Paul F. <pa...@so...> - 2023-04-02 09:07:21
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=421693f4327e783fe12bda8453752a38a19ec886 commit 421693f4327e783fe12bda8453752a38a19ec886 Author: Paul Floyd <pj...@wa...> Date: Sun Apr 2 11:06:18 2023 +0200 Darwin: add support for setting errno from alloc wrappers Diff: --- coregrind/m_replacemalloc/vg_replace_malloc.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/coregrind/m_replacemalloc/vg_replace_malloc.c b/coregrind/m_replacemalloc/vg_replace_malloc.c index 5977fa317b..64d9b67c1e 100644 --- a/coregrind/m_replacemalloc/vg_replace_malloc.c +++ b/coregrind/m_replacemalloc/vg_replace_malloc.c @@ -234,6 +234,13 @@ extern int *___errno (void) __attribute__((weak)); (*___errno ()) = VKI_ENOMEM; #define SET_ERRNO_EINVAL if (___errno) \ (*___errno ()) = VKI_EINVAL; +#elif defined(VGO_darwin) +extern int * __error(void) __attribute__((weak)); +#define SET_ERRNO_ENOMEM if (__error) \ + (*__error ()) = VKI_ENOMEM; +#define SET_ERRNO_EINVAL if (__error) \ + (*__error ()) = VKI_EINVAL; + #else #define SET_ERRNO_ENOMEM {} #define SET_ERRNO_EINVAL {} |
|
From: Paul F. <pa...@so...> - 2023-04-02 08:15:24
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=708d0eb6b489a23ee0cf103a699160af8fd352d5 commit 708d0eb6b489a23ee0cf103a699160af8fd352d5 Author: Paul Floyd <pj...@wa...> Date: Sun Apr 2 10:12:17 2023 +0200 Regtest: fixes for callgrind tests referring to cachegrind reference files cachegrind/tests/cgout-test was renamed to ann1.cgout but the two tests in callgrind that use it weren't updated. Diff: --- callgrind/tests/ann1.post.exp | 2 +- callgrind/tests/ann1.vgtest | 2 +- callgrind/tests/ann2.post.exp | 2 +- callgrind/tests/ann2.vgtest | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/callgrind/tests/ann1.post.exp b/callgrind/tests/ann1.post.exp index 201b967d1d..1c68fc95c2 100644 --- a/callgrind/tests/ann1.post.exp +++ b/callgrind/tests/ann1.post.exp @@ -1,5 +1,5 @@ -------------------------------------------------------------------------------- -Profile data file '../../cachegrind/tests/cgout-test' +Profile data file '../../cachegrind/tests/ann1.cgout' -------------------------------------------------------------------------------- I1 cache: 32768 B, 64 B, 8-way associative D1 cache: 32768 B, 64 B, 8-way associative diff --git a/callgrind/tests/ann1.vgtest b/callgrind/tests/ann1.vgtest index 3c53e1f55e..6b355ef741 100644 --- a/callgrind/tests/ann1.vgtest +++ b/callgrind/tests/ann1.vgtest @@ -2,5 +2,5 @@ # the post-processing of the cgout-test file. prog: ../../tests/true vgopts: --callgrind-out-file=callgrind.out -post: touch ../../cachegrind/tests/cgout-test && perl ../../callgrind/callgrind_annotate --show=Ir,I1mr,ILmr --show-percs=no --include=../../cachegrind/tests ../../cachegrind/tests/cgout-test +post: touch ../../cachegrind/tests/ann1.cgout && perl ../../callgrind/callgrind_annotate --show=Ir,I1mr,ILmr --show-percs=no --include=../../cachegrind/tests ../../cachegrind/tests/ann1.cgout cleanup: rm callgrind.out diff --git a/callgrind/tests/ann2.post.exp b/callgrind/tests/ann2.post.exp index 47e5636038..3f6f17f6a3 100644 --- a/callgrind/tests/ann2.post.exp +++ b/callgrind/tests/ann2.post.exp @@ -1,5 +1,5 @@ -------------------------------------------------------------------------------- -Profile data file '../../cachegrind/tests/cgout-test' +Profile data file '../../cachegrind/tests/ann1.cgout' -------------------------------------------------------------------------------- I1 cache: 32768 B, 64 B, 8-way associative D1 cache: 32768 B, 64 B, 8-way associative diff --git a/callgrind/tests/ann2.vgtest b/callgrind/tests/ann2.vgtest index 9b7dffa0f0..9a4a565591 100644 --- a/callgrind/tests/ann2.vgtest +++ b/callgrind/tests/ann2.vgtest @@ -2,5 +2,5 @@ # the post-processing of the cgout-test file. prog: ../../tests/true vgopts: --callgrind-out-file=callgrind.out -post: touch ../../cachegrind/tests/cgout-test && perl ../../callgrind/callgrind_annotate --sort=Dr --show=Dw,Dr,Ir --auto=yes --include=../../cachegrind/tests ../../cachegrind/tests/cgout-test +post: touch ../../cachegrind/tests/ann1.cgout && perl ../../callgrind/callgrind_annotate --sort=Dr --show=Dw,Dr,Ir --auto=yes --include=../../cachegrind/tests ../../cachegrind/tests/ann1.cgout cleanup: rm callgrind.out |
|
From: Mark W. <ma...@kl...> - 2023-04-01 22:56:07
|
Hi Nick, On Sat, Mar 25, 2023 at 11:23:54AM +1100, Nicholas Nethercote wrote: > One way to do it is to divide the tests into "must pass on CI" and "the > rest". I suspect there are plenty of tests that work on all platforms, > which would give a lot of useful coverage from the start. Over time you can > hopefully move tests from the first category to the second. So for the original buildbot CI I set it up to only run the auxtests (that is build gsl and run the testsuite under valgrind). This used to work on all setups, but after a gcc (or glibc?) update some setups started failing as you can see at: https://builder.sourceware.org/buildbot/#/builders?tags=valgrind For the try builders I took out the now failing builders (debian-testing-x86_64, fedora-arm64, fedora-x86_64, ibm-power10, opensusetw-x86_64 and rawhide-x86_64). https://builder.sourceware.org/buildbot/#/builders?tags=valgrind-try Hopefully we can figure out why the auxtests fail now on some of these setups. > The other way to do it is to divide the tests into "run on CI" and "don't > run on CI", i.e. exceptions, which does require a mechanism for specifying > those exceptions. In practice I think this works out much the same as the > first approach, because a test that consistently fails on one platform > isn't much use. (In fact, it can have negative value if its presence masks > new failures in other tests.) So should we make a new check target that runs a subset of make regtests? Or maybe have a "ci mode" for regtests? So you would run CI_MODE=true make regtests and it would skip any vgtest that has prereq: test -z "$CI_MODE" And then add make regtests to the ci and try buildbots? Cheers, Mark |
|
From: Mark W. <ma...@kl...> - 2023-04-01 22:04:26
|
Hi, On Sat, Mar 25, 2023 at 11:25:12AM +1100, Nicholas Nethercote wrote: > On Fri, 24 Mar 2023 at 22:25, Mark Wielaard <ma...@kl...> wrote: > > We aren't (yet?) using all of them (and some of them would mean moving > > over bugzilla and the mailinglist, which might be controversial). But > > I'll at least add the buildbot CI testers to the website (and we should > > at least make use of the try-branches) this weekend. > > Great! I'd be happy to try this out. Though I guess I'd need to do a > no-change try run before testing a real change, to give a baseline of > expected test failures, right? I setup the user try branches on sourceware (just for the setups that have passing aux-tests) debian-arm64, debian-armhf, debian-i386, debian-ppc64, fedora-ppc64le, fedora-s390x, ibm-power9, opensuseleap-x86_64. And added instructions on how to use them into README_DEVELOPERS: Every developer with commit access can use try branches. Code committed to a try branch will be build by the buildbot at builder.sourceware.org https://builder.sourceware.org/buildbot/#/builders?tags=valgrind-try If you want to try a commit you can push to a special named try branch (users/<your-user-name>/try-<topic>) as follows: git checkout -b frob ...hack, hack, hack... OK, looks good to submit git commit -a -m "Awesome hack" git push origin frob:users/username/try-frob When all builders have build your patch the buildbot will sent you (or actually the patch author) an email telling you if any builds failed and references to all the logs. You can also find the logs and the builds here: https://builder.sourceware.org/buildbot/#/builders?tags=valgrind-try Afterwards you can delete the branch again: git push origin :users/username/try-frob |
|
From: Mark W. <ma...@so...> - 2023-04-01 21:58:43
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=03e36bc36ec9fe9a6ea83e3ad0338480a5a97f6c commit 03e36bc36ec9fe9a6ea83e3ad0338480a5a97f6c Author: Mark Wielaard <ma...@kl...> Date: Sat Apr 1 23:58:14 2023 +0200 Commit access and try branches Diff: --- README_DEVELOPERS | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README_DEVELOPERS b/README_DEVELOPERS index 5b0a1bc6ad..4ed21a561b 100644 --- a/README_DEVELOPERS +++ b/README_DEVELOPERS @@ -80,6 +80,33 @@ compare them on all the performance tests: perl perf/vg_perf --vg=../trunk1 --vg=../trunk2 perf/ +Commit access and try branches +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +To get commit access to the valgrind git repository on sourceware +you will have to ask an existing developer and fill in the following +form: https://sourceware.org/cgi-bin/pdw/ps_form.cgi + +Every developer with commit access can use try branches. Code committed +to a try branch will be build by the buildbot at builder.sourceware.org +https://builder.sourceware.org/buildbot/#/builders?tags=valgrind-try + +If you want to try a commit you can push to a special named try branch +(users/<your-user-name>/try-<topic>) as follows: + + git checkout -b frob + ...hack, hack, hack... OK, looks good to submit + git commit -a -m "Awesome hack" + git push origin frob:users/username/try-frob + +When all builders have build your patch the buildbot will sent you (or +actually the patch author) an email telling you if any builds failed and +references to all the logs. You can also find the logs and the builds here: +https://builder.sourceware.org/buildbot/#/builders?tags=valgrind-try + +Afterwards you can delete the branch again: + + git push origin :users/username/try-frob + Debugging Valgrind with GDB ~~~~~~~~~~~~~~~~~~~~~~~~~~~ To debug the valgrind launcher program (<prefix>/bin/valgrind) just |
|
From: Paul F. <pa...@so...> - 2023-04-01 20:29:48
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=3f4052623c6246ee0d59db00d607ec858cefa849 commit 3f4052623c6246ee0d59db00d607ec858cefa849 Author: Paul Floyd <pj...@wa...> Date: Sat Apr 1 22:28:36 2023 +0200 Darwin: try to improve posix_memalign / zone_memalign wrapper It still doesn't set errno though. Diff: --- coregrind/m_replacemalloc/vg_replace_malloc.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/coregrind/m_replacemalloc/vg_replace_malloc.c b/coregrind/m_replacemalloc/vg_replace_malloc.c index db2fc5f309..5977fa317b 100644 --- a/coregrind/m_replacemalloc/vg_replace_malloc.c +++ b/coregrind/m_replacemalloc/vg_replace_malloc.c @@ -1575,7 +1575,8 @@ extern int *___errno (void) __attribute__((weak)); * */ - /* @todo PJF exactly what is the behaviour if this? */ + /* Probably in the wrong place, this is the function + called by posix_memalign, at least on macOS 10.13 */ #define ZONEMEMALIGN(soname, fnname) \ \ void* VG_REPLACE_FUNCTION_EZU(10100,soname,fnname) \ @@ -1591,6 +1592,12 @@ extern int *___errno (void) __attribute__((weak)); MALLOC_TRACE("zone_memalign(%p, al %llu, size %llu)", \ zone, (ULong)alignment, (ULong)n ); \ \ + if (alignment == 0 \ + || alignment % sizeof (void *) != 0 \ + || (alignment & (alignment - 1)) != 0) { \ + SET_ERRNO_EINVAL; \ + return NULL; \ + } \ /* Round up to minimum alignment if necessary. */ \ if (alignment < VG_MIN_MALLOC_SZB) \ alignment = VG_MIN_MALLOC_SZB; \ |
|
From: Paul F. <pa...@so...> - 2023-04-01 19:13:43
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=e105ce0d8f69f3784168562823ec9111e92aea95 commit e105ce0d8f69f3784168562823ec9111e92aea95 Author: Paul Floyd <pj...@wa...> Date: Sat Apr 1 21:11:58 2023 +0200 Darwin regtest: another test using aligned_alloc I added this test because I wanted to check the behaviour of aligned_alloc on current macOS, but Valgrind doesn't support it yet. Diff: --- memcheck/tests/darwin/aligned_alloc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/memcheck/tests/darwin/aligned_alloc.c b/memcheck/tests/darwin/aligned_alloc.c index 1c2fdb78cb..bcbae51fe4 100644 --- a/memcheck/tests/darwin/aligned_alloc.c +++ b/memcheck/tests/darwin/aligned_alloc.c @@ -1,8 +1,11 @@ #include <stdlib.h> #include <assert.h> +#include "../../../config.h" int main(void) { + // @todo PJF this is a placeholder for 10.15 and later support +#if !defined(VGO_darwin) char* p = NULL; // zero size @@ -14,6 +17,7 @@ int main(void) // align not power of 2 p = aligned_alloc(40, 160); assert(p == NULL); +#endif // @todo PJF this works standalone // but for some reason it doesn't fail in arena_memalign |
|
From: Paul F. <pa...@so...> - 2023-04-01 18:57:10
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=abf513febd1f98aad37201fe91468bf94ebae7f8 commit abf513febd1f98aad37201fe91468bf94ebae7f8 Author: Paul Floyd <pj...@wa...> Date: Sat Apr 1 20:55:22 2023 +0200 Darwin regtest: fix building on older OS versions aligned_alloc was added to macOS 10.15 and 10.13 is the latest that we support. Diff: --- memcheck/tests/memalign_args.c | 2 ++ memcheck/tests/memalign_args.stderr.exp | 4 ++-- memcheck/tests/memalign_args.stderr.exp-glibc | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/memcheck/tests/memalign_args.c b/memcheck/tests/memalign_args.c index 0946a6ce98..9c774d61ee 100644 --- a/memcheck/tests/memalign_args.c +++ b/memcheck/tests/memalign_args.c @@ -23,8 +23,10 @@ int main(void) res = posix_memalign((void **)&mem,align,size); free(mem); +#if !defined(VGO_darwin) p = aligned_alloc(align, size); free(p); +#endif p = valloc(size); free(p); diff --git a/memcheck/tests/memalign_args.stderr.exp b/memcheck/tests/memalign_args.stderr.exp index 4d426d3696..5482798875 100644 --- a/memcheck/tests/memalign_args.stderr.exp +++ b/memcheck/tests/memalign_args.stderr.exp @@ -8,8 +8,8 @@ Conditional jump or move depends on uninitialised value(s) Conditional jump or move depends on uninitialised value(s) at 0x........: aligned_alloc (vg_replace_malloc.c:...) - by 0x........: main (memalign_args.c:26) + by 0x........: main (memalign_args.c:27) Conditional jump or move depends on uninitialised value(s) at 0x........: valloc (vg_replace_malloc.c:...) - by 0x........: main (memalign_args.c:29) + by 0x........: main (memalign_args.c:31) diff --git a/memcheck/tests/memalign_args.stderr.exp-glibc b/memcheck/tests/memalign_args.stderr.exp-glibc index 8106196391..30cc1dc923 100644 --- a/memcheck/tests/memalign_args.stderr.exp-glibc +++ b/memcheck/tests/memalign_args.stderr.exp-glibc @@ -8,8 +8,8 @@ Conditional jump or move depends on uninitialised value(s) Conditional jump or move depends on uninitialised value(s) at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: main (memalign_args.c:26) + by 0x........: main (memalign_args.c:27) Conditional jump or move depends on uninitialised value(s) at 0x........: valloc (vg_replace_malloc.c:...) - by 0x........: main (memalign_args.c:29) + by 0x........: main (memalign_args.c:31) |
|
From: Paul F. <pa...@so...> - 2023-03-31 11:40:16
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=81e51f9469ad6b1936e313376a87085a8a094d40 commit 81e51f9469ad6b1936e313376a87085a8a094d40 Author: Paul Floyd <pj...@wa...> Date: Fri Mar 31 13:39:34 2023 +0200 MUSL regtest: fix a comple of build problems building regression tests on Alpine Diff: --- memcheck/tests/linux/capget.c | 6 ++++-- memcheck/tests/linux/sys-statx.c | 9 +++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/memcheck/tests/linux/capget.c b/memcheck/tests/linux/capget.c index ce9b18b0b0..4ebf2f4aef 100644 --- a/memcheck/tests/linux/capget.c +++ b/memcheck/tests/linux/capget.c @@ -1,4 +1,6 @@ -#if defined(linux) +#include "../../../config.h" + +#if defined(linux) && !defined(MUSL_LIBC) #include <stdio.h> /* printf() */ @@ -45,7 +47,7 @@ int main() int main() { - fprintf(stderr, "This program is Linux-specific\n"); + fprintf(stderr, "This program is Linux with GNU libc specific\n"); return 0; } diff --git a/memcheck/tests/linux/sys-statx.c b/memcheck/tests/linux/sys-statx.c index fcbc2e0de7..3cbbd34049 100644 --- a/memcheck/tests/linux/sys-statx.c +++ b/memcheck/tests/linux/sys-statx.c @@ -8,9 +8,14 @@ #include <assert.h> #include <string.h> #include <sys/syscall.h> -#ifndef HAVE_STRUCT_STATX_IN_SYS_STAT_H +#if defined(MUSL_LIBC) +/* musl has __NR_statx but not the structs that it needs */ +#undef __NR_statx +#else +#if !defined(HAVE_STRUCT_STATX_IN_SYS_STAT_H) #include <linux/stat.h> -#endif +#endif /* HAVE_STRUCT_STATX_IN_SYS_STAT_H */ +#endif /* MUSL_LIBC */ #include <errno.h> int check_stat2; |
|
From: Paul F. <pa...@so...> - 2023-03-31 11:17:53
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=37edf8fbda98b408a82d9476c9c7582d3e3dc6f7 commit 37edf8fbda98b408a82d9476c9c7582d3e3dc6f7 Author: Paul Floyd <pj...@wa...> Date: Fri Mar 31 13:17:10 2023 +0200 Regtest: fix a couple of unused variable warnings Copy & paste leftovers Diff: --- memcheck/tests/linux/aligned_alloc.c | 2 +- memcheck/tests/solaris/aligned_alloc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/memcheck/tests/linux/aligned_alloc.c b/memcheck/tests/linux/aligned_alloc.c index 6585580d8b..efe4672efc 100644 --- a/memcheck/tests/linux/aligned_alloc.c +++ b/memcheck/tests/linux/aligned_alloc.c @@ -7,7 +7,7 @@ int main(void) { #if defined(MUSL_LIBC) char* p = NULL; - int res; + // zero size p = aligned_alloc(0, 8); diff --git a/memcheck/tests/solaris/aligned_alloc.c b/memcheck/tests/solaris/aligned_alloc.c index 8136062234..c8e82e276f 100644 --- a/memcheck/tests/solaris/aligned_alloc.c +++ b/memcheck/tests/solaris/aligned_alloc.c @@ -5,7 +5,7 @@ int main(void) { char* p = NULL; - int res; + // zero size p = aligned_alloc(0, 8); |
|
From: Paul F. <pa...@so...> - 2023-03-31 10:42:11
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=78d0dc51c0cf78cac35e042d0f6fbf245ca6cf08 commit 78d0dc51c0cf78cac35e042d0f6fbf245ca6cf08 Author: Paul Floyd <pj...@wa...> Date: Fri Mar 31 12:41:40 2023 +0200 Remove source file added to EXTRA_DIST in error Diff: --- memcheck/tests/linux/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memcheck/tests/linux/Makefile.am b/memcheck/tests/linux/Makefile.am index af88e8cb6f..2c49b575ba 100644 --- a/memcheck/tests/linux/Makefile.am +++ b/memcheck/tests/linux/Makefile.am @@ -4,7 +4,7 @@ include $(top_srcdir)/Makefile.tool-tests.am dist_noinst_SCRIPTS = filter_stderr EXTRA_DIST = \ - aligned_alloc.c aligned_alloc.vgtest aligned_alloc.stderr.exp \ + aligned_alloc.vgtest aligned_alloc.stderr.exp \ brk.stderr.exp brk.vgtest \ capget.vgtest capget.stderr.exp capget.stderr.exp2 capget.stderr.exp3 \ debuginfod-check.stderr.exp debuginfod-check.vgtest.in \ |
|
From: Paul F. <pa...@so...> - 2023-03-31 10:11:02
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=3c0405a63d0ff4feaba7063b70c97fb9170eded1 commit 3c0405a63d0ff4feaba7063b70c97fb9170eded1 Author: Paul Floyd <pj...@wa...> Date: Fri Mar 31 12:09:45 2023 +0200 Add missing entries to cachegrind EXTRA_DIST Diff: --- cachegrind/tests/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/cachegrind/tests/Makefile.am b/cachegrind/tests/Makefile.am index 8e8deb363b..8a0d286b15 100644 --- a/cachegrind/tests/Makefile.am +++ b/cachegrind/tests/Makefile.am @@ -14,6 +14,7 @@ dist_noinst_SCRIPTS = filter_stderr filter_cachesim_discards # They just serve as input for cg_annotate in `ann1a` and `ann1b`. EXTRA_DIST = \ ann-diff1.post.exp ann-diff1.stderr.exp ann-diff1.vgtest \ + ann-diff2.post.exp ann-diff2.stderr.exp ann-diff2.vgtest \ ann-diff2a.cgout ann-diff2b.cgout \ ann-merge1.post.exp ann-merge1.stderr.exp ann-merge1.vgtest \ ann-merge1a.cgout ann-merge1b.cgout \ |
|
From: Julian S. <jse...@gm...> - 2023-03-31 07:32:32
|
On 31/03/2023 01:55, Nicholas Nethercote wrote: > I'd do the simple thing. I agree. We already use so much memory that I imagine the extra overhead is close to being in the noise. If an application has 1 million blocks on the go, this is only going to add 8 MB to the overall space use -- perhaps a bit more or bit less, per Nick's comments about 40 vs 48 etc. But this is insignificant considering that (eg) the default translated code cache size is already several hundred megabytes. J |
|
From: Nicholas N. <n.n...@gm...> - 2023-03-30 23:55:58
|
I'd do the simple thing.
BTW, will this actually cause increased memory consumption? I can't
remember the details of Valgrind allocator and whether it involves size
classes. Does an allocation of, say, 40 bytes get rounded up to 48 or
something like that? If so, then you might get this for free. (It probably
depends on how frequently the VLA at the end takes on different sizes.)
Also, if space really is tight here, I wonder if the `next` pointer could
be avoided somehow.
Nick
On Fri, 31 Mar 2023 at 07:37, Paul Floyd <pj...@wa...> wrote:
> Hi
>
> I'm getting towards the end of adding checks for aligned and sized
> allocation / deallocation checks (valid alignment values and that size /
> aligment matches new and delete).
>
> In C++ these checks are not a big deal as the size and alignment used
> with new and delete are normally all dealt with by the compiler. The
> upcoming C23 functions will be more dangerous as the arguments will be
> user-provided.
>
> One thing that is a bit thorny is what to do with MC_Chunk and the
> alignment value that needs storing. At the moment I have
>
> struct _MC_Chunk {
> struct _MC_Chunk* next;
> Addr data; // Address of the actual block.
> SizeT szB : (sizeof(SizeT)*8)-2; // size 30 or 62 bits
> MC_AllocKind allockind : 2; // 2 bits
>
>
> // Added alignment here for now
>
> SizeT alignB;
>
>
> ExeContext* where[0]; // VLA 0 to 2 pointers
> }
>
>
> As it is that will add 1 word overhead per heap allocation.
>
> Wee need at least 6 more bits for the alignment (if we store it as a
> log2). Valgrind imposes a 16Mbyte limit on the alignment, so we need 24
> bits if we store the raw value.
>
>
> The choices that I see are
>
> 1. Take it on the chin and accept the extra overhead.
>
> 2. Make this 64-bit only. As far as I know the largest physical memory
> space implemented in hardware is 52 bits (4 million gigabytes), meaning
> we have 12 bits to spare. That's enough for the log2 value of the
> alignment. 32-bit can't really afford to have more bits of size stolen.
>
> That would mean some ugly code with lots of ifdefs.It would also mean
> not being able to store the original alignment value (which in some
> cases is not necessarily a power of 2).
>
>
> 3. Make this optional.
>
> That would mean something like making a new union
>
> union MC_Extra
> SizeT alignB;
> ExeContext* where;
> };
>
> And then replacing the last element
>
> MC_extra extra[0];
>
> 'extra' would contain 0 to 3 elements, the first the alignment (if
> enabled) and the next 0 to 2 elements as before for where[].
>
> I would use --show-mismatched-frees to control adding the alignment and
> turn it off by default.
>
>
> I don't have a strong personal preference. 1 is the cleanest to
> implement. 2 is hackey but somewhat pragmatic. 3 is a bit of a compromise.
>
> A+
> Paul
>
>
> _______________________________________________
> Valgrind-developers mailing list
> Val...@li...
> https://lists.sourceforge.net/lists/listinfo/valgrind-developers
>
|
|
From: Mark W. <ma...@so...> - 2023-03-30 23:31:59
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=f32cc294e363f9ea953b22cddcb290954725d83b commit f32cc294e363f9ea953b22cddcb290954725d83b Author: Mark Wielaard <ma...@kl...> Date: Sun Jan 22 23:18:18 2023 +0100 Propagate memory allocation failure to out_of_memory_NORETURN Provide the user with a hint of what caused an out of memory error. And explain that some memory policies, like selinux deny_execmem might cause Permission denied errors. Add an err argument to out_of_memory_NORETURN. And change am_shadow_alloc to return a SysRes (all three callers were already checking for errors and calling out_of_memory_NORETURN). Diff: --- NEWS | 1 + coregrind/m_aspacemgr/aspacemgr-linux.c | 5 ++--- coregrind/m_mallocfree.c | 23 +++++++++++++++++------ coregrind/m_transtab.c | 13 ++++++++----- helgrind/libhb_core.c | 9 ++++++--- include/pub_tool_aspacemgr.h | 2 +- include/pub_tool_mallocfree.h | 5 ++++- memcheck/mc_main.c | 14 ++++++++------ 8 files changed, 47 insertions(+), 25 deletions(-) diff --git a/NEWS b/NEWS index 990043fe63..4fd2baf04c 100644 --- a/NEWS +++ b/NEWS @@ -128,6 +128,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. 462830 WARNING: unhandled amd64-freebsd syscall: 474 463027 broken check for MPX instruction support in assembler 464476 Firefox fails to start under Valgrind +464680 Show issues caused by memory policies like selinux deny_execmem 464859 Build failures with GCC-13 (drd tsan_unittest) 464969 D language demangling 465435 m_libcfile.c:66 (vgPlain_safe_fd): Assertion 'newfd >= VG_(fd_hard_limit)' failed. diff --git a/coregrind/m_aspacemgr/aspacemgr-linux.c b/coregrind/m_aspacemgr/aspacemgr-linux.c index 00a42ffe6e..ae38d8bd05 100644 --- a/coregrind/m_aspacemgr/aspacemgr-linux.c +++ b/coregrind/m_aspacemgr/aspacemgr-linux.c @@ -2744,10 +2744,9 @@ SysRes VG_(am_mmap_anon_float_valgrind)( SizeT length ) /* Really just a wrapper around VG_(am_mmap_anon_float_valgrind). */ -void* VG_(am_shadow_alloc)(SizeT size) +SysRes VG_(am_shadow_alloc)(SizeT size) { - SysRes sres = VG_(am_mmap_anon_float_valgrind)( size ); - return sr_isError(sres) ? NULL : (void*)(Addr)sr_Res(sres); + return VG_(am_mmap_anon_float_valgrind)( size ); } /* Map a file at an unconstrained address for V, and update the diff --git a/coregrind/m_mallocfree.c b/coregrind/m_mallocfree.c index a51c9aa730..b58d471b67 100644 --- a/coregrind/m_mallocfree.c +++ b/coregrind/m_mallocfree.c @@ -37,6 +37,7 @@ #include "pub_core_mallocfree.h" #include "pub_core_options.h" #include "pub_core_threadstate.h" // For VG_INVALID_THREADID +#include "pub_core_syscall.h" // For VG_(strerror) #include "pub_core_gdbserver.h" #include "pub_core_transtab.h" #include "pub_core_tooliface.h" @@ -749,7 +750,7 @@ void ensure_mm_init ( ArenaId aid ) /*------------------------------------------------------------*/ __attribute__((noreturn)) -void VG_(out_of_memory_NORETURN) ( const HChar* who, SizeT szB ) +void VG_(out_of_memory_NORETURN) ( const HChar* who, SizeT szB, UWord err ) { static Int outputTrial = 0; // We try once to output the full memory state followed by the below message. @@ -760,7 +761,7 @@ void VG_(out_of_memory_NORETURN) ( const HChar* who, SizeT szB ) ULong tot_alloc = VG_(am_get_anonsize_total)(); const HChar* s1 = "\n" - " Valgrind's memory management: out of memory:\n" + " Valgrind's memory management: out of memory: %s\n" " %s's request for %llu bytes failed.\n" " %'13llu bytes have already been mmap-ed ANONYMOUS.\n" " Valgrind cannot continue. Sorry.\n\n" @@ -769,6 +770,9 @@ void VG_(out_of_memory_NORETURN) ( const HChar* who, SizeT szB ) " output of 'ulimit -a'. Is there a limit on the size of\n" " virtual memory or address space?\n" " - You have run out of swap space.\n" + " - You have some policy enabled that denies memory to be\n" + " executable (for example selinux deny_execmem) that causes\n" + " mmap to fail with Permission denied.\n" " - Valgrind has a bug. If you think this is the case or you are\n" " not sure, please let us know and we'll try to fix it.\n" " Please note that programs can take substantially more memory than\n" @@ -801,9 +805,15 @@ void VG_(out_of_memory_NORETURN) ( const HChar* who, SizeT szB ) INNER_REQUEST(VALGRIND_MONITOR_COMMAND("v.info memory aspacemgr")); } outputTrial++; - VG_(message)(Vg_UserMsg, s1, who, (ULong)szB, tot_alloc); + VG_(message)(Vg_UserMsg, s1, + ((err == 0 || err == VKI_ENOMEM) + ? "" : VG_(strerror) (err)), + who, (ULong)szB, tot_alloc); } else { - VG_(debugLog)(0,"mallocfree", s1, who, (ULong)szB, tot_alloc); + VG_(debugLog)(0,"mallocfree", s1, + ((err == 0 || err == VKI_ENOMEM) + ? "" : VG_(strerror) (err)), + who, (ULong)szB, tot_alloc); } VG_(exit)(1); @@ -865,7 +875,7 @@ Superblock* newSuperblock ( Arena* a, SizeT cszB ) // non-client allocation -- abort if it fails sres = VG_(am_mmap_anon_float_valgrind)( cszB ); if (sr_isError(sres)) { - VG_(out_of_memory_NORETURN)("newSuperblock", cszB); + VG_(out_of_memory_NORETURN)("newSuperblock", cszB, sr_Err(sres)); /* NOTREACHED */ sb = NULL; /* keep gcc happy */ } else { @@ -1830,7 +1840,8 @@ void* VG_(arena_malloc) ( ArenaId aid, const HChar* cc, SizeT req_pszB ) a->sblocks_size * 2); if (sr_isError(sres)) { VG_(out_of_memory_NORETURN)("arena_init", sizeof(Superblock *) * - a->sblocks_size * 2); + a->sblocks_size * 2, + sr_Err(sres)); /* NOTREACHED */ } array = (Superblock**)(Addr)sr_Res(sres); diff --git a/coregrind/m_transtab.c b/coregrind/m_transtab.c index 384461289d..102108a357 100644 --- a/coregrind/m_transtab.c +++ b/coregrind/m_transtab.c @@ -1574,7 +1574,7 @@ static void initialiseSector ( SECno sno ) sres = VG_(am_mmap_anon_float_valgrind)( 8 * tc_sector_szQ ); if (sr_isError(sres)) { VG_(out_of_memory_NORETURN)("initialiseSector(TC)", - 8 * tc_sector_szQ ); + 8 * tc_sector_szQ, sr_Err(sres) ); /*NOTREACHED*/ } sec->tc = (ULong*)(Addr)sr_Res(sres); @@ -1583,7 +1583,8 @@ static void initialiseSector ( SECno sno ) ( N_TTES_PER_SECTOR * sizeof(TTEntryC) ); if (sr_isError(sres)) { VG_(out_of_memory_NORETURN)("initialiseSector(TTC)", - N_TTES_PER_SECTOR * sizeof(TTEntryC) ); + N_TTES_PER_SECTOR * sizeof(TTEntryC), + sr_Err(sres)); /*NOTREACHED*/ } sec->ttC = (TTEntryC*)(Addr)sr_Res(sres); @@ -1592,7 +1593,8 @@ static void initialiseSector ( SECno sno ) ( N_TTES_PER_SECTOR * sizeof(TTEntryH) ); if (sr_isError(sres)) { VG_(out_of_memory_NORETURN)("initialiseSector(TTH)", - N_TTES_PER_SECTOR * sizeof(TTEntryH) ); + N_TTES_PER_SECTOR * sizeof(TTEntryH), + sr_Err(sres)); /*NOTREACHED*/ } sec->ttH = (TTEntryH*)(Addr)sr_Res(sres); @@ -1608,7 +1610,8 @@ static void initialiseSector ( SECno sno ) ( N_HTTES_PER_SECTOR * sizeof(TTEno) ); if (sr_isError(sres)) { VG_(out_of_memory_NORETURN)("initialiseSector(HTT)", - N_HTTES_PER_SECTOR * sizeof(TTEno) ); + N_HTTES_PER_SECTOR * sizeof(TTEno), + sr_Err(sres)); /*NOTREACHED*/ } sec->htt = (TTEno*)(Addr)sr_Res(sres); @@ -2371,7 +2374,7 @@ static void init_unredir_tt_tc ( void ) ( N_UNREDIR_TT * UNREDIR_SZB ); if (sr_isError(sres)) { VG_(out_of_memory_NORETURN)("init_unredir_tt_tc", - N_UNREDIR_TT * UNREDIR_SZB); + N_UNREDIR_TT * UNREDIR_SZB, sr_Err(sres)); /*NOTREACHED*/ } unredir_tc = (ULong *)(Addr)sr_Res(sres); diff --git a/helgrind/libhb_core.c b/helgrind/libhb_core.c index 7c0ea84503..f660a34ea0 100644 --- a/helgrind/libhb_core.c +++ b/helgrind/libhb_core.c @@ -716,10 +716,13 @@ static void* shmem__bigchunk_alloc ( SizeT n ) if (0) VG_(printf)("XXXXX bigchunk: abandoning %d bytes\n", (Int)(shmem__bigchunk_end1 - shmem__bigchunk_next)); - shmem__bigchunk_next = VG_(am_shadow_alloc)( sHMEM__BIGCHUNK_SIZE ); - if (shmem__bigchunk_next == NULL) + SysRes sres = VG_(am_shadow_alloc)( sHMEM__BIGCHUNK_SIZE ); + if (sr_isError(sres)) { VG_(out_of_memory_NORETURN)( - "helgrind:shmem__bigchunk_alloc", sHMEM__BIGCHUNK_SIZE ); + "helgrind:shmem__bigchunk_alloc", sHMEM__BIGCHUNK_SIZE, + sr_Err(sres)); + } + shmem__bigchunk_next = (void*)(Addr)sr_Res(sres);; shmem__bigchunk_end1 = shmem__bigchunk_next + sHMEM__BIGCHUNK_SIZE; } tl_assert(shmem__bigchunk_next); diff --git a/include/pub_tool_aspacemgr.h b/include/pub_tool_aspacemgr.h index 4466345490..163c385d14 100644 --- a/include/pub_tool_aspacemgr.h +++ b/include/pub_tool_aspacemgr.h @@ -153,7 +153,7 @@ extern Bool VG_(am_is_valid_for_client) ( Addr start, SizeT len, UInt prot ); /* Really just a wrapper around VG_(am_mmap_anon_float_valgrind). */ -extern void* VG_(am_shadow_alloc)(SizeT size); +extern SysRes VG_(am_shadow_alloc)(SizeT size); /* Unmap the given address range and update the segment array accordingly. This fails if the range isn't valid for valgrind. */ diff --git a/include/pub_tool_mallocfree.h b/include/pub_tool_mallocfree.h index 8532bba870..ef7096edee 100644 --- a/include/pub_tool_mallocfree.h +++ b/include/pub_tool_mallocfree.h @@ -46,8 +46,11 @@ extern HChar* VG_(strdup) ( const HChar* cc, const HChar* s ); // TODO: move somewhere else // Call here to bomb the system when out of memory (mmap anon fails) +// Provide the VKI errno if possible (normally the result of sr_Err), +// may be zero if unknown. __attribute__((noreturn)) -extern void VG_(out_of_memory_NORETURN) ( const HChar* who, SizeT szB ); +extern void VG_(out_of_memory_NORETURN) ( const HChar* who, SizeT szB, + UWord err ); // VG_(perm_malloc) is for allocating small blocks which are // never released. The overhead for such blocks is minimal. diff --git a/memcheck/mc_main.c b/memcheck/mc_main.c index 3619dd1f92..946813be79 100644 --- a/memcheck/mc_main.c +++ b/memcheck/mc_main.c @@ -309,10 +309,11 @@ static SecMap* copy_for_writing ( SecMap* dist_sm ) || dist_sm == &sm_distinguished[1] || dist_sm == &sm_distinguished[2]); - new_sm = VG_(am_shadow_alloc)(sizeof(SecMap)); - if (new_sm == NULL) + SysRes sres = VG_(am_shadow_alloc)(sizeof(SecMap)); + if (sr_isError(sres)) VG_(out_of_memory_NORETURN)( "memcheck:allocate new SecMap", - sizeof(SecMap) ); + sizeof(SecMap), sr_Err(sres) ); + new_sm = (void *)(Addr)sr_Res(sres); VG_(memcpy)(new_sm, dist_sm, sizeof(SecMap)); update_SM_counts(dist_sm, new_sm); return new_sm; @@ -2543,11 +2544,12 @@ static void init_OCache ( void ) UWord line, set; tl_assert(MC_(clo_mc_level) >= 3); tl_assert(ocacheL1 == NULL); - ocacheL1 = VG_(am_shadow_alloc)(sizeof(OCache)); - if (ocacheL1 == NULL) { + SysRes sres = VG_(am_shadow_alloc)(sizeof(OCache)); + if (sr_isError(sres)) { VG_(out_of_memory_NORETURN)( "memcheck:allocating ocacheL1", - sizeof(OCache) ); + sizeof(OCache), sr_Err(sres) ); } + ocacheL1 = (void *)(Addr)sr_Res(sres); tl_assert(ocacheL1 != NULL); for (set = 0; set < OC_N_SETS; set++) { for (line = 0; line < OC_LINES_PER_SET; line++) { |
|
From: Paul F. <pj...@wa...> - 2023-03-30 20:36:08
|
Hi
I'm getting towards the end of adding checks for aligned and sized
allocation / deallocation checks (valid alignment values and that size /
aligment matches new and delete).
In C++ these checks are not a big deal as the size and alignment used
with new and delete are normally all dealt with by the compiler. The
upcoming C23 functions will be more dangerous as the arguments will be
user-provided.
One thing that is a bit thorny is what to do with MC_Chunk and the
alignment value that needs storing. At the moment I have
struct _MC_Chunk {
struct _MC_Chunk* next;
Addr data; // Address of the actual block.
SizeT szB : (sizeof(SizeT)*8)-2; // size 30 or 62 bits
MC_AllocKind allockind : 2; // 2 bits
// Added alignment here for now
SizeT alignB;
ExeContext* where[0]; // VLA 0 to 2 pointers
}
As it is that will add 1 word overhead per heap allocation.
Wee need at least 6 more bits for the alignment (if we store it as a
log2). Valgrind imposes a 16Mbyte limit on the alignment, so we need 24
bits if we store the raw value.
The choices that I see are
1. Take it on the chin and accept the extra overhead.
2. Make this 64-bit only. As far as I know the largest physical memory
space implemented in hardware is 52 bits (4 million gigabytes), meaning
we have 12 bits to spare. That's enough for the log2 value of the
alignment. 32-bit can't really afford to have more bits of size stolen.
That would mean some ugly code with lots of ifdefs.It would also mean
not being able to store the original alignment value (which in some
cases is not necessarily a power of 2).
3. Make this optional.
That would mean something like making a new union
union MC_Extra
SizeT alignB;
ExeContext* where;
};
And then replacing the last element
MC_extra extra[0];
'extra' would contain 0 to 3 elements, the first the alignment (if
enabled) and the next 0 to 2 elements as before for where[].
I would use --show-mismatched-frees to control adding the alignment and
turn it off by default.
I don't have a strong personal preference. 1 is the cleanest to
implement. 2 is hackey but somewhat pragmatic. 3 is a bit of a compromise.
A+
Paul
|
|
From: Paul F. <pj...@wa...> - 2023-03-30 19:54:14
|
On 29-03-23 00:03, Nicholas Nethercote wrote: > So: is anybody using user annotation? Does anybody see any problems with > this proposal? > > Thanks. > > Nick Hi Nick I don't think that I've ever used it. So no objection from me. A+ Paul |
|
From: Nicholas N. <nj...@so...> - 2023-03-28 22:18:02
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=2d97182f0dec988fd43cba3b6ac79641284b23af commit 2d97182f0dec988fd43cba3b6ac79641284b23af Author: Nicholas Nethercote <n.n...@gm...> Date: Wed Mar 29 09:15:56 2023 +1100 cg_annotate: use `<unspecified>` for an unspecified filename. Users shouldn't ever see this, but it's useful to distinguish this malformed data file case from the missing symbol case (which is still shown as `???`). Diff: --- cachegrind/cg_annotate.in | 4 ++-- cachegrind/tests/ann2.cgout | 2 +- cachegrind/tests/ann2.post.exp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cachegrind/cg_annotate.in b/cachegrind/cg_annotate.in index 2ebd93911b..d5f1e27bd2 100755 --- a/cachegrind/cg_annotate.in +++ b/cachegrind/cg_annotate.in @@ -371,8 +371,8 @@ def read_cgout_file() -> tuple[str, str, Events, DictFlfnCc, DictFlDictLineCc, C elif line.startswith("fl="): curr_fl = line[3:-1] - # A `fn=` line should follow, overwriting the "???". - curr_flfn = Flfn((curr_fl, "???")) + # A `fn=` line should follow, overwriting the function name. + curr_flfn = Flfn((curr_fl, "<unspecified>")) elif m := re.match(r"summary:\s+(.*)", line): try: diff --git a/cachegrind/tests/ann2.cgout b/cachegrind/tests/ann2.cgout index 08ddddc317..2bb2bf8eb8 100644 --- a/cachegrind/tests/ann2.cgout +++ b/cachegrind/tests/ann2.cgout @@ -82,7 +82,7 @@ fn=f1 # File found in ann2-aux/, via -I. fl=ann2-via-I.rs -fn=f1 +# No `fn=` line, so the function name falls back to `<unspecified>`. 1 1000 500 0 # File below the threshold. (It also doesn't exist, but that doesn't matter. We diff --git a/cachegrind/tests/ann2.post.exp b/cachegrind/tests/ann2.post.exp index 0e85dcb556..6fcbe12f62 100644 --- a/cachegrind/tests/ann2.post.exp +++ b/cachegrind/tests/ann2.post.exp @@ -30,7 +30,7 @@ A SomeCount VeryLongEventName file:function 15,000 (15.0%) 600 (0.6%) 0 ann2-basic.rs:f1 9,000 (9.0%) 6,000 (6.0%) 0 ann2-could-not-be-found.rs:f1 2,000 (2.0%) 100 (0.1%) 0 ann2-basic.rs:f2 - 1,000 (1.0%) 500 (0.5%) 0 ann2-via-I.rs:f1 + 1,000 (1.0%) 500 (0.5%) 0 ann2-via-I.rs:<unspecified> 1,000 (1.0%) 300 (0.3%) -1,000 (n/a) ann2-past-the-end.rs:f1 -1,000 (-1.0%) 0 0 ann2-negatives.rs:neg3 -1,000 (-1.0%) 0 0 ann2-negatives.rs:neg2 |
|
From: Nicholas N. <n.n...@gm...> - 2023-03-28 22:04:03
|
Hi,
I recently rewrote `cg_annotate`, `cg_diff`, and `cg_merge` in Python. The
old versions were written in Perl, Perl, and C, respectively. The new
versions are much nicer and easier to modify, and I have various ideas for
improving `cg_annotate`. This email is about one of those ideas.
A typical way to invoke `cg_annotate` is like this:
> cg_annotate cachegrind.out.12345
This implies `--auto=yes`, which requests line-by-line "auto-annotation" of
source files. I.e. `cg_annotate` will automatically annotate all files in
the profile that meet the significance threshold.
It's also possible to do something like this:
> cg_annotate --auto=no cachegrind.out.12345 a.c b.c
Which instead requests "user annotation" of the files `a.c` and `b.c`.
My thesis is that auto-annotation suffices in practice for all reasonable
use cases, and that user annotation is unnecessary and can be removed.
When I first wrote `cg_annotate` in 2002, only user annotation was
implemented. Shortly after, I added the `--auto={yes,no}` option. Since
then I've never used user annotation, and I suspect nobody else has either.
User annotation is ok when dealing with tiny programs, but as soon as you
are profiling a program with more than a handful of source files it becomes
impractical.
The only possible use cases I can think of for user annotation are as
follows.
- If you want to see a particular file(s) annotated but you don't want
to see any others, then you can use user annotation in combination with
`--auto=no`. But it's trivial to search through the output for the
particular file, so this doesn't seem important.
- If the path to a file is somehow really messed up in the debug info,
it might be possible that auto-annotation would fail to find it, but user
annotation could find it, possibly in combination with `-I`. But this seems
unlikely. Some basic testing shows that gcc, clang and rustc all default to
using full paths in debug info. gcc supports `-fdebug-prefix-map` but that
seems to mostly be used for changing full paths to relative paths, which
will still work fine.
Removing user annotation would (a) simplify the code and docs, and (b)
enable the possibility of moving the merge functionality from `cg_merge`
into `cg_annotate`, by allowing the user to specify multiple cachegrind.out
files as input.
So: is anybody using user annotation? Does anybody see any problems with
this proposal?
Thanks.
Nick
|
|
From: Nicholas N. <nj...@so...> - 2023-03-28 06:23:26
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=6436be0a3ff05e72c097dab960347726c32c8890 commit 6436be0a3ff05e72c097dab960347726c32c8890 Author: Nicholas Nethercote <n.n...@gm...> Date: Tue Mar 28 17:22:42 2023 +1100 cg_annotate.in: fix a small bug in the printing of past-the-end lines. Diff: --- cachegrind/cg_annotate.in | 27 ++++++++++++++------------- cachegrind/tests/ann2.post.exp | 2 +- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/cachegrind/cg_annotate.in b/cachegrind/cg_annotate.in index 240e069ccb..2ebd93911b 100755 --- a/cachegrind/cg_annotate.in +++ b/cachegrind/cg_annotate.in @@ -686,18 +686,17 @@ def print_annotated_src_file( pairs.append((lo, hi)) i += 1 - # Annotate chosen lines, tracking total annotated counts. - line_num = 0 - if pairs: + def print_lines(pairs: list[tuple[int, int]]) -> None: + line_num = 0 while pairs: + src_line = "" (lo, hi) = pairs.pop(0) while line_num < lo - 1: - tmp = src_file.readline() + src_line = src_file.readline() line_num += 1 - if not tmp: - break # EOF + if not src_line: + return # EOF - src_line = "" # Print line number, unless start of file. if lo != 1: print("-- line", lo, "-" * 40) @@ -706,7 +705,7 @@ def print_annotated_src_file( src_line = src_file.readline() line_num += 1 if not src_line: - break + return # EOF if line_nums and line_num == line_nums[0]: printer.print_cc(dict_line_cc[line_num], src_line[:-1]) annotated_ccs.line_nums_known_cc += dict_line_cc[line_num] @@ -714,14 +713,16 @@ def print_annotated_src_file( else: printer.print_missing_cc(src_line[:-1]) - # Print line number, unless EOF. - if src_line: - print("-- line", hi, "-" * 40) - else: - break + # Print line number. + print("-- line", hi, "-" * 40) + + # Annotate chosen lines, tracking total annotated counts. + if pairs: + print_lines(pairs) # If there was info on lines past the end of the file, warn. if line_nums: + print() for line_num in line_nums: printer.print_cc(dict_line_cc[line_num], f"<bogus line {line_num}>") annotated_ccs.line_nums_known_cc += dict_line_cc[line_num] diff --git a/cachegrind/tests/ann2.post.exp b/cachegrind/tests/ann2.post.exp index 315e13474d..0e85dcb556 100644 --- a/cachegrind/tests/ann2.post.exp +++ b/cachegrind/tests/ann2.post.exp @@ -126,7 +126,7 @@ A SomeCount VeryLongEventName . . . two . . . three -- line 3 ---------------------------------------- --- line 18 ---------------------------------------- + 300 (0.3%) 100 (0.1%) 0 <bogus line 20> 300 (0.3%) 100 (0.1%) 0 <bogus line 21> 200 (0.2%) 0 -1,000 (n/a) <bogus line 22> |