You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(122) |
Nov
(152) |
Dec
(69) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(6) |
Feb
(25) |
Mar
(73) |
Apr
(82) |
May
(24) |
Jun
(25) |
Jul
(10) |
Aug
(11) |
Sep
(10) |
Oct
(54) |
Nov
(203) |
Dec
(182) |
| 2004 |
Jan
(307) |
Feb
(305) |
Mar
(430) |
Apr
(312) |
May
(187) |
Jun
(342) |
Jul
(487) |
Aug
(637) |
Sep
(336) |
Oct
(373) |
Nov
(441) |
Dec
(210) |
| 2005 |
Jan
(385) |
Feb
(480) |
Mar
(636) |
Apr
(544) |
May
(679) |
Jun
(625) |
Jul
(810) |
Aug
(838) |
Sep
(634) |
Oct
(521) |
Nov
(965) |
Dec
(543) |
| 2006 |
Jan
(494) |
Feb
(431) |
Mar
(546) |
Apr
(411) |
May
(406) |
Jun
(322) |
Jul
(256) |
Aug
(401) |
Sep
(345) |
Oct
(542) |
Nov
(308) |
Dec
(481) |
| 2007 |
Jan
(427) |
Feb
(326) |
Mar
(367) |
Apr
(255) |
May
(244) |
Jun
(204) |
Jul
(223) |
Aug
(231) |
Sep
(354) |
Oct
(374) |
Nov
(497) |
Dec
(362) |
| 2008 |
Jan
(322) |
Feb
(482) |
Mar
(658) |
Apr
(422) |
May
(476) |
Jun
(396) |
Jul
(455) |
Aug
(267) |
Sep
(280) |
Oct
(253) |
Nov
(232) |
Dec
(304) |
| 2009 |
Jan
(486) |
Feb
(470) |
Mar
(458) |
Apr
(423) |
May
(696) |
Jun
(461) |
Jul
(551) |
Aug
(575) |
Sep
(134) |
Oct
(110) |
Nov
(157) |
Dec
(102) |
| 2010 |
Jan
(226) |
Feb
(86) |
Mar
(147) |
Apr
(117) |
May
(107) |
Jun
(203) |
Jul
(193) |
Aug
(238) |
Sep
(300) |
Oct
(246) |
Nov
(23) |
Dec
(75) |
| 2011 |
Jan
(133) |
Feb
(195) |
Mar
(315) |
Apr
(200) |
May
(267) |
Jun
(293) |
Jul
(353) |
Aug
(237) |
Sep
(278) |
Oct
(611) |
Nov
(274) |
Dec
(260) |
| 2012 |
Jan
(303) |
Feb
(391) |
Mar
(417) |
Apr
(441) |
May
(488) |
Jun
(655) |
Jul
(590) |
Aug
(610) |
Sep
(526) |
Oct
(478) |
Nov
(359) |
Dec
(372) |
| 2013 |
Jan
(467) |
Feb
(226) |
Mar
(391) |
Apr
(281) |
May
(299) |
Jun
(252) |
Jul
(311) |
Aug
(352) |
Sep
(481) |
Oct
(571) |
Nov
(222) |
Dec
(231) |
| 2014 |
Jan
(185) |
Feb
(329) |
Mar
(245) |
Apr
(238) |
May
(281) |
Jun
(399) |
Jul
(382) |
Aug
(500) |
Sep
(579) |
Oct
(435) |
Nov
(487) |
Dec
(256) |
| 2015 |
Jan
(338) |
Feb
(357) |
Mar
(330) |
Apr
(294) |
May
(191) |
Jun
(108) |
Jul
(142) |
Aug
(261) |
Sep
(190) |
Oct
(54) |
Nov
(83) |
Dec
(22) |
| 2016 |
Jan
(49) |
Feb
(89) |
Mar
(33) |
Apr
(50) |
May
(27) |
Jun
(34) |
Jul
(53) |
Aug
(53) |
Sep
(98) |
Oct
(206) |
Nov
(93) |
Dec
(53) |
| 2017 |
Jan
(65) |
Feb
(82) |
Mar
(102) |
Apr
(86) |
May
(187) |
Jun
(67) |
Jul
(23) |
Aug
(93) |
Sep
(65) |
Oct
(45) |
Nov
(35) |
Dec
(17) |
| 2018 |
Jan
(26) |
Feb
(35) |
Mar
(38) |
Apr
(32) |
May
(8) |
Jun
(43) |
Jul
(27) |
Aug
(30) |
Sep
(43) |
Oct
(42) |
Nov
(38) |
Dec
(67) |
| 2019 |
Jan
(32) |
Feb
(37) |
Mar
(53) |
Apr
(64) |
May
(49) |
Jun
(18) |
Jul
(14) |
Aug
(53) |
Sep
(25) |
Oct
(30) |
Nov
(49) |
Dec
(31) |
| 2020 |
Jan
(87) |
Feb
(45) |
Mar
(37) |
Apr
(51) |
May
(99) |
Jun
(36) |
Jul
(11) |
Aug
(14) |
Sep
(20) |
Oct
(24) |
Nov
(40) |
Dec
(23) |
| 2021 |
Jan
(14) |
Feb
(53) |
Mar
(85) |
Apr
(15) |
May
(19) |
Jun
(3) |
Jul
(14) |
Aug
(1) |
Sep
(57) |
Oct
(73) |
Nov
(56) |
Dec
(22) |
| 2022 |
Jan
(3) |
Feb
(22) |
Mar
(6) |
Apr
(55) |
May
(46) |
Jun
(39) |
Jul
(15) |
Aug
(9) |
Sep
(11) |
Oct
(34) |
Nov
(20) |
Dec
(36) |
| 2023 |
Jan
(79) |
Feb
(41) |
Mar
(99) |
Apr
(169) |
May
(48) |
Jun
(16) |
Jul
(16) |
Aug
(57) |
Sep
(19) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
|
1
(5) |
2
(11) |
|
3
(3) |
4
|
5
|
6
|
7
|
8
|
9
|
|
10
|
11
|
12
|
13
|
14
|
15
|
16
|
|
17
|
18
|
19
|
20
|
21
|
22
|
23
|
|
24
|
25
|
26
|
27
|
28
|
29
|
30
|
|
From: Paul F. <pa...@so...> - 2023-09-02 21:46:06
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=1e197de36e1d116294d2f19c4d47fb91a6611208 commit 1e197de36e1d116294d2f19c4d47fb91a6611208 Author: Paul Floyd <pj...@wa...> Date: Sat Sep 2 23:43:31 2023 +0200 coverity: fix a couple of forward nulls In the new sized/aligned memcheck code. Diff: --- memcheck/mc_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/memcheck/mc_main.c b/memcheck/mc_main.c index 90b89a9115..3f34e3dc19 100644 --- a/memcheck/mc_main.c +++ b/memcheck/mc_main.c @@ -7305,7 +7305,7 @@ static Bool mc_handle_client_request ( ThreadId tid, UWord* arg, UWord* ret ) if (mc && mc->szB != aligned_alloc_info->size) { MC_(record_size_mismatch_error) ( tid, mc, aligned_alloc_info->size, "new/delete"); } - if (aligned_alloc_info->orig_alignment != mc->alignB) { + if (mc && aligned_alloc_info->orig_alignment != mc->alignB) { MC_(record_align_mismatch_error) ( tid, mc, aligned_alloc_info->orig_alignment, "new/delete"); } if (aligned_alloc_info->orig_alignment == 0 || @@ -7318,7 +7318,7 @@ static Bool mc_handle_client_request ( ThreadId tid, UWord* arg, UWord* ret ) if (mc && mc->szB != aligned_alloc_info->size) { MC_(record_size_mismatch_error) ( tid, mc, aligned_alloc_info->size, "new[]/delete[]" ); } - if (aligned_alloc_info->orig_alignment != mc->alignB) { + if (mc && aligned_alloc_info->orig_alignment != mc->alignB) { MC_(record_align_mismatch_error) ( tid, mc, aligned_alloc_info->orig_alignment, "new[]/delete[]"); } if (aligned_alloc_info->orig_alignment == 0 || |
|
From: Paul F. <pa...@so...> - 2023-09-02 21:20:11
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=9ed8f42357f73c290c7bff85246977ff1972fbb8 commit 9ed8f42357f73c290c7bff85246977ff1972fbb8 Author: Paul Floyd <pj...@wa...> Date: Sat Sep 2 23:19:17 2023 +0200 coverity: a few bits of dead code and one vgdb command line leak Diff: --- coregrind/launcher-freebsd.c | 19 +------------------ coregrind/vgdb.c | 5 +++++ include/pub_tool_basics.h | 5 ----- memcheck/mc_translate.c | 9 +-------- 4 files changed, 7 insertions(+), 31 deletions(-) diff --git a/coregrind/launcher-freebsd.c b/coregrind/launcher-freebsd.c index 030b183b57..8687de3f59 100644 --- a/coregrind/launcher-freebsd.c +++ b/coregrind/launcher-freebsd.c @@ -198,7 +198,7 @@ int main(int argc, char** argv, char** envp) const char *toolname = NULL; const char *clientname = NULL; const char *platform; - const char *default_platform; + const char *default_platform = VG_PLATFORM; const char *cp; char *toolfile; char launcher_name[PATH_MAX+1]; @@ -243,23 +243,6 @@ int main(int argc, char** argv, char** envp) toolname = "memcheck"; } - /* Select a platform to use if we can't decide that by looking at - the executable (eg because it's a shell script). Note that the - default_platform is not necessarily either the primary or - secondary build target. Instead it's chosen to maximise the - chances that /bin/sh will work on it. Hence for a primary - target of ppc64-linux we still choose ppc32-linux as the default - target, because on most ppc64-linux setups, the basic /bin, - /usr/bin, etc, stuff is built in 32-bit mode, not 64-bit - mode. */ - if (0==strcmp(VG_PLATFORM,"x86-freebsd")) { - default_platform = "x86-freebsd"; - } else if (0==strcmp(VG_PLATFORM,"amd64-freebsd")) { - default_platform = "amd64-freebsd"; - } else { - barf("Unknown VG_PLATFORM '%s'", VG_PLATFORM); - } - /* Work out what platform to use, or use the default platform if not possible. */ if (clientname == NULL) { diff --git a/coregrind/vgdb.c b/coregrind/vgdb.c index c024ffca6b..9e21a00d66 100644 --- a/coregrind/vgdb.c +++ b/coregrind/vgdb.c @@ -2269,6 +2269,11 @@ void parse_options(int argc, char** argv, arg_errors++; } } else if (is_opt(argv[i], "--vgdb-prefix=")) { + if (vgdb_prefix) { + // was specified more than once on the command line + // ignore earlier uses + free(vgdb_prefix); + } vgdb_prefix = strdup (argv[i] + 14); } else if (is_opt(argv[i], "--valgrind=")) { char *path = argv[i] + 11; diff --git a/include/pub_tool_basics.h b/include/pub_tool_basics.h index d22a425238..bf5a5ba7fa 100644 --- a/include/pub_tool_basics.h +++ b/include/pub_tool_basics.h @@ -233,11 +233,6 @@ typedef UWord _val; UWord _val2; Bool _isError; -#if defined(VGP_amd64_freebsd) - char padding[7]; -#else - char padding[3]; -#endif } SysRes; diff --git a/memcheck/mc_translate.c b/memcheck/mc_translate.c index 72ccb3c8c6..f8aca1641c 100644 --- a/memcheck/mc_translate.c +++ b/memcheck/mc_translate.c @@ -4822,18 +4822,11 @@ IRAtom* expr2vbits_Binop ( MCEnv* mce, and_or_ty = Ity_I1; improve = mkImproveOR1; goto do_And_Or; do_And_Or: - return - assignNew( - 'V', mce, - and_or_ty, - difd(mce, uifu(mce, vatom1, vatom2), - difd(mce, improve(mce, atom1, vatom1), - improve(mce, atom2, vatom2) ) ) ); - return assignNew('V', mce, and_or_ty, difd(mce, uifu(mce, vatom1, vatom2), difd(mce, improve(mce, atom1, vatom1), improve(mce, atom2, vatom2) ) ) ); + case Iop_Xor8: return mkUifU8(mce, vatom1, vatom2); case Iop_Xor16: |
|
From: Paul F. <pa...@so...> - 2023-09-02 15:38:43
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=fa2f351cf8aecfc4fa3377eac5daa565df13d963 commit fa2f351cf8aecfc4fa3377eac5daa565df13d963 Author: Paul Floyd <pj...@wa...> Date: Sat Sep 2 17:33:35 2023 +0200 regtest: silence some more warnings A massif test that checks that --ignore-fn Sadly neither C nor C++ has a standard way of specifying functons to _never_ inline, and GCC and LLVM seem to have different extensions. GCC complains about __attribute__((optnone)). Diff: --- configure.ac | 1 + massif/tests/Makefile.am | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 5ce94c318c..0ce6cccb6d 100755 --- a/configure.ac +++ b/configure.ac @@ -2606,6 +2606,7 @@ AC_GCC_WARNING_SUBST_NO([fortify-source], [FLAG_W_NO_FORTIFY_SOURCE]) AC_GCC_WARNING_SUBST_NO([builtin-memcpy-chk-size], [FLAG_W_NO_BUILTIN_MEMCPY_CHK_SIZE]) AC_GCC_WARNING_SUBST_NO([incompatible-pointer-types-discards-qualifiers], [FLAG_W_NO_INCOMPATIBLE_POINTER_TYPES_DISCARDS_QUALIFIERS]) AC_GCC_WARNING_SUBST_NO([suspicious-bzero], [FLAG_W_NO_SUSPICIOUS_BZERO]) +AC_GCC_WARNING_SUBST_NO([attributes], [FLAG_W_NO_ATTRIBUTES]) AC_GCC_WARNING_SUBST_NO_VAL([alloc-size-larger-than], [1677216], [FLAG_W_NO_ALLOC_SIZE_LARGER_THAN]) diff --git a/massif/tests/Makefile.am b/massif/tests/Makefile.am index f8deeb5766..636bc8f85a 100644 --- a/massif/tests/Makefile.am +++ b/massif/tests/Makefile.am @@ -91,7 +91,7 @@ AM_CXXFLAGS += $(AM_FLAG_M3264_PRI) bug469146_SOURCES = bug469146.cpp # -fno-optimize-sibling-calls because otherwise some platforms will have # tail call optimization which messes up --ignore-fn -bug469146_CXXFLAGS = $(AM_CXXFLAGS) -O2 -fno-optimize-sibling-calls @FLAG_W_NO_USE_AFTER_FREE@ +bug469146_CXXFLAGS = $(AM_CXXFLAGS) -O2 -fno-optimize-sibling-calls @FLAG_W_NO_USE_AFTER_FREE@ @FLAG_W_NO_ATTRIBUTES@ new_cpp_SOURCES = new-cpp.cpp overloaded_new_SOURCES = overloaded-new.cpp # pre C++11 compilers don't have exception specs |
|
From: Paul F. <pa...@so...> - 2023-09-02 15:16:09
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=86a8f04c7f5d31050d841e82397f052fc6a958a6 commit 86a8f04c7f5d31050d841e82397f052fc6a958a6 Author: Paul Floyd <pj...@wa...> Date: Sat Sep 2 17:12:23 2023 +0200 regtest: silence a few warnings A couple of testcases that use 'new' that will throw an uncaught exception. The variable doesn't get used, there is only an assert to check that nothing is reached after the new expressions. Diff: --- configure.ac | 1 + memcheck/tests/Makefile.am | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 2aaf3f44bb..5ce94c318c 100755 --- a/configure.ac +++ b/configure.ac @@ -2592,6 +2592,7 @@ AC_GCC_WARNING_SUBST_NO([static-local-in-inline], [FLAG_W_NO_STATIC_LOCAL_IN_INL AC_GCC_WARNING_SUBST_NO([mismatched-new-delete], [FLAG_W_NO_MISMATCHED_NEW_DELETE]) AC_GCC_WARNING_SUBST_NO([infinite-recursion], [FLAG_W_NO_INFINITE_RECURSION]) AC_GCC_WARNING_SUBST_NO([expansion-to-defined], [FLAG_W_NO_EXPANSION_TO_DEFINED]) +AC_GCC_WARNING_SUBST_NO([unused-variable], [FLAG_W_NO_UNUSED_VARIABLE]) AC_GCC_WARNING_SUBST_NO([unused-but-set-variable], [FLAG_W_NO_UNUSED_BUT_SET_VARIABLE]) AC_GCC_WARNING_SUBST_NO([non-power-of-two-alignment], [FLAG_W_NO_NON_POWER_OF_TWO_ALIGNMENT]) AC_GCC_WARNING_SUBST_NO([sign-compare], [FLAG_W_NO_SIGN_COMPARE]) diff --git a/memcheck/tests/Makefile.am b/memcheck/tests/Makefile.am index 24b39099a7..e216521b5e 100644 --- a/memcheck/tests/Makefile.am +++ b/memcheck/tests/Makefile.am @@ -625,9 +625,9 @@ sized_aligned_new_delete_args_CXXFLAGS = ${AM_CXXFLAGS} -std=c++17 sized_aligned_new_delete_misaligned1_SOURCES = sized_aligned_new_delete_misaligned1.cpp sized_aligned_new_delete_misaligned1_CXXFLAGS = ${AM_CXXFLAGS} -std=c++17 sized_aligned_new_delete_misaligned2_SOURCES = sized_aligned_new_delete_misaligned2.cpp -sized_aligned_new_delete_misaligned2_CXXFLAGS = ${AM_CXXFLAGS} -std=c++17 +sized_aligned_new_delete_misaligned2_CXXFLAGS = ${AM_CXXFLAGS} -std=c++17 @FLAG_W_NO_UNUSED_VARIABLE@ sized_aligned_new_delete_misaligned3_SOURCES = sized_aligned_new_delete_misaligned3.cpp -sized_aligned_new_delete_misaligned3_CXXFLAGS = ${AM_CXXFLAGS} -std=c++17 +sized_aligned_new_delete_misaligned3_CXXFLAGS = ${AM_CXXFLAGS} -std=c++17 @FLAG_W_NO_UNUSED_VARIABLE@ if COMPILER_IS_CLANG cxx17_aligned_new_CXXFLAGS += -fsized-deallocation sized_aligned_new_delete_args_CXXFLAGS += -fsized-deallocation |
|
From: Paul F. <pa...@so...> - 2023-09-02 14:26:32
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=a265a206203003cc0433f786478fe81a6cc3298a commit a265a206203003cc0433f786478fe81a6cc3298a Author: Paul Floyd <pj...@wa...> Date: Sun Mar 12 08:26:04 2023 +0100 Add memcheck errors for aligned and sized allocations and deallocations Bug 433857 Add validation to C++17 aligned new/delete alignment size Bug 433859 Add mismatched detection to C++ 17 aligned new/delete Bug 466105 aligned_alloc problems, part 2 Bug 467441 Add mismatched detection to C++ 14 sized delete Memcheck now tests and warns about the values used for alignment and size. These apply to various functions: memalign, posix_memalign and aligned_alloc in C and various overloads of operators new and delete in C++. The kinds of error that can be detected are - invalid alignment, for instance the alignment is usually required to be a power of 2 - mismatched alignment between aligned allocation and aligned deallocation - mismatched size when sized delete is used - bad size for functions that have implementation defined behaviour when the requested size is zero An example of the new errors is: int *pi = memalign(31, 100); which will generate the following error ==96206== Invalid alignment value: 31 (should be power of 2) ==96206== at 0x485195E: memalign (vg_replace_malloc.c:1886) ==96206== by 0x20200E: main (memalign.c:59) Diff: --- .gitignore | 8 +- NEWS | 19 +- coregrind/m_replacemalloc/vg_replace_malloc.c | 710 +++++++++++---------- coregrind/m_tooliface.c | 6 +- coregrind/pub_core_replacemalloc.h | 6 +- coregrind/pub_core_tooliface.h | 6 +- dhat/dh_main.c | 6 +- drd/drd_malloc_wrappers.c | 6 +- helgrind/hg_main.c | 6 +- include/pub_tool_replacemalloc.h | 31 + include/pub_tool_tooliface.h | 6 +- massif/ms_main.c | 6 +- memcheck/docs/mc-manual.xml | 58 +- memcheck/mc_errors.c | 262 +++++++- memcheck/mc_include.h | 13 +- memcheck/mc_main.c | 123 +++- memcheck/mc_malloc_wrappers.c | 41 +- memcheck/memcheck.h | 3 +- memcheck/tests/Makefile.am | 66 +- memcheck/tests/duplicate_align_size_errors.cpp | 53 ++ memcheck/tests/filter_size_t | 4 +- memcheck/tests/filter_stanza_and_size_t | 6 + memcheck/tests/filter_used_supp | 7 + memcheck/tests/filter_xml | 7 + memcheck/tests/freebsd/Makefile.am | 21 +- memcheck/tests/freebsd/aligned_alloc.c | 38 ++ memcheck/tests/freebsd/aligned_alloc.stderr.exp | 8 + memcheck/tests/freebsd/aligned_alloc.vgtest | 2 + .../tests/freebsd/aligned_alloc_xml.stderr.exp | 101 +++ memcheck/tests/freebsd/aligned_alloc_xml.vgtest | 4 + .../tests/freebsd/aligned_allocs_supp.stderr.exp | 15 + memcheck/tests/freebsd/aligned_allocs_supp.supp | 20 + memcheck/tests/freebsd/aligned_allocs_supp.vgtest | 4 + memcheck/tests/freebsd/bug470713.cpp | 1 + memcheck/tests/freebsd/delete_sized_mismatch.cpp | 22 + .../tests/freebsd/delete_sized_mismatch.stderr.exp | 14 + .../tests/freebsd/delete_sized_mismatch.vgtest | 3 + .../freebsd/delete_sized_mismatch_xml.stderr.exp | 139 ++++ .../tests/freebsd/delete_sized_mismatch_xml.vgtest | 3 + memcheck/tests/freebsd/errno_aligned_allocs.c | 4 + .../tests/freebsd/errno_aligned_allocs.stderr.exp | 28 +- memcheck/tests/freebsd/memalign.stderr.exp | 32 + memcheck/tests/freebsd/memalign_supp.stderr.exp | 13 + memcheck/tests/freebsd/memalign_supp.supp | 6 + memcheck/tests/freebsd/memalign_supp.vgtest | 2 + memcheck/tests/linux/Makefile.am | 4 +- memcheck/tests/linux/aligned_alloc.stderr.exp-musl | 8 + memcheck/tests/linux/memalign.c | 8 + memcheck/tests/linux/memalign.stderr.exp | 40 ++ memcheck/tests/linux/memalign.stderr.exp-musl | 40 ++ memcheck/tests/memalign_args.stderr.exp-darwin | 7 +- memcheck/tests/mismatches.cpp | 4 +- memcheck/tests/mismatches.stderr.exp2 | 56 ++ memcheck/tests/mismatches_xml.stderr.exp | 331 ++++++++++ memcheck/tests/mismatches_xml.stderr.exp2 | 427 +++++++++++++ memcheck/tests/mismatches_xml.vgtest | 3 + memcheck/tests/new_delete_mismatch_size.cpp | 30 + memcheck/tests/new_delete_mismatch_size.stderr.exp | 28 + memcheck/tests/new_delete_mismatch_size.vgtest | 5 + .../tests/new_delete_mismatch_size_supp.stderr.exp | 4 + .../new_delete_mismatch_size_supp.stderr.exp_32 | 4 + memcheck/tests/new_delete_mismatch_size_supp.supp | 57 ++ .../tests/new_delete_mismatch_size_supp.vgtest | 4 + memcheck/tests/posix_memalign.c | 52 +- memcheck/tests/posix_memalign.stderr.exp | 40 ++ memcheck/tests/posix_memalign.stderr.exp-darwin | 50 ++ memcheck/tests/posix_memalign.vgtest | 1 + memcheck/tests/posix_memalign_supp.stderr.exp | 2 + memcheck/tests/posix_memalign_supp.supp | 14 + memcheck/tests/posix_memalign_supp.vgtest | 3 + memcheck/tests/posix_memalign_xml.stderr.exp | 333 ++++++++++ memcheck/tests/posix_memalign_xml.vgtest | 3 + .../tests/sized_aligned_new_delete_args.vgtest | 2 +- .../sized_aligned_new_delete_misaligned.stderr.exp | 10 - .../sized_aligned_new_delete_misaligned.vgtest | 4 - ...pp => sized_aligned_new_delete_misaligned1.cpp} | 40 +- ...sized_aligned_new_delete_misaligned1.stderr.exp | 68 ++ .../sized_aligned_new_delete_misaligned1.vgtest | 4 + ..._aligned_new_delete_misaligned1_supp.stderr.exp | 8 + ...igned_new_delete_misaligned1_supp.stderr.exp_32 | 8 + .../sized_aligned_new_delete_misaligned1_supp.supp | 133 ++++ ...ized_aligned_new_delete_misaligned1_supp.vgtest | 4 + ...d_aligned_new_delete_misaligned1_xml.stderr.exp | 525 +++++++++++++++ ...sized_aligned_new_delete_misaligned1_xml.vgtest | 4 + .../tests/sized_aligned_new_delete_misaligned2.cpp | 10 + ...sized_aligned_new_delete_misaligned2.stderr.exp | 9 + .../sized_aligned_new_delete_misaligned2.vgtest | 4 + ..._aligned_new_delete_misaligned2_supp.stderr.exp | 1 + ...igned_new_delete_misaligned2_supp.stderr.exp_32 | 1 + .../sized_aligned_new_delete_misaligned2_supp.supp | 133 ++++ ...ized_aligned_new_delete_misaligned2_supp.vgtest | 4 + ...d_aligned_new_delete_misaligned2_xml.stderr.exp | 108 ++++ ...sized_aligned_new_delete_misaligned2_xml.vgtest | 4 + .../tests/sized_aligned_new_delete_misaligned3.cpp | 11 + ...sized_aligned_new_delete_misaligned3.stderr.exp | 9 + .../sized_aligned_new_delete_misaligned3.vgtest | 4 + ..._aligned_new_delete_misaligned3_supp.stderr.exp | 1 + ...igned_new_delete_misaligned3_supp.stderr.exp_32 | 1 + .../sized_aligned_new_delete_misaligned3_supp.supp | 133 ++++ ...ized_aligned_new_delete_misaligned3_supp.vgtest | 4 + ...d_aligned_new_delete_misaligned3_xml.stderr.exp | 108 ++++ ...sized_aligned_new_delete_misaligned3_xml.vgtest | 4 + memcheck/tests/solaris/aligned_alloc.stderr.exp | 8 + memcheck/tests/solaris/memalign.stderr.exp | 44 ++ 104 files changed, 4425 insertions(+), 483 deletions(-) diff --git a/.gitignore b/.gitignore index 6538eb718b..6aeb41df94 100644 --- a/.gitignore +++ b/.gitignore @@ -866,6 +866,7 @@ /memcheck/tests/descr_belowsp /memcheck/tests/dir /memcheck/tests/doublefree +/memcheck/tests/duplicate_align_size_errors /memcheck/tests/dw4 /memcheck/tests/erringfds /memcheck/tests/error_counts @@ -932,6 +933,7 @@ /memcheck/tests/nanoleak /memcheck/tests/nanoleak2 /memcheck/tests/nanoleak_supp +/memcheck/tests/new_delete_mismatch_size /memcheck/tests/new_nothrow /memcheck/tests/new_override /memcheck/tests/noisy_child @@ -971,7 +973,9 @@ /memcheck/tests/sh-mem /memcheck/tests/sh-mem-random /memcheck/tests/sized_aligned_new_delete_args -/memcheck/tests/sized_aligned_new_delete_misaligned +/memcheck/tests/sized_aligned_new_delete_misaligned1 +/memcheck/tests/sized_aligned_new_delete_misaligned2 +/memcheck/tests/sized_aligned_new_delete_misaligned3 /memcheck/tests/sigaltstack /memcheck/tests/sigkill /memcheck/tests/signal2 @@ -1341,11 +1345,13 @@ /memcheck/tests/freebsd/Makefile.in /memcheck/tests/freebsd/452275 /memcheck/tests/freebsd/access +/memcheck/tests/freebsd/aligned_alloc /memcheck/tests/freebsd/bug464476 /memcheck/tests/freebsd/bug470713 /memcheck/tests/freebsd/capsicum /memcheck/tests/freebsd/chflags /memcheck/tests/freebsd/chmod_chown +/memcheck/tests/freebsd/delete_sized_mismatch /memcheck/tests/freebsd/errno_aligned_allocs /memcheck/tests/freebsd/eventfd1 /memcheck/tests/freebsd/eventfd2 diff --git a/NEWS b/NEWS index 41f6d8699a..7c5247f071 100644 --- a/NEWS +++ b/NEWS @@ -22,9 +22,20 @@ AMD64/macOS 10.13 and nanoMIPS/Linux. * support has been added for FreeBSD 14 and FreeBSD 15. - * ==================== TOOL CHANGES =================== +* Memcheck now tests and warns about the values used for + alignment and size. These apply to various functions: memalign, + posix_memalign and aligned_alloc in C and various overloads + of operators new and delete in C++. The kinds of error that can + be detected are + - invalid alignment, for instance the alignment is usually required + to be a power of 2 + - mismatched alignment between aligned allocation and aligned + deallocation + - mismatched size when sized delete is used + - bad size for functions that have implementation defined behaviour + when the requested size is zero * ==================== FIXED BUGS ==================== @@ -35,8 +46,12 @@ bugzilla (https://bugs.kde.org/enter_bug.cgi?product=valgrind) rather than mailing the developers (or mailing lists) directly -- bugs that are not entered into bugzilla tend to get forgotten about or ignored. -426751 Valgrind reports «still reachable» memory using musl (alpine running inside docker) +426751 Valgrind reports "still reachable" memory using musl (alpine running inside docker) +433857 Add validation to C++17 aligned new/delete alignment size +433859 Add mismatched detection to C++ 17 aligned new/delete 460192 Add epoll_pwait2 +466105 aligned_alloc problems, part 2 +467441 Add mismatched detection to C++ 14 sized delete 469049 link failure on ppc64 (big endian) valgrind 3.20 469146 massif --ignore-fn does not ignore inlined functions 469768 Make it possible to install gdb scripts in a different location diff --git a/coregrind/m_replacemalloc/vg_replace_malloc.c b/coregrind/m_replacemalloc/vg_replace_malloc.c index a71aa4b5b2..6c6f0d60f7 100644 --- a/coregrind/m_replacemalloc/vg_replace_malloc.c +++ b/coregrind/m_replacemalloc/vg_replace_malloc.c @@ -67,9 +67,14 @@ #include "pub_core_mallocfree.h" // for VG_MIN_MALLOC_SZB, VG_AR_CLIENT #include "pub_core_redir.h" // for VG_REPLACE_FUNCTION_* #include "pub_core_replacemalloc.h" +#include "../../memcheck/memcheck.h" #define VG_ALIGN_ROUNDUP(size, alignment) (((size) + (alignment) - 1) & ~((alignment) - 1)) +#define VERIFY_ALIGNMENT(aligned_alloc_info) \ + VALGRIND_DO_CLIENT_REQUEST_STMT(_VG_USERREQ__MEMCHECK_VERIFY_ALIGNMENT, \ + aligned_alloc_info, 0, 0, 0, 0) + /* Assignment of behavioural equivalence class tags: 1NNNP is intended to be reserved for the Valgrind core. Current usage: @@ -307,15 +312,18 @@ extern int * __error(void) __attribute__((weak)); /* Generate a replacement for 'fnname' in object 'soname', which calls 'vg_replacement' to allocate aligned memory. If that fails, return NULL. */ -#define ALLOC_or_NULL_ALIGNED(soname, fnname, vg_replacement) \ +#define ALLOC_or_NULL_ALIGNED(soname, fnname, vg_replacement, tag) \ \ void* VG_REPLACE_FUNCTION_EZU(10010,soname,fnname) (SizeT n, SizeT alignment); \ void* VG_REPLACE_FUNCTION_EZU(10010,soname,fnname) (SizeT n, SizeT alignment) \ { \ void* v; \ + SizeT orig_alignment = alignment; \ \ DO_INIT; \ TRIGGER_MEMCHECK_ERROR_IF_UNDEFINED(n); \ + struct AlignedAllocInfo aligned_alloc_info = { .orig_alignment=alignment, .size=n, .alloc_kind=AllocKind##tag}; \ + VERIFY_ALIGNMENT(&aligned_alloc_info); \ MALLOC_TRACE(#fnname "(size %llu, al %llu)", (ULong)n, (ULong)alignment ); \ \ if ((alignment == 0) \ @@ -327,7 +335,7 @@ extern int * __error(void) __attribute__((weak)); if (alignment < VG_MIN_MALLOC_SZB) \ alignment = VG_MIN_MALLOC_SZB; \ \ - v = (void*)VALGRIND_NON_SIMD_CALL2( info.tl_##vg_replacement, n, alignment ); \ + v = (void*)VALGRIND_NON_SIMD_CALL3( info.tl_##vg_replacement, n, alignment, orig_alignment ); \ MALLOC_TRACE(" = %p\n", v ); \ if (!v) SET_ERRNO_ENOMEM; \ return v; \ @@ -382,15 +390,18 @@ extern int * __error(void) __attribute__((weak)); 'vg_replacement' to allocate aligned memory. If that fails, it bombs the system. */ -#define ALLOC_or_BOMB_ALIGNED(soname, fnname, vg_replacement) \ +#define ALLOC_or_BOMB_ALIGNED(soname, fnname, vg_replacement, tag) \ \ void* VG_REPLACE_FUNCTION_EZU(10030,soname,fnname) (SizeT n, SizeT alignment); \ void* VG_REPLACE_FUNCTION_EZU(10030,soname,fnname) (SizeT n, SizeT alignment) \ { \ void* v; \ + SizeT orig_alignment = alignment; \ \ DO_INIT; \ TRIGGER_MEMCHECK_ERROR_IF_UNDEFINED(n); \ + struct AlignedAllocInfo aligned_alloc_info = { .orig_alignment=alignment, .size=n, .alloc_kind=AllocKind##tag }; \ + VERIFY_ALIGNMENT(&aligned_alloc_info); \ MALLOC_TRACE(#fnname "(size %llu, al %llu)", (ULong)n, (ULong)alignment ); \ \ if ((alignment == 0) \ @@ -406,7 +417,7 @@ extern int * __error(void) __attribute__((weak)); if (alignment < VG_MIN_MALLOC_SZB) \ alignment = VG_MIN_MALLOC_SZB; \ \ - v = (void*)VALGRIND_NON_SIMD_CALL2( info.tl_##vg_replacement, n, alignment ); \ + v = (void*)VALGRIND_NON_SIMD_CALL3( info.tl_##vg_replacement, n, alignment, orig_alignment ); \ MALLOC_TRACE(" = %p\n", v ); \ if (NULL == v) { \ VALGRIND_PRINTF( \ @@ -519,55 +530,55 @@ extern int * __error(void) __attribute__((weak)); #if defined(VGO_linux) // 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); + ALLOC_or_BOMB_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnwjSt11align_val_t, __builtin_new_aligned, NewAligned); + ALLOC_or_BOMB_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnwjSt11align_val_t, __builtin_new_aligned, NewAligned); + ALLOC_or_BOMB_ALIGNED(VG_Z_LIBC_SONAME, _ZnwjSt11align_val_t, __builtin_new_aligned, NewAligned); + ALLOC_or_BOMB_ALIGNED(SO_SYN_MALLOC, _ZnwjSt11align_val_t, __builtin_new_aligned, NewAligned); #endif // 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); - ALLOC_or_BOMB_ALIGNED(VG_Z_LIBC_SONAME, _ZnwmSt11align_val_t, __builtin_new_aligned); - ALLOC_or_BOMB_ALIGNED(SO_SYN_MALLOC, _ZnwmSt11align_val_t, __builtin_new_aligned); + ALLOC_or_BOMB_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnwmSt11align_val_t, __builtin_new_aligned, NewAligned); + ALLOC_or_BOMB_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnwmSt11align_val_t, __builtin_new_aligned, NewAligned); + ALLOC_or_BOMB_ALIGNED(VG_Z_LIBC_SONAME, _ZnwmSt11align_val_t, __builtin_new_aligned, NewAligned); + ALLOC_or_BOMB_ALIGNED(SO_SYN_MALLOC, _ZnwmSt11align_val_t, __builtin_new_aligned, NewAligned); #endif #elif defined(VGO_freebsd) - // operator new(unsigned int) + // 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(SO_SYN_MALLOC, _ZnwjSt11align_val_t, __builtin_new_aligned); + ALLOC_or_BOMB_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnwjSt11align_val_t, __builtin_new_aligned, NewAligned); + ALLOC_or_BOMB_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnwjSt11align_val_t, __builtin_new_aligned, NewAligned); + ALLOC_or_BOMB_ALIGNED(SO_SYN_MALLOC, _ZnwjSt11align_val_t, __builtin_new_aligned, NewAligned); #endif - // operator new(unsigned long) + // 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); - ALLOC_or_BOMB_ALIGNED(SO_SYN_MALLOC, _ZnwmSt11align_val_t, __builtin_new_aligned); + ALLOC_or_BOMB_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnwmSt11align_val_t, __builtin_new_aligned, NewAligned); + ALLOC_or_BOMB_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnwmSt11align_val_t, __builtin_new_aligned, NewAligned); + ALLOC_or_BOMB_ALIGNED(SO_SYN_MALLOC, _ZnwmSt11align_val_t, __builtin_new_aligned, NewAligned); #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); + ALLOC_or_BOMB_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnwjSt11align_val_t, __builtin_new_aligned, NewAligned); + ALLOC_or_BOMB_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnwjSt11align_val_t, __builtin_new_aligned, NewAligned); + ALLOC_or_BOMB_ALIGNED(SO_SYN_MALLOC, _ZnwjSt11align_val_t, __builtin_new_aligned, NewAligned); #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); + ALLOC_or_BOMB_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnwmSt11align_val_t, __builtin_new_aligned, NewAligned); + ALLOC_or_BOMB_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnwmSt11align_val_t, __builtin_new_aligned, NewAligned); + ALLOC_or_BOMB_ALIGNED(SO_SYN_MALLOC, _ZnwmSt11align_val_t, __builtin_new_aligned, NewAligned); #endif #elif defined(VGO_solaris) // 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); + ALLOC_or_BOMB_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnwjSt11align_val_t, __builtin_new_aligned, NewAligned); + ALLOC_or_BOMB_ALIGNED(SO_SYN_MALLOC, _ZnwjSt11align_val_t, __builtin_new_aligned, NewAligned); #endif // 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); + ALLOC_or_BOMB_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnwmSt11align_val_t, __builtin_new_aligned, NewAligned); + ALLOC_or_BOMB_ALIGNED(SO_SYN_MALLOC, _ZnwmSt11align_val_t, __builtin_new_aligned, NewAligned); #endif @@ -639,55 +650,55 @@ extern int * __error(void) __attribute__((weak)); #if defined(VGO_linux) // 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); + ALLOC_or_NULL_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnwjSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned, NewAligned); + ALLOC_or_NULL_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnwjSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned, NewAligned); + ALLOC_or_NULL_ALIGNED(VG_Z_LIBC_SONAME, _ZnwjSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned, NewAligned); + ALLOC_or_NULL_ALIGNED(SO_SYN_MALLOC, _ZnwjSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned, NewAligned); #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, _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(VG_Z_LIBC_SONAME, _ZnwmSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned); - ALLOC_or_NULL_ALIGNED(SO_SYN_MALLOC, _ZnwmSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned); + ALLOC_or_NULL_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnwmSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned, NewAligned); + ALLOC_or_NULL_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnwmSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned, NewAligned); + ALLOC_or_NULL_ALIGNED(VG_Z_LIBC_SONAME, _ZnwmSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned, NewAligned); + ALLOC_or_NULL_ALIGNED(SO_SYN_MALLOC, _ZnwmSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned, NewAligned); #endif #elif defined(VGO_freebsd) // 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); + ALLOC_or_NULL_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnwjSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned, NewAligned); + ALLOC_or_NULL_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnwjSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned, NewAligned); + ALLOC_or_NULL_ALIGNED(SO_SYN_MALLOC, _ZnwjSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned, NewAligned); #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, _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); + ALLOC_or_NULL_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnwmSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned, NewAligned); + ALLOC_or_NULL_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnwmSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned, NewAligned); + ALLOC_or_NULL_ALIGNED(SO_SYN_MALLOC, _ZnwmSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned, NewAligned); #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); + ALLOC_or_NULL_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnwjSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned, NewAligned); + ALLOC_or_NULL_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnwjSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned, NewAligned); + ALLOC_or_NULL_ALIGNED(SO_SYN_MALLOC, _ZnwjSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned, NewAligned); #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); + ALLOC_or_NULL_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnwmSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned, NewAligned); + ALLOC_or_NULL_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnwmSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned, NewAligned); + ALLOC_or_NULL_ALIGNED(SO_SYN_MALLOC, _ZnwmSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned, NewAligned); #endif #elif defined(VGO_solaris) // 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); + ALLOC_or_NULL_ALIGNED(VG_Z_LIBSTDCXX_SONAME, __ZnwjSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned, NewAligned); + ALLOC_or_NULL_ALIGNED(SO_SYN_MALLOC, __ZnwjSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned, NewAligned); #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, _ZnwmSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned); - ALLOC_or_NULL_ALIGNED(SO_SYN_MALLOC, _ZnwmSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned); + ALLOC_or_NULL_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnwmSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned, NewAligned); + ALLOC_or_NULL_ALIGNED(SO_SYN_MALLOC, _ZnwmSt11align_val_tRKSt9nothrow_t, __builtin_new_aligned, NewAligned); #endif #endif @@ -761,57 +772,57 @@ extern int * __error(void) __attribute__((weak)); #if defined(VGO_linux) // 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 ); + ALLOC_or_BOMB_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnajSt11align_val_t, __builtin_vec_new_aligned, VecNewAligned ); + ALLOC_or_BOMB_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnajSt11align_val_t, __builtin_vec_new_aligned, VecNewAligned ); + ALLOC_or_BOMB_ALIGNED(VG_Z_LIBC_SONAME, _ZnajSt11align_val_t, __builtin_vec_new_aligned, VecNewAligned ); + ALLOC_or_BOMB_ALIGNED(SO_SYN_MALLOC, _ZnajSt11align_val_t, __builtin_vec_new_aligned, VecNewAligned ); #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(VG_Z_LIBC_SONAME, _ZnamSt11align_val_t, __builtin_vec_new_aligned ); - ALLOC_or_BOMB_ALIGNED(SO_SYN_MALLOC, _ZnamSt11align_val_t, __builtin_vec_new_aligned ); + ALLOC_or_BOMB_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnamSt11align_val_t, __builtin_vec_new_aligned, VecNewAligned ); + ALLOC_or_BOMB_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnamSt11align_val_t, __builtin_vec_new_aligned, VecNewAligned ); + ALLOC_or_BOMB_ALIGNED(VG_Z_LIBC_SONAME, _ZnamSt11align_val_t, __builtin_vec_new_aligned, VecNewAligned ); + ALLOC_or_BOMB_ALIGNED(SO_SYN_MALLOC, _ZnamSt11align_val_t, __builtin_vec_new_aligned, VecNewAligned ); #endif #elif defined(VGO_freebsd) // 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 ); + ALLOC_or_BOMB_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnajSt11align_val_t, __builtin_vec_new_aligned, VecNewAligned ); + ALLOC_or_BOMB_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnajSt11align_val_t, __builtin_vec_new_aligned, VecNewAligned ); + ALLOC_or_BOMB_ALIGNED(SO_SYN_MALLOC, _ZnajSt11align_val_t, __builtin_vec_new_aligned, VecNewAligned ); #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 ); + ALLOC_or_BOMB_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnamSt11align_val_t, __builtin_vec_new_aligned, VecNewAligned ); + ALLOC_or_BOMB_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnamSt11align_val_t, __builtin_vec_new_aligned, VecNewAligned ); + ALLOC_or_BOMB_ALIGNED(SO_SYN_MALLOC, _ZnamSt11align_val_t, __builtin_vec_new_aligned, VecNewAligned ); #endif #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 ); + ALLOC_or_BOMB_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnajSt11align_val_t, __builtin_vec_new_aligned, VecNewAligned ); + ALLOC_or_BOMB_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnajSt11align_val_t, __builtin_vec_new_aligned, VecNewAligned ); + ALLOC_or_BOMB_ALIGNED(SO_SYN_MALLOC, _ZnajSt11align_val_t, __builtin_vec_new_aligned, VecNewAligned ); #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 ); + ALLOC_or_BOMB_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnamSt11align_val_t, __builtin_vec_new_aligned, VecNewAligned ); + ALLOC_or_BOMB_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnamSt11align_val_t, __builtin_vec_new_aligned, VecNewAligned ); + ALLOC_or_BOMB_ALIGNED(SO_SYN_MALLOC, _ZnamSt11align_val_t, __builtin_vec_new_aligned, VecNewAligned ); #endif #elif defined(VGO_solaris) // 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 ); + ALLOC_or_BOMB_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnajSt11align_val_t, __builtin_vec_new_aligned, VecNewAligned ); + ALLOC_or_BOMB_ALIGNED(SO_SYN_MALLOC, _ZnajSt11align_val_t, __builtin_vec_new_aligned, VecNewAligned ); #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(SO_SYN_MALLOC, _ZnamSt11align_val_t, __builtin_vec_new_aligned ); + ALLOC_or_BOMB_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnamSt11align_val_t, __builtin_vec_new_aligned, VecNewAligned ); + ALLOC_or_BOMB_ALIGNED(SO_SYN_MALLOC, _ZnamSt11align_val_t, __builtin_vec_new_aligned, VecNewAligned ); #endif #endif @@ -882,57 +893,57 @@ extern int * __error(void) __attribute__((weak)); #if defined(VGO_linux) // 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 ); + ALLOC_or_NULL_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnajSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned, VecNewAligned ); + ALLOC_or_NULL_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnajSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned, VecNewAligned ); + ALLOC_or_NULL_ALIGNED(VG_Z_LIBC_SONAME, _ZnajSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned, VecNewAligned ); + ALLOC_or_NULL_ALIGNED(SO_SYN_MALLOC, _ZnajSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned, VecNewAligned ); #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(VG_Z_LIBC_SONAME, _ZnamSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned ); - ALLOC_or_NULL_ALIGNED(SO_SYN_MALLOC, _ZnamSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned ); + ALLOC_or_NULL_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnamSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned, VecNewAligned ); + ALLOC_or_NULL_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnamSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned, VecNewAligned ); + ALLOC_or_NULL_ALIGNED(VG_Z_LIBC_SONAME, _ZnamSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned, VecNewAligned ); + ALLOC_or_NULL_ALIGNED(SO_SYN_MALLOC, _ZnamSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned, VecNewAligned ); #endif #elif defined(VGO_freebsd) // 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 ); + ALLOC_or_NULL_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnajSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned, VecNewAligned ); + ALLOC_or_NULL_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnajSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned, VecNewAligned ); + ALLOC_or_NULL_ALIGNED(SO_SYN_MALLOC, _ZnajSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned, VecNewAligned ); #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 ); + ALLOC_or_NULL_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnamSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned, VecNewAligned ); + ALLOC_or_NULL_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnamSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned, VecNewAligned ); + ALLOC_or_NULL_ALIGNED(SO_SYN_MALLOC, _ZnamSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned, VecNewAligned ); #endif #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 ); + ALLOC_or_NULL_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnajSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned, VecNewAligned ); + ALLOC_or_NULL_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnajSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned, VecNewAligned ); + ALLOC_or_NULL_ALIGNED(SO_SYN_MALLOC, _ZnajSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned, VecNewAligned ); #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 ); + ALLOC_or_NULL_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnamSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned, VecNewAligned ); + ALLOC_or_NULL_ALIGNED(VG_Z_LIBCXX_SONAME, _ZnamSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned, VecNewAligned ); + ALLOC_or_NULL_ALIGNED(SO_SYN_MALLOC, _ZnamSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned, VecNewAligned ); #endif #elif defined(VGO_solaris) // 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 ); + ALLOC_or_NULL_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnajSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned, VecNewAligned ); + ALLOC_or_NULL_ALIGNED(SO_SYN_MALLOC, _ZnajSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned, VecNewAligned ); #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(SO_SYN_MALLOC, _ZnamSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned ); + ALLOC_or_NULL_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZnamSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned, VecNewAligned ); + ALLOC_or_NULL_ALIGNED(SO_SYN_MALLOC, _ZnamSt11align_val_tRKSt9nothrow_t, __builtin_vec_new_aligned, VecNewAligned ); #endif #endif @@ -1044,13 +1055,16 @@ extern int * __error(void) __attribute__((weak)); /*------------------- C++14 delete sized -------------------*/ -#define DELETE_SIZED(soname, fnname, vg_replacement) \ +#define DELETE_SIZED(soname, fnname, vg_replacement, tag) \ \ void VG_REPLACE_FUNCTION_EZU(10050,soname,fnname) (void *p, SizeT size); \ void VG_REPLACE_FUNCTION_EZU(10050,soname,fnname) (void *p, SizeT size) \ { \ + struct AlignedAllocInfo aligned_alloc_info = { .size=size, .mem=p, .alloc_kind=AllocKind##tag }; \ + \ DO_INIT; \ TRIGGER_MEMCHECK_ERROR_IF_UNDEFINED((UWord)size); \ + VERIFY_ALIGNMENT(&aligned_alloc_info); \ MALLOC_TRACE(#fnname "(%p)\n", p ); \ if (p == NULL) \ return; \ @@ -1060,79 +1074,89 @@ extern int * __error(void) __attribute__((weak)); #if defined(VGO_linux) // 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(VG_Z_LIBC_SONAME, _ZdlPvj, __builtin_delete ); - DELETE_SIZED(SO_SYN_MALLOC, _ZdlPvj, __builtin_delete ); + DELETE_SIZED(VG_Z_LIBSTDCXX_SONAME, _ZdlPvj, __builtin_delete, DeleteSized ); + DELETE_SIZED(VG_Z_LIBCXX_SONAME, _ZdlPvj, __builtin_delete, DeleteSized ); + DELETE_SIZED(VG_Z_LIBC_SONAME, _ZdlPvj, __builtin_delete, DeleteSized ); + DELETE_SIZED(SO_SYN_MALLOC, _ZdlPvj, __builtin_delete, DeleteSized ); // operator delete(void*, unsigned long) #elif __SIZEOF_SIZE_T__ == 8 - DELETE_SIZED(VG_Z_LIBSTDCXX_SONAME, _ZdlPvm, __builtin_delete ); - DELETE_SIZED(VG_Z_LIBCXX_SONAME, _ZdlPvm, __builtin_delete ); - DELETE_SIZED(VG_Z_LIBC_SONAME, _ZdlPvm, __builtin_delete ); - DELETE_SIZED(SO_SYN_MALLOC, _ZdlPvm, __builtin_delete ); + DELETE_SIZED(VG_Z_LIBSTDCXX_SONAME, _ZdlPvm, __builtin_delete, DeleteSized ); + DELETE_SIZED(VG_Z_LIBCXX_SONAME, _ZdlPvm, __builtin_delete, DeleteSized ); + DELETE_SIZED(VG_Z_LIBC_SONAME, _ZdlPvm, __builtin_delete, DeleteSized ); + DELETE_SIZED(SO_SYN_MALLOC, _ZdlPvm, __builtin_delete, DeleteSized ); #endif #elif defined(VGO_freebsd) // 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 ); + DELETE_SIZED(VG_Z_LIBSTDCXX_SONAME, _ZdlPvj, __builtin_delete, DeleteSized ); + DELETE_SIZED(VG_Z_LIBCXX_SONAME, _ZdlPvj, __builtin_delete, DeleteSized ); + DELETE_SIZED(SO_SYN_MALLOC, _ZdlPvj, __builtin_delete, DeleteSized ); #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 ); + DELETE_SIZED(VG_Z_LIBSTDCXX_SONAME, _ZdlPvm, __builtin_delete, DeleteSized ); + DELETE_SIZED(VG_Z_LIBCXX_SONAME, _ZdlPvm, __builtin_delete, DeleteSized ); + DELETE_SIZED(SO_SYN_MALLOC, _ZdlPvm, __builtin_delete, DeleteSized ); #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 ); + DELETE_SIZED(VG_Z_LIBSTDCXX_SONAME, _ZdlPvj, __builtin_delete, DeleteSized ); + DELETE_SIZED(VG_Z_LIBCXX_SONAME, _ZdlPvj, __builtin_delete, DeleteSized ); + DELETE_SIZED(SO_SYN_MALLOC, _ZdlPvj, __builtin_delete, DeleteSized ); #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 ); + DELETE_SIZED(VG_Z_LIBSTDCXX_SONAME, _ZdlPvm, __builtin_delete, DeleteSized ); + DELETE_SIZED(VG_Z_LIBCXX_SONAME, _ZdlPvm, __builtin_delete, DeleteSized ); + DELETE_SIZED(SO_SYN_MALLOC, _ZdlPvm, __builtin_delete, DeleteSized ); #endif #elif defined(VGO_solaris) // operator delete(void*, unsigned long) #if __SIZEOF_SIZE_T__ == 4 - DELETE_SIZED(VG_Z_LIBSTDCXX_SONAME, _ZdlPvj, __builtin_delete ); - DELETE_SIZED(SO_SYN_MALLOC, _ZdlPvj, __builtin_delete ); + DELETE_SIZED(VG_Z_LIBSTDCXX_SONAME, _ZdlPvj, __builtin_delete, DeleteSized ); + DELETE_SIZED(SO_SYN_MALLOC, _ZdlPvj, __builtin_delete, DeleteSized ); #elif __SIZEOF_SIZE_T__ == 8 - DELETE_SIZED(VG_Z_LIBSTDCXX_SONAME, _ZdlPvm, __builtin_delete ); - DELETE_SIZED(SO_SYN_MALLOC, _ZdlPvm, __builtin_delete ); + DELETE_SIZED(VG_Z_LIBSTDCXX_SONAME, _ZdlPvm, __builtin_delete, DeleteSized ); + DELETE_SIZED(SO_SYN_MALLOC, _ZdlPvm, __builtin_delete, DeleteSized ); #endif #endif /*------------------- C++17 delete aligned -------------------*/ -#define DELETE_ALIGNED(soname, fnname, vg_replacement) \ +/* No need to check the alignment + * either the alignment matches the alloc + * or the alloc would have failed */ + +#define DELETE_ALIGNED(soname, fnname, vg_replacement, tag ) \ \ void VG_REPLACE_FUNCTION_EZU(10050,soname,fnname) (void *p, SizeT alignment); \ void VG_REPLACE_FUNCTION_EZU(10050,soname,fnname) (void *p, SizeT alignment) \ { \ + struct AlignedAllocInfo aligned_alloc_info = { .orig_alignment=alignment, .mem=p, .alloc_kind=AllocKind##tag }; \ + \ DO_INIT; \ TRIGGER_MEMCHECK_ERROR_IF_UNDEFINED((UWord)alignment); \ + VERIFY_ALIGNMENT(&aligned_alloc_info); \ MALLOC_TRACE(#fnname "(%p)\n", p ); \ if (p == NULL) \ return; \ (void)VALGRIND_NON_SIMD_CALL1( info.tl_##vg_replacement, p ); \ } -#define DELETE_SIZED_ALIGNED(soname, fnname, vg_replacement) \ +#define DELETE_SIZED_ALIGNED(soname, fnname, vg_replacement, tag ) \ \ void VG_REPLACE_FUNCTION_EZU(10050,soname,fnname) (void *p, SizeT size, SizeT alignment); \ void VG_REPLACE_FUNCTION_EZU(10050,soname,fnname) (void *p, SizeT size, SizeT alignment) \ { \ + struct AlignedAllocInfo aligned_alloc_info = { .orig_alignment=alignment, .size=size, .mem=p, .alloc_kind=AllocKind##tag }; \ + \ DO_INIT; \ TRIGGER_MEMCHECK_ERROR_IF_UNDEFINED((UWord)size); \ TRIGGER_MEMCHECK_ERROR_IF_UNDEFINED((UWord)alignment); \ + VERIFY_ALIGNMENT(&aligned_alloc_info); \ MALLOC_TRACE(#fnname "(%p)\n", p ); \ if (p == NULL) \ return; \ @@ -1141,76 +1165,76 @@ extern int * __error(void) __attribute__((weak)); #if defined(VGO_linux) // 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 ); + DELETE_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdlPvSt11align_val_t, __builtin_delete_aligned, DeleteAligned ); + DELETE_ALIGNED(VG_Z_LIBCXX_SONAME, _ZdlPvSt11align_val_t, __builtin_delete_aligned, DeleteAligned ); + DELETE_ALIGNED(VG_Z_LIBC_SONAME, _ZdlPvSt11align_val_t, __builtin_delete_aligned, DeleteAligned ); + DELETE_ALIGNED(SO_SYN_MALLOC, _ZdlPvSt11align_val_t, __builtin_delete_aligned, DeleteAligned ); // 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 ); + DELETE_SIZED_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdlPvjSt11align_val_t, __builtin_delete_aligned, DeleteSizedAligned ); + DELETE_SIZED_ALIGNED(VG_Z_LIBCXX_SONAME, _ZdlPvjSt11align_val_t, __builtin_delete_aligned, DeleteSizedAligned ); + DELETE_SIZED_ALIGNED(VG_Z_LIBC_SONAME, _ZdlPvjSt11align_val_t, __builtin_delete_aligned, DeleteSizedAligned ); + DELETE_SIZED_ALIGNED(SO_SYN_MALLOC, _ZdlPvjSt11align_val_t, __builtin_delete_aligned, DeleteSizedAligned ); // 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(VG_Z_LIBC_SONAME, _ZdlPvmSt11align_val_t, __builtin_delete_aligned ); - DELETE_SIZED_ALIGNED(SO_SYN_MALLOC, _ZdlPvmSt11align_val_t, __builtin_delete_aligned ); + DELETE_SIZED_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdlPvmSt11align_val_t, __builtin_delete_aligned, DeleteSizedAligned ); + DELETE_SIZED_ALIGNED(VG_Z_LIBCXX_SONAME, _ZdlPvmSt11align_val_t, __builtin_delete_aligned, DeleteSizedAligned ); + DELETE_SIZED_ALIGNED(VG_Z_LIBC_SONAME, _ZdlPvmSt11align_val_t, __builtin_delete_aligned, DeleteSizedAligned ); + DELETE_SIZED_ALIGNED(SO_SYN_MALLOC, _ZdlPvmSt11align_val_t, __builtin_delete_aligned, DeleteSizedAligned ); #endif #elif defined(VGO_freebsd) // 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 ); + DELETE_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdlPvSt11align_val_t, __builtin_delete_aligned, DeleteAligned ); + DELETE_ALIGNED(VG_Z_LIBCXX_SONAME, _ZdlPvSt11align_val_t, __builtin_delete_aligned, DeleteAligned ); + DELETE_ALIGNED(SO_SYN_MALLOC, _ZdlPvSt11align_val_t, __builtin_delete_aligned, DeleteAligned ); // 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 ); + DELETE_SIZED_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdlPvjSt11align_val_t, __builtin_delete_aligned, DeleteSizedAligned ); + DELETE_SIZED_ALIGNED(VG_Z_LIBCXX_SONAME, _ZdlPvjSt11align_val_t, __builtin_delete_aligned, DeleteSizedAligned ); + DELETE_SIZED_ALIGNED(SO_SYN_MALLOC, _ZdlPvjSt11align_val_t, __builtin_delete_aligned, DeleteSizedAligned ); // 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 ); + DELETE_SIZED_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdlPvmSt11align_val_t, __builtin_delete_aligned, DeleteSizedAligned ); + DELETE_SIZED_ALIGNED(VG_Z_LIBCXX_SONAME, _ZdlPvmSt11align_val_t, __builtin_delete_aligned, DeleteSizedAligned ); + DELETE_SIZED_ALIGNED(SO_SYN_MALLOC, _ZdlPvmSt11align_val_t, __builtin_delete_aligned, DeleteSizedAligned ); #endif #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 ); + DELETE_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdlPvSt11align_val_t, __builtin_delete_aligned, DeleteAligned ); + DELETE_ALIGNED(VG_Z_LIBCXX_SONAME, _ZdlPvSt11align_val_t, __builtin_delete_aligned, DeleteAligned ); + DELETE_ALIGNED(SO_SYN_MALLOC, _ZdlPvSt11align_val_t, __builtin_delete_aligned, DeleteAligned ); // 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 ); + DELETE_SIZED_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdlPvjSt11align_val_t, __builtin_delete_aligned, DeleteSizedAligned ); + DELETE_SIZED_ALIGNED(VG_Z_LIBCXX_SONAME, _ZdlPvjSt11align_val_t, __builtin_delete_aligned, DeleteSizedAligned ); + DELETE_SIZED_ALIGNED(SO_SYN_MALLOC, _ZdlPvjSt11align_val_t, __builtin_delete_aligned, DeleteSizedAligned ); // 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 ); + DELETE_SIZED_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdlPvmSt11align_val_t, __builtin_delete_aligned, DeleteSizedAligned ); + DELETE_SIZED_ALIGNED(VG_Z_LIBCXX_SONAME, _ZdlPvmSt11align_val_t, __builtin_delete_aligned, DeleteSizedAligned ); + DELETE_SIZED_ALIGNED(SO_SYN_MALLOC, _ZdlPvmSt11align_val_t, __builtin_delete_aligned, DeleteSizedAligned ); #endif #elif defined(VGO_solaris) // operator delete(void*, std::align_val_t) - DELETE_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdlPvSt11align_val_t, __builtin_delete_aligned ); - DELETE_ALIGNED(SO_SYN_MALLOC, _ZdlPvSt11align_val_t, __builtin_delete_aligned ); + DELETE_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdlPvSt11align_val_t, __builtin_delete_aligned, DeleteAligned ); + DELETE_ALIGNED(SO_SYN_MALLOC, _ZdlPvSt11align_val_t, __builtin_delete_aligned, DeleteAligned ); // 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(SO_SYN_MALLOC, _ZdlPvjSt11align_val_t, __builtin_delete_aligned ); + DELETE_SIZED_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdlPvjSt11align_val_t, __builtin_delete_aligned, DeleteSizedAligned ); + DELETE_SIZED_ALIGNED(SO_SYN_MALLOC, _ZdlPvjSt11align_val_t, __builtin_delete_aligned, DeleteSizedAligned ); // 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(SO_SYN_MALLOC, _ZdlPvmSt11align_val_t, __builtin_delete_aligned ); + DELETE_SIZED_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdlPvmSt11align_val_t, __builtin_delete_aligned, DeleteSizedAligned ); + DELETE_SIZED_ALIGNED(SO_SYN_MALLOC, _ZdlPvmSt11align_val_t, __builtin_delete_aligned, DeleteSizedAligned ); #endif #endif @@ -1247,29 +1271,29 @@ extern int * __error(void) __attribute__((weak)); #if defined(VGO_linux) // 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 ); - DELETE_ALIGNED(SO_SYN_MALLOC, _ZdlPvSt11align_val_tRKSt9nothrow_t, __builtin_delete_aligned ); + DELETE_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdlPvSt11align_val_tRKSt9nothrow_t, __builtin_delete_aligned, DeleteAligned ); + DELETE_ALIGNED(VG_Z_LIBCXX_SONAME, _ZdlPvSt11align_val_tRKSt9nothrow_t, __builtin_delete_aligned, DeleteAligned ); + DELETE_ALIGNED(VG_Z_LIBC_SONAME, _ZdlPvSt11align_val_tRKSt9nothrow_t, __builtin_delete_aligned, DeleteAligned ); + DELETE_ALIGNED(SO_SYN_MALLOC, _ZdlPvSt11align_val_tRKSt9nothrow_t, __builtin_delete_aligned, DeleteAligned ); // no sized version of this operator #elif defined(VGO_freebsd) // 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 ); + DELETE_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdlPvSt11align_val_tRKSt9nothrow_t, __builtin_delete_aligned, DeleteAligned ); + DELETE_ALIGNED(VG_Z_LIBCXX_SONAME, _ZdlPvSt11align_val_tRKSt9nothrow_t, __builtin_delete_aligned, DeleteAligned ); + DELETE_ALIGNED(SO_SYN_MALLOC, _ZdlPvSt11align_val_tRKSt9nothrow_t, __builtin_delete_aligned, DeleteAligned ); #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 ); + DELETE_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdlPvSt11align_val_tRKSt9nothrow_t, __builtin_delete_aligned, DeleteAligned ); + DELETE_ALIGNED(VG_Z_LIBCXX_SONAME, _ZdlPvSt11align_val_tRKSt9nothrow_t, __builtin_delete_aligned, DeleteAligned ); + DELETE_ALIGNED(SO_SYN_MALLOC, _ZdlPvSt11align_val_tRKSt9nothrow_t, __builtin_delete_aligned, DeleteAligned ); #elif defined(VGO_solaris) // 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 ); + DELETE_ALIGNED(VG_Z_LIBSTDCXX_SONAME, _ZdlPvSt11align_val_tRKSt9nothrow_t, __builtin_delete_aligned, DeleteAligned ); + DELETE_ALIGNED(SO_SYN_MALLOC, _ZdlPvSt11align_val_tRKSt9nothrow_t, __builtin_delete_aligned, DeleteAligned ); // no sized version of this operator @@ -1311,51 +1335,51 @@ extern int * __error(void) __attribute__((weak)); #if defined(VGO_linux) // operator delete[](void*, unsigned int) #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(VG_Z_LIBC_SONAME, _ZdaPvj, __builtin_vec_delete ); - DELETE_SIZED(SO_SYN_MALLOC, _ZdaPvj, __builtin_vec_delete ); + DELETE_SIZED(VG_Z_LIBSTDCXX_SONAME, _ZdaPvj, __builtin_vec_delete, VecDeleteSized ); + DELETE_SIZED(VG_Z_LIBCXX_SONAME, _ZdaPvj, __builtin_vec_delete, VecDeleteSized ); + DELETE_SIZED(VG_Z_LIBC_SONAME, _ZdaPvj, __builtin_vec_delete, VecDeleteSized ); + DELETE_SIZED(SO_SYN_MALLOC, _ZdaPvj, ... [truncated message content] |
|
From: Paul F. <pa...@so...> - 2023-09-02 12:10:13
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=6489bc63a13fcf614cdb1cb318ea9a1f898a39cd commit 6489bc63a13fcf614cdb1cb318ea9a1f898a39cd Author: Paul Floyd <pj...@wa...> Date: Sat Sep 2 14:08:07 2023 +0200 regtest: make memcheck sem test quiet On Solaris the summary shows 7 allocations causing a diff. Diff: --- memcheck/tests/sem.stderr.exp | 10 ---------- memcheck/tests/sem.vgtest | 1 + 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/memcheck/tests/sem.stderr.exp b/memcheck/tests/sem.stderr.exp index eb42921c60..e69de29bb2 100644 --- a/memcheck/tests/sem.stderr.exp +++ b/memcheck/tests/sem.stderr.exp @@ -1,10 +0,0 @@ - - -HEAP SUMMARY: - in use at exit: 0 bytes in 0 blocks - total heap usage: 0 allocs, 0 frees, 0 bytes allocated - -For a detailed leak analysis, rerun with: --leak-check=full - -For lists of detected and suppressed errors, rerun with: -s -ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) diff --git a/memcheck/tests/sem.vgtest b/memcheck/tests/sem.vgtest index 876f002110..a95230830b 100644 --- a/memcheck/tests/sem.vgtest +++ b/memcheck/tests/sem.vgtest @@ -1 +1,2 @@ prog: ../../none/tests/sem +vgopts: -q |
|
From: Paul F. <pa...@so...> - 2023-09-02 11:52:52
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=b93ae9a9c8c071fcbf2d0ece052d084b63f6c39c commit b93ae9a9c8c071fcbf2d0ece052d084b63f6c39c Author: Paul Floyd <pj...@wa...> Date: Sat Sep 2 13:52:12 2023 +0200 Solaris: fix a few compiler warnings Diff: --- coregrind/m_coredump/coredump-solaris.c | 2 +- coregrind/m_debuginfo/readelf.c | 2 +- coregrind/m_initimg/initimg-solaris.c | 2 +- coregrind/m_syswrap/syswrap-solaris.c | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/coregrind/m_coredump/coredump-solaris.c b/coregrind/m_coredump/coredump-solaris.c index 8e84dba51f..00d131b370 100644 --- a/coregrind/m_coredump/coredump-solaris.c +++ b/coregrind/m_coredump/coredump-solaris.c @@ -886,7 +886,7 @@ void VG_(make_coredump)(ThreadId tid, const vki_siginfo_t *si, VG_(snprintf)(filename, filename_size, "%s%s.%d", basename, coreext, VG_(getpid)()); else - VG_(snprintf)(filename, filename_size, "%s%s.%d.%d", + VG_(snprintf)(filename, filename_size, "%s%s.%d.%u", basename, coreext, VG_(getpid)(), seq); seq++; diff --git a/coregrind/m_debuginfo/readelf.c b/coregrind/m_debuginfo/readelf.c index a4c79efd0f..ef9a722ad9 100644 --- a/coregrind/m_debuginfo/readelf.c +++ b/coregrind/m_debuginfo/readelf.c @@ -1343,7 +1343,7 @@ DiImage* open_debug_file( const HChar* name, const HChar* buildid, UInt crc, if (VG_(clo_verbosity) > 1) VG_(message)(Vg_DebugMsg, " .. build-id mismatch (found %s wanted %s)\n", - debug_buildid, buildid); + (debug_buildid ? debug_buildid : "(null)"), buildid); ML_(dinfo_free)(debug_buildid); return NULL; } diff --git a/coregrind/m_initimg/initimg-solaris.c b/coregrind/m_initimg/initimg-solaris.c index 3e473c8803..1e9e3fd061 100644 --- a/coregrind/m_initimg/initimg-solaris.c +++ b/coregrind/m_initimg/initimg-solaris.c @@ -920,7 +920,7 @@ IIFinaliseImageInfo VG_(ii_create_image)(IICreateImageInfo iicii, szB = VG_PGROUNDUP(szB); VG_(debugLog)(1, "initimg", - "Setup client stack: size will be %ld\n", szB); + "Setup client stack: size will be %lu\n", szB); iifii.clstack_max_size = szB; iifii.initial_client_SP = setup_client_stack(init_sp, env, &info, diff --git a/coregrind/m_syswrap/syswrap-solaris.c b/coregrind/m_syswrap/syswrap-solaris.c index ed3cb4a551..b5489644c1 100644 --- a/coregrind/m_syswrap/syswrap-solaris.c +++ b/coregrind/m_syswrap/syswrap-solaris.c @@ -639,10 +639,11 @@ void VG_(restore_context)(ThreadId tid, vki_ucontext_t *uc, CorePart part, if (tst->os_state.ustack && VG_(am_is_valid_for_client)((Addr)tst->os_state.ustack, sizeof(*tst->os_state.ustack), - VKI_PROT_WRITE)) + VKI_PROT_WRITE)) { *tst->os_state.ustack = uc->uc_stack; VG_TRACK(post_mem_write, part, tid, (Addr)&tst->os_state.ustack, sizeof(tst->os_state.ustack)); + } } /* Restore the architecture-specific part of the context. */ |
|
From: Paul F. <pa...@so...> - 2023-09-02 11:21:48
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=ae4e70d97d46c58a99782ff007df1cdc34ac1219 commit ae4e70d97d46c58a99782ff007df1cdc34ac1219 Author: Paul Floyd <pj...@wa...> Date: Sat Sep 2 15:20:36 2023 +0200 FreeBSD: Add support for building on FreeBSD 15.0 Diff: --- NEWS | 2 ++ configure.ac | 11 +++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 832d24e45a..41f6d8699a 100644 --- a/NEWS +++ b/NEWS @@ -20,6 +20,8 @@ AMD64/macOS 10.13 and nanoMIPS/Linux. * ================== PLATFORM CHANGES ================= +* support has been added for FreeBSD 14 and FreeBSD 15. + * ==================== TOOL CHANGES =================== diff --git a/configure.ac b/configure.ac index e9592f47ec..2aaf3f44bb 100755 --- a/configure.ac +++ b/configure.ac @@ -398,6 +398,8 @@ case "${host_os}" in freebsd_13_2=1320 AC_DEFINE([FREEBSD_14], 1400, [FREEBSD_VERS value for FreeBSD 14.x]) freebsd_14=1400 + AC_DEFINE([FREEBSD_15], 1500, [FREEBSD_VERS value for FreeBSD 15.x]) + freebsd_15=1500 AC_MSG_CHECKING([for the kernel version]) kernel=`uname -r` @@ -446,7 +448,7 @@ case "${host_os}" in ;; *) AC_MSG_RESULT([unsupported (${kernel})]) - AC_MSG_ERROR([Valgrind works on FreeBSD 10.x to 14.x]) + AC_MSG_ERROR([Valgrind works on FreeBSD 10.x to 15.x]) ;; esac ;; @@ -455,9 +457,14 @@ case "${host_os}" in AC_DEFINE([FREEBSD_VERS], FREEBSD_14, [FreeBSD version]) freebsd_vers=$freebsd_14 ;; + 15.*) + AC_MSG_RESULT([FreeBSD 15.x (${kernel})]) + AC_DEFINE([FREEBSD_VERS], FREEBSD_15, [FreeBSD version]) + freebsd_vers=$freebsd_15 + ;; *) AC_MSG_RESULT([unsupported (${kernel})]) - AC_MSG_ERROR([Valgrind works on FreeBSD 10.x to 14.x]) + AC_MSG_ERROR([Valgrind works on FreeBSD 10.x to 15.x]) ;; esac |
|
From: Mark W. <ma...@kl...> - 2023-09-02 00:08:12
|
Hi Carl, On Fri, Sep 01, 2023 at 11:59:39AM -0700, Carl Love via Valgrind-developers wrote: > The test results are: > > machine pre-lazy-load current mainline with ppc debuginfo fix with Explicitly-load- > (as of 8/31/2023) libc-and-any-sonames > > Power 8 LE Red Hat Enterprise Linux Server 7.9 (Maipo) > 707 tests, 708 tests, 708 tests 708 tests, > 4 stderr failures, 280 stderr failures, 247 stderr failures, 4 stderr failures, > 0 stdout failures, 54 stdout failures, 54 stdout failures, 0 stdout failures, > 13 stderrB failures, 16 stderrB failures, 16 stderrB failures, 13 stderrB failures, > 0 stdoutB failures, 11 stdoutB failures, 12 stdoutB failures 0 stdoutB failures > 9 post failures 13 post failures 9 post failures 9 post failures > > Power 8 BE Ubuntu 20.04.5 LTS (Focal Fossa) > 742 tests, 743 tests, 743 tests, 743 tests, > 2 stderr failures, 671 stderr failures, 671 stderr failures, 671 stderr failures > 0 stdout failures, 152 stdout failures, 152 stdout failures, 152 stdout failures, > 0 stderrB failures, 14 stderrB failures, 14 stderrB failures, 14 stderrB failures, > 2 stdoutB failures, 20 stdoutB failures, 20 stdoutB failures, 20 stdoutB failures, > 9 post failures 43 post failures 43 post failures 43 post failures > > Power 9 LE Ubuntu 20.04.5 LTS (Focal Fossa) > 711 tests, 712 tests, 712 tests, 712 tests, > 4 stderr failures, 280 stderr failures, 247 stderr failures, 4 stderr failures, > 0 stdout failures, 54 stdout failures, 54 stdout failures, 0 stdout failures, > 13 stderrB failures, 16 stderrB failures, 16 stderrB failures, 13 stderrB failures, > 0 stdoutB failures, 12 stdoutB failures, 12 stdoutB failures 0 stdoutB failures, > 9 post failures 13 post failures 9 post failures 9 post failures > > Power 10 LE Red Hat Enterprise Linux 9.0 (Plow) > 719 tests 720 tests, 720 tests, 720 tests, > 2 stderr failures, 42 stderr failures, 2 stderr failures, 2 stderr failures, > 0 stdout failures, 0 stdout failures, 0 stdout failures, 0 stdout failures, > 2 stderrB failures, 2 stderrB failures, 2 stderrB failures, 2 stderrB failures, > 10 stdoutB failures, 10 stdoutB failures, 10 stdoutB failures, 10 stdoutB failures > 0 post failures 3 post failures 0 post failures 0 post failures > > The Explicitly-load-libc-and-any-sonames-that-contain-ma.patch seems > to fix the issues across the various OS distributions for the LE > machines. It does appear that there is a separate issue with the > original patch to lazily load the debug info on PowerPC BE. > Hopefully we can sort that issue out when Aaron gets back from > vacation. The little endian results look really good. Thanks for all the testing. I pushed both Aaron's and my commit. I don't yet fully understand what is going on with big endian. Cheers, Mark |
|
From: Mark W. <ma...@so...> - 2023-09-02 00:03:57
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=8228fe7f696b30c7b6b6daf576fc189bf8d6f8c2 commit 8228fe7f696b30c7b6b6daf576fc189bf8d6f8c2 Author: Mark Wielaard <ma...@kl...> Date: Fri Sep 1 19:10:17 2023 +0200 Explicitly load libc and any sonames that contain mandatory specs We really need symtab for glibc and ld.so libraries early for redir. Some distros move these into separate debuginfo files, which means we need to fully load them early. https://bugs.kde.org/show_bug.cgi?id=473745 Diff: --- NEWS | 1 + coregrind/m_debuginfo/debuginfo.c | 41 ++++++++++++++++++--------------------- coregrind/m_redir.c | 23 ++++++++++++++++------ coregrind/pub_core_debuginfo.h | 2 ++ coregrind/pub_core_redir.h | 2 +- 5 files changed, 40 insertions(+), 29 deletions(-) diff --git a/NEWS b/NEWS index 6f13d53569..832d24e45a 100644 --- a/NEWS +++ b/NEWS @@ -52,6 +52,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. 472963 Broken regular expression in configure.ac 473604 Fix bug472219.c compile failure with Clang 16 473677 make check compile failure with Clang 16 based on GCC 13.x +473745 must-be-redirected function - strlen 473870 FreeBSD 14 applications fail early at startup 473944 Handle mold linker split RW PT_LOAD segments correctly n-i-bz Allow arguments with spaces in .valgrindrc files diff --git a/coregrind/m_debuginfo/debuginfo.c b/coregrind/m_debuginfo/debuginfo.c index c37e50b9d3..0c4eb99c0d 100644 --- a/coregrind/m_debuginfo/debuginfo.c +++ b/coregrind/m_debuginfo/debuginfo.c @@ -1445,27 +1445,34 @@ ULong VG_(di_notify_mmap)( Addr a, Bool allow_SkFileV, Int use_fd ) } } +/* Load DI if it hasn't already been been loaded. */ +void VG_(di_load_di)( DebugInfo *di ) +{ + if (di->deferred) { + di->deferred = False; + ML_(read_elf_debug) (di); + ML_(canonicaliseTables)( di ); + + /* Check invariants listed in + Comment_on_IMPORTANT_REPRESENTATIONAL_INVARIANTS in + priv_storage.h. */ + check_CFSI_related_invariants(di); + ML_(finish_CFSI_arrays)(di); + } +} + /* Load DI if it has a text segment containing A and DI hasn't already been loaded. */ void VG_(load_di)( DebugInfo *di, Addr a) { - if (!di->deferred - || !di->text_present + if (!di->text_present || di->text_size <= 0 || di->text_avma > a || a >= di->text_avma + di->text_size) return; - di->deferred = False; - ML_(read_elf_debug) (di); - ML_(canonicaliseTables)( di ); - - /* Check invariants listed in - Comment_on_IMPORTANT_REPRESENTATIONAL_INVARIANTS in - priv_storage.h. */ - check_CFSI_related_invariants(di); - ML_(finish_CFSI_arrays)(di); + VG_(di_load_di)(di); } /* Attempt to load DebugInfo with a text segment containing A, @@ -1477,17 +1484,7 @@ void VG_(addr_load_di)( Addr a ) di = VG_(find_DebugInfo)(VG_(current_DiEpoch)(), a); if (di != NULL) - if (di->deferred) { - di->deferred = False; - ML_(read_elf_debug) (di); - ML_(canonicaliseTables)( di ); - - /* Check invariants listed in - Comment_on_IMPORTANT_REPRESENTATIONAL_INVARIANTS in - priv_storage.h. */ - check_CFSI_related_invariants(di); - ML_(finish_CFSI_arrays)(di); - } + VG_(di_load_di)(di); } /* Unmap is simpler - throw away any SegInfos intersecting diff --git a/coregrind/m_redir.c b/coregrind/m_redir.c index 37c67f4c13..cef241b4f8 100644 --- a/coregrind/m_redir.c +++ b/coregrind/m_redir.c @@ -255,7 +255,7 @@ typedef typedef struct _TopSpec { struct _TopSpec* next; /* linked list */ - const DebugInfo* seginfo; /* symbols etc */ + DebugInfo* seginfo; /* symbols etc */ Spec* specs; /* specs pulled out of seginfo */ Bool mark; /* transient temporary used during deletion */ } @@ -312,7 +312,7 @@ static void show_active ( const HChar* left, const Active* act ); static void handle_maybe_load_notifier( const HChar* soname, const HChar* symbol, Addr addr ); -static void handle_require_text_symbols ( const DebugInfo* ); +static void handle_require_text_symbols ( DebugInfo* ); /*------------------------------------------------------------*/ /*--- NOTIFICATIONS ---*/ @@ -324,7 +324,7 @@ void generate_and_add_actives ( Spec* specs, TopSpec* parent_spec, /* debuginfo and the owning TopSpec */ - const DebugInfo* di, + DebugInfo* di, TopSpec* parent_sym ); @@ -385,7 +385,7 @@ static HChar const* advance_to_comma ( HChar const* c ) { topspecs list, and (2) figure out what new binding are now active, and, as a result, add them to the actives mapping. */ -void VG_(redir_notify_new_DebugInfo)( const DebugInfo* newdi ) +void VG_(redir_notify_new_DebugInfo)( DebugInfo* newdi ) { Bool ok, isWrap, isGlobal; Int i, nsyms, becTag, becPrio; @@ -421,6 +421,12 @@ void VG_(redir_notify_new_DebugInfo)( const DebugInfo* newdi ) newdi_soname = VG_(DebugInfo_get_soname)(newdi); vg_assert(newdi_soname != NULL); + /* libc is special, because it contains some of the core redirects. + Make sure it is fully loaded. */ + if (0 == VG_(strcmp)(newdi_soname, libc_soname) || + 0 == VG_(strcmp)(newdi_soname, pthread_soname)) + VG_(di_load_di)(newdi); + #ifdef ENABLE_INNER { /* When an outer Valgrind is executing an inner Valgrind, the @@ -814,7 +820,7 @@ void generate_and_add_actives ( Spec* specs, TopSpec* parent_spec, /* seginfo and the owning TopSpec */ - const DebugInfo* di, + DebugInfo* di, TopSpec* parent_sym ) { @@ -846,6 +852,11 @@ void generate_and_add_actives ( sp->mark = VG_(string_match)( sp->from_sopatt, soname ); anyMark = anyMark || sp->mark; + + /* The symtab might be in a separate debuginfo file. Make sure the + debuginfo is fully loaded. */ + if (sp->mark && sp->mandatory) + VG_(di_load_di)(di); } /* shortcut: if none of the sonames match, there will be no bindings. */ @@ -1792,7 +1803,7 @@ void handle_maybe_load_notifier( const HChar* soname, symbols that satisfy any --require-text-symbol= specifications that apply to it, and abort the run with an error message if not. */ -static void handle_require_text_symbols ( const DebugInfo* di ) +static void handle_require_text_symbols ( DebugInfo* di ) { /* First thing to do is figure out which, if any, --require-text-symbol specification strings apply to this diff --git a/coregrind/pub_core_debuginfo.h b/coregrind/pub_core_debuginfo.h index 6e93bb93c5..4d6ebda816 100644 --- a/coregrind/pub_core_debuginfo.h +++ b/coregrind/pub_core_debuginfo.h @@ -78,6 +78,8 @@ extern void VG_(di_notify_vm_protect)( Addr a, SizeT len, UInt prot ); extern void VG_(addr_load_di)( Addr a ); +extern void VG_(di_load_di)( DebugInfo *di ); + extern void VG_(load_di)( DebugInfo *di, Addr a ); extern void VG_(di_discard_ALL_debuginfo)( void ); diff --git a/coregrind/pub_core_redir.h b/coregrind/pub_core_redir.h index b88ca98f92..0cf0b009ea 100644 --- a/coregrind/pub_core_redir.h +++ b/coregrind/pub_core_redir.h @@ -61,7 +61,7 @@ //-------------------------------------------------------------------- /* Notify the module of a new DebugInfo (called from m_debuginfo). */ -extern void VG_(redir_notify_new_DebugInfo)( const DebugInfo* ); +extern void VG_(redir_notify_new_DebugInfo)( DebugInfo* ); /* Notify the module of the disappearance of a DebugInfo (also called from m_debuginfo). */ |
|
From: Mark W. <ma...@so...> - 2023-09-02 00:03:46
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=a01d8e01fceb9e8e1c5fba67d9322fb2c45e9c83 commit a01d8e01fceb9e8e1c5fba67d9322fb2c45e9c83 Author: Aaron Merey <am...@re...> Date: Wed Aug 30 14:49:09 2023 -0400 Fix lazy debuginfo loading on ppc64le Lazy debuginfo loading introduced in commit 60f7e89ba32 assumed that either describe_IP or find_DiCfSI will be called before stacktrace printing. describe_IP and find_DiCfSI cause debuginfo to be lazily loaded before symtab lookup occurs during stacktraces. However this assumption does not hold true on ppc64le, resulting in debuginfo failing to load in time for stacktraces. Fix this by loading debuginfo during get_StackTrace_wrk on ppc arches. Diff: --- coregrind/m_stacktrace.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/coregrind/m_stacktrace.c b/coregrind/m_stacktrace.c index 308bebdd86..0ec6f5993a 100644 --- a/coregrind/m_stacktrace.c +++ b/coregrind/m_stacktrace.c @@ -772,6 +772,8 @@ UInt VG_(get_StackTrace_wrk) ( ThreadId tid_if_known, # endif Addr fp_min = sp - VG_STACK_REDZONE_SZB; + VG_(addr_load_di)(ip); + /* Snaffle IPs from the client's stack into ips[0 .. max_n_ips-1], stopping when the trail goes cold, which we guess to be when FP is not a reasonable stack location. */ @@ -913,6 +915,7 @@ UInt VG_(get_StackTrace_wrk) ( ThreadId tid_if_known, play safe, a la x86/amd64 above. See extensive comments above. */ RECURSIVE_MERGE(cmrf,ips,i); + VG_(addr_load_di)(ip); continue; } |