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
(3) |
2
(2) |
3
(5) |
4
|
|
5
(3) |
6
|
7
|
8
(1) |
9
(3) |
10
|
11
|
|
12
|
13
(2) |
14
|
15
|
16
(1) |
17
(1) |
18
|
|
19
(1) |
20
|
21
(3) |
22
|
23
(1) |
24
(1) |
25
(4) |
|
26
|
27
(1) |
28
(9) |
|
|
|
|
|
From: Paul F. <pa...@so...> - 2023-02-28 22:27:45
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=9fa27e001ec22eda595e56345be81af045e488f0 commit 9fa27e001ec22eda595e56345be81af045e488f0 Author: Paul Floyd <pj...@wa...> Date: Tue Feb 28 23:27:22 2023 +0100 Typo in comment Diff: --- coregrind/m_replacemalloc/vg_replace_malloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coregrind/m_replacemalloc/vg_replace_malloc.c b/coregrind/m_replacemalloc/vg_replace_malloc.c index 251b8ac9d3..494ef96371 100644 --- a/coregrind/m_replacemalloc/vg_replace_malloc.c +++ b/coregrind/m_replacemalloc/vg_replace_malloc.c @@ -1845,7 +1845,7 @@ extern int *___errno (void) __attribute__((weak)); } \ if (VG_POSIX_MEMALIGN_SIZE_0_RETURN_NULL && \ size == 0U) { \ - /* no allocation for zro size on Solaris/Illumos */ \ + /* no allocation for zero size on Solaris/Illumos */ \ *memptr = NULL; \ return 0; \ } \ |
|
From: Paul F. <pa...@so...> - 2023-02-28 21:58:53
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=40c196b0ca12c6fa27774776f8cc7e970c5afebc commit 40c196b0ca12c6fa27774776f8cc7e970c5afebc Author: Paul Floyd <pj...@wa...> Date: Tue Feb 28 22:58:14 2023 +0100 Fix Darwin compilation Removed memalign wrapper on Darwin, so valloc can't use it any more. Diff: --- coregrind/m_replacemalloc/vg_replace_malloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/coregrind/m_replacemalloc/vg_replace_malloc.c b/coregrind/m_replacemalloc/vg_replace_malloc.c index cc38d665bf..251b8ac9d3 100644 --- a/coregrind/m_replacemalloc/vg_replace_malloc.c +++ b/coregrind/m_replacemalloc/vg_replace_malloc.c @@ -1719,8 +1719,8 @@ extern int *___errno (void) __attribute__((weak)); if (pszB == 0) \ pszB = my_getpagesize(); \ TRIGGER_MEMCHECK_ERROR_IF_UNDEFINED((UWord) zone); \ - return VG_REPLACE_FUNCTION_EZU(10110,VG_Z_LIBC_SONAME,memalign) \ - ((SizeT)pszB, size); \ + return (void*)VALGRIND_NON_SIMD_CALL2( info.tl_memalign, \ + pszB, size ); \ } #if defined(VGO_linux) |
|
From: Paul F. <pa...@so...> - 2023-02-28 21:19:49
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=94a41e050c92a504515c66ebdaf84cad91c869bb commit 94a41e050c92a504515c66ebdaf84cad91c869bb Author: Paul Floyd <pj...@wa...> Date: Tue Feb 28 22:17:25 2023 +0100 Bug 445743 - "The impossible happened: mutex is locked simultaneously by two threads" while using mutexes with priority inheritance and signals Been using the same fix in FreeBSD for quite a while, so I think it's safe to apply to Linux and close the bugzi item. Diff: --- NEWS | 4 +++- coregrind/m_syswrap/syswrap-linux.c | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index c6ebdcb252..e31fc3c50d 100644 --- a/NEWS +++ b/NEWS @@ -87,6 +87,8 @@ are not entered into bugzilla tend to get forgotten about or ignored. 444110 priv/guest_ppc_toIR.c:36198:31: warning: duplicated 'if' condition. 444488 Use glibc.pthread.stack_cache_size tunable 444568 drd/tests/pth_barrier_thr_cr fails on Fedora 38 +445743 "The impossible happened: mutex is locked simultaneously by two threads" + while using mutexes with priority inheritance and signals 459476 vgdb: allow address reuse to avoid "address already in use" errorsuse" errors 460356 s390: Sqrt32Fx4 -- cannot reduce tree 462830 WARNING: unhandled amd64-freebsd syscall: 474 @@ -95,7 +97,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. 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. -n-i-bz FreeBSD rfork syscall fail with EINVAL or EINVAL rather than VG_(unimplemented) +n-i-bz FreeBSD rfork syscall fail with EINVAL or ENOSYS rather than VG_(unimplemented) To see details of a given bug, visit https://bugs.kde.org/show_bug.cgi?id=XXXXXX diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c index bb87c90bab..4a5a93b35a 100644 --- a/coregrind/m_syswrap/syswrap-linux.c +++ b/coregrind/m_syswrap/syswrap-linux.c @@ -1743,6 +1743,9 @@ static void futex_pre_helper ( ThreadId tid, SyscallArgLayout* layout, } *flags |= SfMayBlock; + if ((ARG2 & (VKI_FUTEX_PRIVATE_FLAG|VKI_FUTEX_LOCK_PI)) == (VKI_FUTEX_PRIVATE_FLAG|VKI_FUTEX_LOCK_PI)) { + *flags |= SfKernelRestart; + } switch(ARG2 & ~(VKI_FUTEX_PRIVATE_FLAG|VKI_FUTEX_CLOCK_REALTIME)) { case VKI_FUTEX_WAIT: |
|
From: Paul F. <pa...@so...> - 2023-02-28 20:54:21
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=189ea2bf9efe066b72b2a1b885b4631b4f29c4b8 commit 189ea2bf9efe066b72b2a1b885b4631b4f29c4b8 Author: Paul Floyd <pj...@wa...> Date: Tue Feb 28 21:52:54 2023 +0100 Remove unused helgrind expected I don't think that this can match any more. Diff: --- helgrind/tests/Makefile.am | 3 +- helgrind/tests/pth_destroy_cond.stderr.exp2 | 44 ----------------------------- 2 files changed, 1 insertion(+), 46 deletions(-) diff --git a/helgrind/tests/Makefile.am b/helgrind/tests/Makefile.am index 65f18f1435..5338ea4d6d 100755 --- a/helgrind/tests/Makefile.am +++ b/helgrind/tests/Makefile.am @@ -59,8 +59,7 @@ EXTRA_DIST = \ pth_barrier2.vgtest pth_barrier2.stdout.exp pth_barrier2.stderr.exp \ pth_barrier3.vgtest pth_barrier3.stdout.exp pth_barrier3.stderr.exp \ pth_destroy_cond.vgtest \ - pth_destroy_cond.stdout.exp \ - pth_destroy_cond.stderr.exp pth_destroy_cond.stderr.exp2 \ + pth_destroy_cond.stdout.exp pth_destroy_cond.stderr.exp \ pth_cond_destroy_busy.vgtest pth_cond_destroy_busy.stderr.exp \ pth_cond_destroy_busy.stderr.exp-ppc64 \ pth_cond_destroy_busy.stderr.exp-solaris \ diff --git a/helgrind/tests/pth_destroy_cond.stderr.exp2 b/helgrind/tests/pth_destroy_cond.stderr.exp2 deleted file mode 100644 index 593b4ef35b..0000000000 --- a/helgrind/tests/pth_destroy_cond.stderr.exp2 +++ /dev/null @@ -1,44 +0,0 @@ ----Thread-Announcement------------------------------------------ - -Thread #x was created - ... - by 0x........: pthread_create@* (hg_intercepts.c:...) - by 0x........: main (pth_destroy_cond.c:29) - ----Thread-Announcement------------------------------------------ - -Thread #x is the program's root thread - ----------------------------------------------------------------- - - Lock at 0x........ was first observed - at 0x........: pthread_mutex_init (hg_intercepts.c:...) - by 0x........: main (pth_destroy_cond.c:25) - Address 0x........ is 0 bytes inside data symbol "mutex" - -Possible data race during read of size 1 at 0x........ by thread #x -Locks held: 1, at address 0x........ - at 0x........: my_memcmp (hg_intercepts.c:...) - by 0x........: pthread_cond_destroy_WRK (hg_intercepts.c:...) - by 0x........: pthread_cond_destroy@* (hg_intercepts.c:...) - by 0x........: ThreadFunction (pth_destroy_cond.c:18) - by 0x........: mythread_wrapper (hg_intercepts.c:...) - ... - -This conflicts with a previous write of size 4 by thread #x -Locks held: none - ... - by 0x........: pthread_cond_wait_WRK (hg_intercepts.c:...) - by 0x........: pthread_cond_wait@* (hg_intercepts.c:...) - by 0x........: main (pth_destroy_cond.c:31) - Address 0x........ is 4 bytes inside data symbol "cond" - ----------------------------------------------------------------- - -Thread #x: pthread_cond_destroy: destruction of condition variable being waited upon - at 0x........: pthread_cond_destroy_WRK (hg_intercepts.c:...) - by 0x........: pthread_cond_destroy@* (hg_intercepts.c:...) - by 0x........: ThreadFunction (pth_destroy_cond.c:18) - by 0x........: mythread_wrapper (hg_intercepts.c:...) - ... - |
|
From: Paul F. <pa...@so...> - 2023-02-28 20:24:30
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=33ce1bf1cb01b49a441e43a11f5c2de21712e60b commit 33ce1bf1cb01b49a441e43a11f5c2de21712e60b Author: Paul Floyd <pj...@wa...> Date: Tue Feb 28 21:21:05 2023 +0100 Change behaviour of posix_memalign for Solaris It returns NULL and 0 status whilst most other platforms allocatae some undefined amount of memory (which is allowed by posix). Update the posix_memalign test as well. Finally remove some clang warnings about alignment. Diff: --- coregrind/m_replacemalloc/vg_replace_malloc.c | 16 +++++++++++++++- memcheck/tests/freebsd/Makefile.am | 2 ++ memcheck/tests/posix_memalign.c | 18 +++++++++++++----- 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/coregrind/m_replacemalloc/vg_replace_malloc.c b/coregrind/m_replacemalloc/vg_replace_malloc.c index 5ded69e969..cc38d665bf 100644 --- a/coregrind/m_replacemalloc/vg_replace_malloc.c +++ b/coregrind/m_replacemalloc/vg_replace_malloc.c @@ -1817,6 +1817,12 @@ extern int *___errno (void) __attribute__((weak)); /*---------------------- posix_memalign ----------------------*/ +#if defined(VGO_solaris) +#define VG_POSIX_MEMALIGN_SIZE_0_RETURN_NULL 1 +#else +#define VG_POSIX_MEMALIGN_SIZE_0_RETURN_NULL 0 +#endif + #define POSIX_MEMALIGN(soname, fnname) \ \ int VG_REPLACE_FUNCTION_EZU(10160,soname,fnname) \ @@ -1837,6 +1843,12 @@ extern int *___errno (void) __attribute__((weak)); || (alignment & (alignment - 1)) != 0) { \ return VKI_EINVAL; \ } \ + if (VG_POSIX_MEMALIGN_SIZE_0_RETURN_NULL && \ + size == 0U) { \ + /* no allocation for zro size on Solaris/Illumos */ \ + *memptr = NULL; \ + return 0; \ + } \ /* Round up to minimum alignment if necessary. */ \ if (alignment < VG_MIN_MALLOC_SZB) \ alignment = VG_MIN_MALLOC_SZB; \ @@ -1861,7 +1873,9 @@ extern int *___errno (void) __attribute__((weak)); POSIX_MEMALIGN(SO_SYN_MALLOC, posix_memalign); #elif defined(VGO_darwin) - //POSIX_MEMALIGN(VG_Z_LIBC_SONAME, posix_memalign); +#if (DARWIN_VERSIO >= DARWIN_10_6) + POSIX_MEMALIGN(VG_Z_LIBC_SONAME, posix_memalign); +#endif #elif defined(VGO_solaris) POSIX_MEMALIGN(VG_Z_LIBC_SONAME, posix_memalign); diff --git a/memcheck/tests/freebsd/Makefile.am b/memcheck/tests/freebsd/Makefile.am index 631d0efe9e..2259e1efb8 100644 --- a/memcheck/tests/freebsd/Makefile.am +++ b/memcheck/tests/freebsd/Makefile.am @@ -134,3 +134,5 @@ scalar_CFLAGS = ${AM_CFLAGS} -g errno_aligned_allocs_CFLAGS = ${AM_CFLAGS} @FLAG_W_NO_NON_POWER_OF_TWO_ALIGNMENT@ extattr_CFLAGS = ${AM_CFLAGS} @FLAG_W_NO_UNUSED_BUT_SET_VARIABLE@ + +memalign_CFLAGS = ${AM_CFLAGS} @FLAG_W_NO_NON_POWER_OF_TWO_ALIGNMENT@ diff --git a/memcheck/tests/posix_memalign.c b/memcheck/tests/posix_memalign.c index 415c6c025b..219df2ffd8 100644 --- a/memcheck/tests/posix_memalign.c +++ b/memcheck/tests/posix_memalign.c @@ -28,25 +28,33 @@ int main ( void ) # define PM(a,b,c) posix_memalign((void**)a, b, c) + // test for size 0 + res = PM(&p, 64, 0); +#if defined(VGO_solaris) + assert(NULL == p); +#else + assert(0 == res && p && 0 == (long)p % 64); +#endif + res = PM(&p, -1,100); assert(EINVAL == res); res = PM(&p, 0, 100); assert(EINVAL == res); res = PM(&p, 1, 100); assert(EINVAL == res); res = PM(&p, 2, 100); assert(EINVAL == res); res = PM(&p, 3, 100); assert(EINVAL == res); res = PM(&p, sizeof(void*), 100); - assert(0 == res && 0 == (long)p % sizeof(void*)); + assert(0 == res && p && 0 == (long)p % sizeof(void*)); res = PM(&p, 31, 100); assert(EINVAL == res); - res = PM(&p, 32, 100); assert(0 == res && 0 == (long)p % 32); + res = PM(&p, 32, 100); assert(0 == res && p && 0 == (long)p % 32); res = PM(&p, 33, 100); assert(EINVAL == res); res = PM(&p, 4095, 100); assert(EINVAL == res); - res = PM(&p, 4096, 100); assert(0 == res && 0 == (long)p % 4096); + res = PM(&p, 4096, 100); assert(0 == res && p && 0 == (long)p % 4096); res = PM(&p, 4097, 100); assert(EINVAL == res); - res = PM(&p, 4 * 1024 * 1024, 100); assert(0 == res + res = PM(&p, 4 * 1024 * 1024, 100); assert(0 == res && p && 0 == (long)p % (4 * 1024 * 1024)); - res = PM(&p, 16 * 1024 * 1024, 100); assert(0 == res + res = PM(&p, 16 * 1024 * 1024, 100); assert(0 == res &&p && 0 == (long)p % (16 * 1024 * 1024)); #endif } |
|
From: Paul F. <pa...@so...> - 2023-02-28 19:46:54
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=19dc72931b2168c70239c5922fb2bf2fca90e4bf commit 19dc72931b2168c70239c5922fb2bf2fca90e4bf Author: Paul Floyd <pj...@wa...> Date: Tue Feb 28 19:56:52 2023 +0100 Put back Darwin zone memalign I had another look at the XNU source and this does seem to exist. The manpage says that it is the zone version of posix_memalign, though that's probably more because Darwin has no memalign. Diff: --- coregrind/m_replacemalloc/vg_replace_malloc.c | 32 +++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/coregrind/m_replacemalloc/vg_replace_malloc.c b/coregrind/m_replacemalloc/vg_replace_malloc.c index 0b591a7c83..5ded69e969 100644 --- a/coregrind/m_replacemalloc/vg_replace_malloc.c +++ b/coregrind/m_replacemalloc/vg_replace_malloc.c @@ -1506,6 +1506,34 @@ extern int *___errno (void) __attribute__((weak)); * */ +#define ZONEMEMALIGN(soname, fnname) \ + \ + void* VG_REPLACE_FUNCTION_EZU(10100,soname,fnname) \ + ( void *zone, SizeT alignment, SizeT n ); \ + void* VG_REPLACE_FUNCTION_EZU(10100,soname,fnname) \ + ( void *zone, SizeT alignment, SizeT n ) \ + { \ + void* v; \ + \ + DO_INIT; \ + TRIGGER_MEMCHECK_ERROR_IF_UNDEFINED((UWord) zone); \ + TRIGGER_MEMCHECK_ERROR_IF_UNDEFINED(n); \ + MALLOC_TRACE("zone_memalign(%p, al %llu, size %llu)", \ + zone, (ULong)alignment, (ULong)n ); \ + \ + /* Round up to minimum alignment if necessary. */ \ + if (alignment < VG_MIN_MALLOC_SZB) \ + alignment = VG_MIN_MALLOC_SZB; \ + \ + /* Round up to nearest power-of-two if necessary (like glibc). */ \ + while (0 != (alignment & (alignment - 1))) alignment++; \ + \ + v = (void*)VALGRIND_NON_SIMD_CALL2( info.tl_memalign, alignment, n ); \ + MALLOC_TRACE(" = %p\n", v ); \ + if (!v) SET_ERRNO_ENOMEM; \ + return v; \ + } + #if defined(VGO_linux) #if !defined(MUSL_LIBC) #define MEMALIGN(soname, fnname) \ @@ -1647,6 +1675,10 @@ extern int *___errno (void) __attribute__((weak)); MEMALIGN(VG_Z_LIBC_SONAME, memalign); MEMALIGN(SO_SYN_MALLOC, memalign); +#elif defined(VGO_darwin) + ZONEMEMALIGN(VG_Z_LIBC_SONAME, malloc_zone_memalign); + ZONEMEMALIGN(SO_SYN_MALLOC, malloc_zone_memalign); + #elif defined(VGO_solaris) MEMALIGN(VG_Z_LIBC_SONAME, memalign); MEMALIGN(VG_Z_LIBUMEM_SO_1, memalign); |
|
From: Paul F. <pa...@so...> - 2023-02-28 12:46:49
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=e862c6f3d2374beebf78b52dfc8303ff33707001 commit e862c6f3d2374beebf78b52dfc8303ff33707001 Author: Paul Floyd <pj...@wa...> Date: Tue Feb 28 13:17:24 2023 +0100 Make memalign behave more like the underlying platform memalign This is the first part of Bug 466104 aligned_alloc problems, part 1 The bulk of this change is try try to get memalign to be more platform aware. Previously the Valgrind implementation only reflected the glibc implementation. That meant non-power of two alignment values would silently get bumped up to the next largest power of two. Most other platforms return NULL and set errno to EINVAL. There are a few other changes. A couple of the other aligned alloc functions like valloc were caling the Valgrind memalign. This meant that there weould be an extra Valgrind memalign in any error callstacks. Now these functions call the allocator directly. The memcheck memalign2 testcase has been redone. The memalign parts moved out to per-platform versions and the tescase itdelf renamed to posix_memalign, since that is all that is left. I also modified the testcase so that it checks that the memalign calls check for non-NULL returns, and on platforms that set errno that it is correctly set. Previously the test only worked on non-glibc because NULL & alignment is zero. The platform versions have been tested on glibc, MUSL, FreeBSD and OpenIndiana and should hopefully run OK both under memcheck and standalone. There is stil quite a lot that is NOT done 1. I'm not certain that implementations allocate more memory and/or use a wider alignment. It doesn't help that almost universally the memalign implementations are badly documented, undocumented or buggy. 2. We don't handle very large alignment requests well. Most implementations will fail and set EINVAL if the alignment is over half the memory space. Valgrind will core panic if an aligmnt of over 16Mbytes is requested. 3. We don't generate any memcheck errors for invalid values of alignment. That's planned in Part 2. 4. The code is static and fixed at compile time. That means that if you are using MUSL with a glibc-built Valgrind you will still get glibc memalign behaviour. I'll wait to see if there are any requests before trying to make the behaviour selectable at runtime. Diff: --- .gitignore | 62 +++--- coregrind/m_mallocfree.c | 22 ++- coregrind/m_replacemalloc/vg_replace_malloc.c | 211 +++++++++++++++++---- memcheck/tests/Makefile.am | 8 +- .../tests/amd64/sh-mem-vec256-plo-no.stderr.exp | 159 ++++++---------- .../tests/amd64/sh-mem-vec256-plo-yes.stderr.exp | 108 ++++------- .../sh-mem-vec128-plo-no.stderr.exp-32bit-le | 108 ++++------- .../sh-mem-vec128-plo-no.stderr.exp-64bit-le | 108 ++++------- .../sh-mem-vec128-plo-yes.stderr.exp-32bit-le | 60 ++---- .../sh-mem-vec128-plo-yes.stderr.exp-64bit-le | 60 ++---- memcheck/tests/freebsd/Makefile.am | 5 +- memcheck/tests/freebsd/errno_aligned_allocs.c | 21 +- memcheck/tests/freebsd/memalign.c | 82 ++++++++ .../memalign.stderr.exp} | 0 .../{memalign2.vgtest => freebsd/memalign.vgtest} | 2 +- memcheck/tests/linux/Makefile.am | 6 +- memcheck/tests/linux/memalign.c | 150 +++++++++++++++ memcheck/tests/linux/memalign.stderr.exp | 0 memcheck/tests/linux/memalign.vgtest | 2 + memcheck/tests/memalign2.c | 110 ----------- memcheck/tests/memalign_args.c | 29 +++ memcheck/tests/memalign_args.stderr.exp | 32 ++++ memcheck/tests/memalign_args.stderr.exp-glibc | 32 ++++ memcheck/tests/memalign_args.vgtest | 3 + memcheck/tests/memalign_test.stderr.exp | 3 +- .../tests/memalign_test.stderr.exp-freebsd-clang | 2 +- memcheck/tests/posix_memalign.c | 52 +++++ memcheck/tests/posix_memalign.stderr.exp | 0 memcheck/tests/posix_memalign.vgtest | 2 + memcheck/tests/solaris/Makefile.am | 6 +- memcheck/tests/solaris/memalign.c | 94 +++++++++ memcheck/tests/solaris/memalign.stderr.exp | 0 memcheck/tests/solaris/memalign.vgtest | 2 + memcheck/tests/test-plo-no.stderr.exp-le64-freebsd | 6 +- 34 files changed, 944 insertions(+), 603 deletions(-) diff --git a/.gitignore b/.gitignore index cc6b189b4b..7cd35cc9e3 100644 --- a/.gitignore +++ b/.gitignore @@ -914,7 +914,7 @@ /memcheck/tests/manuel2 /memcheck/tests/manuel3 /memcheck/tests/match-overrun -/memcheck/tests/memalign2 +/memcheck/tests/memalign_args /memcheck/tests/memalign_test /memcheck/tests/memcmptest /memcheck/tests/memmem @@ -944,6 +944,7 @@ /memcheck/tests/pdb-realloc2 /memcheck/tests/pipe /memcheck/tests/pointer-trace +/memcheck/tests/posix_memalign /memcheck/tests/post-syscall /memcheck/tests/reach_thread_register /memcheck/tests/realloc1 @@ -1109,6 +1110,7 @@ /memcheck/tests/linux/lsframe2 /memcheck/tests/linux/Makefile /memcheck/tests/linux/Makefile.in +/memcheck/tests/linux/memalign /memcheck/tests/linux/memfd_create /memcheck/tests/linux/rfcomm /memcheck/tests/linux/sigqueue @@ -1205,6 +1207,7 @@ /memcheck/tests/solaris/ldynsym /memcheck/tests/solaris/lsframe1 /memcheck/tests/solaris/lsframe2 +/memcheck/tests/solaris/memalign /memcheck/tests/solaris/mmapobj_bssonly /memcheck/tests/solaris/mmapobj_bssonly.so /memcheck/tests/solaris/name_service_door @@ -1321,45 +1324,46 @@ /memcheck/tests/freebsd/.deps /memcheck/tests/freebsd/Makefile /memcheck/tests/freebsd/Makefile.in -/memcheck/tests/freebsd/statfs -/memcheck/tests/freebsd/pdfork_pdkill +/memcheck/tests/freebsd/452275 +/memcheck/tests/freebsd/access +/memcheck/tests/freebsd/bug464476 +/memcheck/tests/freebsd/capsicum +/memcheck/tests/freebsd/chflags +/memcheck/tests/freebsd/chmod_chown +/memcheck/tests/freebsd/errno_aligned_allocs +/memcheck/tests/freebsd/eventfd1 +/memcheck/tests/freebsd/eventfd2 +/memcheck/tests/freebsd/extattr +/memcheck/tests/freebsd/fexecve +/memcheck/tests/freebsd/file_locking_wait6 +/memcheck/tests/freebsd/get_set_context +/memcheck/tests/freebsd/get_set_login +/memcheck/tests/freebsd/getfh /memcheck/tests/freebsd/getfsstat /memcheck/tests/freebsd/inlinfo /memcheck/tests/freebsd/inlinfo_nested.so -/memcheck/tests/freebsd/extattr -/memcheck/tests/freebsd/sigwait -/memcheck/tests/freebsd/chflags -/memcheck/tests/freebsd/get_set_login +/memcheck/tests/freebsd/linkat +/memcheck/tests/freebsd/memalign +/memcheck/tests/freebsd/misc +/memcheck/tests/freebsd/pdfork_pdkill +/memcheck/tests/freebsd/realpathat /memcheck/tests/freebsd/revoke /memcheck/tests/freebsd/scalar -/memcheck/tests/freebsd/capsicum -/memcheck/tests/freebsd/getfh -/memcheck/tests/freebsd/linkat -/memcheck/tests/freebsd/scalar_fork -/memcheck/tests/freebsd/scalar_thr_exit +/memcheck/tests/freebsd/scalar_13_plus /memcheck/tests/freebsd/scalar_abort2 +/memcheck/tests/freebsd/scalar_fork /memcheck/tests/freebsd/scalar_pdfork +/memcheck/tests/freebsd/scalar_thr_exit /memcheck/tests/freebsd/scalar_vfork +/memcheck/tests/freebsd/sctp +/memcheck/tests/freebsd/sctp2 +/memcheck/tests/freebsd/setproctitle +/memcheck/tests/freebsd/sigwait /memcheck/tests/freebsd/stat -/memcheck/tests/freebsd/file_locking_wait6 +/memcheck/tests/freebsd/statfs +/memcheck/tests/freebsd/static_allocs /memcheck/tests/freebsd/utimens -/memcheck/tests/freebsd/access -/memcheck/tests/freebsd/chmod_chown -/memcheck/tests/freebsd/misc -/memcheck/tests/freebsd/get_set_context /memcheck/tests/freebsd/utimes -/memcheck/tests/freebsd/static_allocs -/memcheck/tests/freebsd/fexecve -/memcheck/tests/freebsd/eventfd1 -/memcheck/tests/freebsd/eventfd2 -/memcheck/tests/freebsd/realpathat -/memcheck/tests/freebsd/scalar_13_plus -/memcheck/tests/freebsd/452275 -/memcheck/tests/freebsd/errno_aligned_allocs -/memcheck/tests/freebsd/setproctitle -/memcheck/tests/freebsd/sctp -/memcheck/tests/freebsd/sctp2 -/memcheck/tests/freebsd/bug464476 # /memcheck/tests/amd64-freebsd /memcheck/tests/amd64-freebsd/*.stderr.diff diff --git a/coregrind/m_mallocfree.c b/coregrind/m_mallocfree.c index 90c7d9aac9..a51c9aa730 100644 --- a/coregrind/m_mallocfree.c +++ b/coregrind/m_mallocfree.c @@ -2239,12 +2239,26 @@ void* VG_(arena_memalign) ( ArenaId aid, const HChar* cc, // Check that the requested alignment has a plausible size. // Check that the requested alignment seems reasonable; that is, is // a power of 2. - if (req_alignB < VG_MIN_MALLOC_SZB - || req_alignB > 16 * 1024 * 1024 - || VG_(log2)( req_alignB ) == -1 /* not a power of 2 */) { + if (req_alignB < VG_MIN_MALLOC_SZB) { VG_(printf)("VG_(arena_memalign)(%p, %lu, %lu)\n" "bad alignment value %lu\n" - "(it is too small, too big, or not a power of two)", + "(it is too small, below the lower limit of %d)", + a, req_alignB, req_pszB, req_alignB, VG_MIN_MALLOC_SZB ); + VG_(core_panic)("VG_(arena_memalign)"); + /*NOTREACHED*/ + } + if (req_alignB > 16 * 1024 * 1024) { + VG_(printf)("VG_(arena_memalign)(%p, %lu, %lu)\n" + "bad alignment value %lu\n" + "(it is too big, larger than the upper limit of %d)", + a, req_alignB, req_pszB, req_alignB, 16 * 1024 * 1024 ); + VG_(core_panic)("VG_(arena_memalign)"); + /*NOTREACHED*/ + } + if (VG_(log2)( req_alignB ) == -1 /* not a power of 2 */) { + VG_(printf)("VG_(arena_memalign)(%p, %lu, %lu)\n" + "bad alignment value %lu\n" + "(it is not a power of two)", a, req_alignB, req_pszB, req_alignB ); VG_(core_panic)("VG_(arena_memalign)"); /*NOTREACHED*/ diff --git a/coregrind/m_replacemalloc/vg_replace_malloc.c b/coregrind/m_replacemalloc/vg_replace_malloc.c index eb087676ca..0b591a7c83 100644 --- a/coregrind/m_replacemalloc/vg_replace_malloc.c +++ b/coregrind/m_replacemalloc/vg_replace_malloc.c @@ -68,6 +68,8 @@ #include "pub_core_redir.h" // for VG_REPLACE_FUNCTION_* #include "pub_core_replacemalloc.h" +#define VG_ALIGN_ROUNDUP(size, alignment) ((size + alignment - 1) & ~(alignment - 1)) + /* Assignment of behavioural equivalence class tags: 1NNNP is intended to be reserved for the Valgrind core. Current usage: @@ -193,6 +195,10 @@ static void init(void); if (info.clo_trace_malloc) { \ VALGRIND_INTERNAL_PRINTF(format, ## args ); } +// @todo PJF this mechanism doesn't work for MUSL C +// not sure why +// source here https://elixir.bootlin.com/musl/latest/source/src/errno/__errno_location.c#L4 + /* Tries to set ERRNO to ENOMEM/EINVAL if possible. */ #if defined(VGO_linux) extern int *__errno_location (void) __attribute__((weak)); @@ -1472,20 +1478,49 @@ extern int *___errno (void) __attribute__((weak)); /*---------------------- memalign ----------------------*/ -#define ZONEMEMALIGN(soname, fnname) \ + /* + * memalign is rather old and deprecated + * Linux glibc will fixup the alignment + * (unless it is greater than SIZE_MAX / 2 + 1 + * in which case it returns EINVAL) + * + * musl libc just calls aligned_alloc + * + * FreeBSD, undocumented, just calls aligned_alloc + * with size rounded up to a multiple + * of aligment + * + * jemalloc mininum alignment is 1, must be a power of 2 + * it looks like excessively large alignment causes ENOMEM + * + * Illumos does not allow an alignment of zero + * Nor a size of zero + * And the alignment must be a multiple of 4 + * (though the man page says that the alignment + * must be a power of 2 at least the size of a word) + * + * Does not exist on Darwin + * + * tcmalloc seems to behave like glibc and we have + * no way to switch at runtime + * + */ + +#if defined(VGO_linux) +#if !defined(MUSL_LIBC) +#define MEMALIGN(soname, fnname) \ \ - void* VG_REPLACE_FUNCTION_EZU(10100,soname,fnname) \ - ( void *zone, SizeT alignment, SizeT n ); \ - void* VG_REPLACE_FUNCTION_EZU(10100,soname,fnname) \ - ( void *zone, SizeT alignment, SizeT n ) \ + void* VG_REPLACE_FUNCTION_EZU(10110,soname,fnname) \ + ( SizeT alignment, SizeT n ); \ + void* VG_REPLACE_FUNCTION_EZU(10110,soname,fnname) \ + ( SizeT alignment, SizeT n ) \ { \ void* v; \ \ DO_INIT; \ - TRIGGER_MEMCHECK_ERROR_IF_UNDEFINED((UWord) zone); \ TRIGGER_MEMCHECK_ERROR_IF_UNDEFINED(n); \ - MALLOC_TRACE("zone_memalign(%p, al %llu, size %llu)", \ - zone, (ULong)alignment, (ULong)n ); \ + MALLOC_TRACE("memalign(al %llu, size %llu)", \ + (ULong)alignment, (ULong)n ); \ \ /* Round up to minimum alignment if necessary. */ \ if (alignment < VG_MIN_MALLOC_SZB) \ @@ -1499,34 +1534,111 @@ extern int *___errno (void) __attribute__((weak)); if (!v) SET_ERRNO_ENOMEM; \ return v; \ } - +#else /* MUSL_LIBC */ #define MEMALIGN(soname, fnname) \ \ void* VG_REPLACE_FUNCTION_EZU(10110,soname,fnname) \ - ( SizeT alignment, SizeT n ); \ + ( SizeT alignment, SizeT size ); \ void* VG_REPLACE_FUNCTION_EZU(10110,soname,fnname) \ - ( SizeT alignment, SizeT n ) \ + ( SizeT alignment, SizeT size ) \ { \ - void* v; \ + void *mem; \ \ DO_INIT; \ - TRIGGER_MEMCHECK_ERROR_IF_UNDEFINED(n); \ - MALLOC_TRACE("memalign(al %llu, size %llu)", \ - (ULong)alignment, (ULong)n ); \ + if ((alignment & (alignment - 1)) != 0) { \ + SET_ERRNO_EINVAL; \ + return 0; \ + } \ + /* Round up to minimum alignment if necessary. */ \ + if (alignment < VG_MIN_MALLOC_SZB) \ + alignment = VG_MIN_MALLOC_SZB; \ + \ + mem = (void*)VALGRIND_NON_SIMD_CALL2( info.tl_memalign, alignment, size ); \ \ + if (!mem) SET_ERRNO_ENOMEM; \ + \ + return mem; \ + } +#endif + +#elif defined(VGO_freebsd) + +#define MEMALIGN(soname, fnname) \ + \ + void* VG_REPLACE_FUNCTION_EZU(10110,soname,fnname) \ + ( SizeT alignment, SizeT size ); \ + void* VG_REPLACE_FUNCTION_EZU(10110,soname,fnname) \ + ( SizeT alignment, SizeT size ) \ + { \ + void *mem; \ + \ + DO_INIT; \ + TRIGGER_MEMCHECK_ERROR_IF_UNDEFINED(size); \ + MALLOC_TRACE("memalign(al %llu, size %llu)\n", \ + (ULong)alignment, (ULong)size ); \ + if ((alignment & (alignment - 1)) != 0) { \ + SET_ERRNO_EINVAL; \ + return 0; \ + } \ /* Round up to minimum alignment if necessary. */ \ - if (alignment < VG_MIN_MALLOC_SZB) \ - alignment = VG_MIN_MALLOC_SZB; \ + if (alignment < VG_MIN_MALLOC_SZB) \ + alignment = VG_MIN_MALLOC_SZB; \ \ - /* Round up to nearest power-of-two if necessary (like glibc). */ \ - while (0 != (alignment & (alignment - 1))) alignment++; \ + mem = (void*)VALGRIND_NON_SIMD_CALL2( info.tl_memalign, \ + alignment, VG_ALIGN_ROUNDUP(size, alignment) ); \ \ - v = (void*)VALGRIND_NON_SIMD_CALL2( info.tl_memalign, alignment, n ); \ - MALLOC_TRACE(" = %p\n", v ); \ - if (!v) SET_ERRNO_ENOMEM; \ - return v; \ + if (!mem) SET_ERRNO_ENOMEM; \ + \ + return mem; \ } +#elif defined(VGO_solaris) + +// In the Illumos source there is a macro MINSIZE +// which is sizeof (TREE) - sizeof (WORD) +// struct TREE contains 6 WORDS +// so MINSIZE is 5 words +// +// In gdb I get the impression that sizeof (WORD) is 16 +#define VG_MEMALIGN_MINSIZE (5*VG_WORDSIZE) + +#define MEMALIGN(soname, fnname) \ + \ + void* VG_REPLACE_FUNCTION_EZU(10110,soname,fnname) \ + ( SizeT alignment, SizeT size ); \ + void* VG_REPLACE_FUNCTION_EZU(10110,soname,fnname) \ + ( SizeT alignment, SizeT size ) \ + { \ + void *mem; \ + \ + DO_INIT; \ + MALLOC_TRACE("memalign(al %llu, size %llu)\n", \ + (ULong)alignment, (ULong)size ); \ + if (alignment == 0 \ + || (size == 0) \ + || (alignment & 3)) { \ + SET_ERRNO_EINVAL; \ + return 0; \ + } \ + size = VG_ALIGN_ROUNDUP(size, VG_WORDSIZE); \ + if (size < VG_MEMALIGN_MINSIZE) \ + size = VG_MEMALIGN_MINSIZE; \ + alignment = VG_ALIGN_ROUNDUP(alignment, VG_WORDSIZE); \ + while (alignment < VG_MEMALIGN_MINSIZE + VG_WORDSIZE) \ + alignment <<= 1U; \ + \ + mem = (void*)VALGRIND_NON_SIMD_CALL2( info.tl_memalign, \ + alignment, VG_ALIGN_ROUNDUP(size, alignment) ); \ + \ + if (!mem) SET_ERRNO_ENOMEM; \ + \ + return mem; \ + } + +// no Darwin + +#endif + #if defined(VGO_linux) MEMALIGN(VG_Z_LIBC_SONAME, memalign); MEMALIGN(SO_SYN_MALLOC, memalign); @@ -1535,12 +1647,6 @@ extern int *___errno (void) __attribute__((weak)); MEMALIGN(VG_Z_LIBC_SONAME, memalign); MEMALIGN(SO_SYN_MALLOC, memalign); -#elif defined(VGO_darwin) - MEMALIGN(VG_Z_LIBC_SONAME, memalign); - MEMALIGN(SO_SYN_MALLOC, memalign); - ZONEMEMALIGN(VG_Z_LIBC_SONAME, malloc_zone_memalign); - ZONEMEMALIGN(SO_SYN_MALLOC, malloc_zone_memalign); - #elif defined(VGO_solaris) MEMALIGN(VG_Z_LIBC_SONAME, memalign); MEMALIGN(VG_Z_LIBUMEM_SO_1, memalign); @@ -1556,11 +1662,18 @@ extern int *___errno (void) __attribute__((weak)); void* VG_REPLACE_FUNCTION_EZU(10120,soname,fnname) ( SizeT size ); \ void* VG_REPLACE_FUNCTION_EZU(10120,soname,fnname) ( SizeT size ) \ { \ + void *mem; \ static int pszB = 0; \ if (pszB == 0) \ pszB = my_getpagesize(); \ - return VG_REPLACE_FUNCTION_EZU(10110,VG_Z_LIBC_SONAME,memalign) \ - ((SizeT)pszB, size); \ + DO_INIT; \ + TRIGGER_MEMCHECK_ERROR_IF_UNDEFINED(size); \ + mem = (void*)VALGRIND_NON_SIMD_CALL2( info.tl_memalign, \ + pszB, size ); \ + \ + if (!mem) SET_ERRNO_ENOMEM; \ + \ + return mem; \ } #define ZONEVALLOC(soname, fnname) \ @@ -1681,15 +1794,23 @@ extern int *___errno (void) __attribute__((weak)); { \ void *mem; \ \ + DO_INIT; \ + TRIGGER_MEMCHECK_ERROR_IF_UNDEFINED(size); \ + MALLOC_TRACE("posix_memalign(al %llu, size %llu)\n", \ + (ULong)alignment, (ULong)size ); \ /* Test whether the alignment argument is valid. It must be \ a power of two multiple of sizeof (void *). */ \ if (alignment == 0 \ || alignment % sizeof (void *) != 0 \ - || (alignment & (alignment - 1)) != 0) \ + || (alignment & (alignment - 1)) != 0) { \ return VKI_EINVAL; \ + } \ + /* Round up to minimum alignment if necessary. */ \ + if (alignment < VG_MIN_MALLOC_SZB) \ + alignment = VG_MIN_MALLOC_SZB; \ \ - mem = VG_REPLACE_FUNCTION_EZU(10110,VG_Z_LIBC_SONAME,memalign) \ - (alignment, size); \ + mem = (void*)VALGRIND_NON_SIMD_CALL2( info.tl_memalign, \ + alignment, size ); \ \ if (mem != NULL) { \ *memptr = mem; \ @@ -1721,13 +1842,21 @@ extern int *___errno (void) __attribute__((weak)); /* * No OS does things the same way. * - * Linux, the man page claims that the alignment must be a power - * of two and that size should be a multiple of alignment. + * The C standard says "If the value of _alignment_ is not a valid + * alignment supported by the implementation the function shall + * fail by returning a null pointer". + * + * Linux glibc, the man page claims that the alignment must be + * a power of two and that size should be a multiple of alignment. * However the only case that returns EINVAL (glibc 2.34) * is if the alignement is > SIZE_MAX / 2 + 1 * Also this is just a weak alias for memalign so this wrapper * has no effect on Linux. * + * Linux musl, the alignment must be a power of 2 else + * returns einval. The value of the alignment is clamped + * to a minumum of UNIT (16). + * * FreeBSD. the man page claims alignment must be a power of 2. * UB if size is not an integral multiple of alignment. * The code checks that the alignment is a power of @@ -1753,6 +1882,10 @@ extern int *___errno (void) __attribute__((weak)); { \ void *mem; \ \ + TRIGGER_MEMCHECK_ERROR_IF_UNDEFINED(alignment); \ + TRIGGER_MEMCHECK_ERROR_IF_UNDEFINED(size); \ + MALLOC_TRACE("aligned_alloc(al %llu, size %llu)", \ + (ULong)alignment, (ULong)size ); \ /* Test whether the alignment argument is valid. It must be \ a power of two multiple of sizeof (void *). */ \ if (alignment == 0 \ @@ -1777,6 +1910,8 @@ extern int *___errno (void) __attribute__((weak)); { \ void *mem; \ \ + MALLOC_TRACE("aligned_alloc(al %llu, size %llu)", \ + (ULong)alignment, (ULong)size ); \ if (alignment == 0 \ || size % alignment != 0 \ || (alignment & (alignment - 1)) != 0) { \ @@ -1784,8 +1919,8 @@ extern int *___errno (void) __attribute__((weak)); return 0; \ } \ \ - mem = VG_REPLACE_FUNCTION_EZU(10110,VG_Z_LIBC_SONAME,memalign) \ - (alignment, size); \ + mem = (void*)VALGRIND_NON_SIMD_CALL2( info.tl_memalign, \ + alignment, size ); \ \ if (!mem) SET_ERRNO_ENOMEM; \ \ diff --git a/memcheck/tests/Makefile.am b/memcheck/tests/Makefile.am index efffe7b1c2..e4bf0af207 100644 --- a/memcheck/tests/Makefile.am +++ b/memcheck/tests/Makefile.am @@ -217,7 +217,8 @@ EXTRA_DIST = \ match-overrun.stderr.exp match-overrun.vgtest match-overrun.supp \ memalign_test.stderr.exp memalign_test.vgtest \ memalign_test.stderr.exp-freebsd-clang \ - memalign2.stderr.exp memalign2.vgtest \ + memalign_args.vgtest memalign_args.stderr.exp \ + memalign_args.stderr.exp-glibc \ memcmptest.stderr.exp memcmptest.stderr.exp2 \ memcmptest.stdout.exp memcmptest.vgtest \ memmem.stderr.exp memmem.vgtest \ @@ -272,6 +273,7 @@ EXTRA_DIST = \ pipe.stderr.exp pipe.vgtest \ pointer-trace.vgtest \ pointer-trace.stderr.exp \ + posix_memalign.stderr.exp posix_memalign.vgtest \ post-syscall.stderr.exp post-syscall.vgtest \ reach_thread_register.stderr.exp reach_thread_register.vgtest \ reach_thread_register.stderr.exp-mips32 \ @@ -417,7 +419,8 @@ check_PROGRAMS = \ malloc_free_fill \ malloc_usable malloc1 malloc2 malloc3 manuel1 manuel2 manuel3 \ match-overrun \ - memalign_test memalign2 memcmptest mempool mempool2 mmaptest \ + memalign_test memcmptest mempool mempool2 mmaptest \ + memalign_args \ memmem \ mismatches new_override metadata \ nanoleak_supp nanoleak2 new_nothrow \ @@ -429,6 +432,7 @@ check_PROGRAMS = \ partiallydefinedeq \ partial_load pdb-realloc pdb-realloc2 \ pipe pointer-trace \ + posix_memalign \ post-syscall \ realloc1 realloc2 realloc3 \ recursive-merge \ diff --git a/memcheck/tests/amd64/sh-mem-vec256-plo-no.stderr.exp b/memcheck/tests/amd64/sh-mem-vec256-plo-no.stderr.exp index e85fc6232e..d27c1f4504 100644 --- a/memcheck/tests/amd64/sh-mem-vec256-plo-no.stderr.exp +++ b/memcheck/tests/amd64/sh-mem-vec256-plo-no.stderr.exp @@ -28,15 +28,13 @@ Expect 2 x error Invalid read of size 32 ... Address 0x........ is 1 bytes before a block of size 80,000 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... Invalid write of size 8 ... Address 0x........ is 1 bytes before a block of size 80,000 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -47,15 +45,13 @@ Expect 2 x error Invalid read of size 32 ... Address 0x........ is 79,969 bytes inside a block of size 80,000 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... Invalid write of size 8 ... Address 0x........ is 79,993 bytes inside a block of size 80,000 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -64,8 +60,7 @@ Invalid write of size 8 Invalid read of size 32 ... Address 0x........ is 0 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -80,8 +75,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 0 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -96,8 +90,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 0 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -112,8 +105,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 0 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -128,8 +120,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 0 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -144,8 +135,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 0 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -160,8 +150,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 0 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -176,8 +165,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 0 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -192,8 +180,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 0 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -208,8 +195,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 0 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -224,8 +210,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 0 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -240,8 +225,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 0 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -256,8 +240,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 0 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -272,8 +255,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 0 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -288,8 +270,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 0 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -304,8 +285,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 0 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -320,8 +300,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 0 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -336,8 +315,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 0 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -352,8 +330,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 0 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -368,8 +345,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 0 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -384,8 +360,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 0 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -400,8 +375,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 0 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -416,8 +390,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 0 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -432,8 +405,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 0 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -448,8 +420,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 0 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -464,8 +435,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 0 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -480,8 +450,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 0 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -496,8 +465,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 0 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -512,8 +480,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 0 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -528,8 +495,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 0 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -544,8 +510,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 0 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -560,8 +525,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 0 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -573,8 +537,7 @@ dddddddddddddddddddddddddddddddd Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -589,8 +552,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -605,8 +567,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -621,8 +582,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -637,8 +597,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -653,8 +612,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -669,8 +627,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -685,8 +642,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -701,8 +657,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -717,8 +672,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -733,8 +687,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -749,8 +702,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -765,8 +717,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -781,8 +732,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -797,8 +747,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -813,8 +762,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -829,8 +777,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... diff --git a/memcheck/tests/amd64/sh-mem-vec256-plo-yes.stderr.exp b/memcheck/tests/amd64/sh-mem-vec256-plo-yes.stderr.exp index 2abe31d18f..c8ce5dd25c 100644 --- a/memcheck/tests/amd64/sh-mem-vec256-plo-yes.stderr.exp +++ b/memcheck/tests/amd64/sh-mem-vec256-plo-yes.stderr.exp @@ -28,15 +28,13 @@ Expect 2 x error Invalid read of size 32 ... Address 0x........ is 1 bytes before a block of size 80,000 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... Invalid write of size 8 ... Address 0x........ is 1 bytes before a block of size 80,000 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -47,15 +45,13 @@ Expect 2 x error Invalid read of size 32 ... Address 0x........ is 79,969 bytes inside a block of size 80,000 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... Invalid write of size 8 ... Address 0x........ is 79,993 bytes inside a block of size 80,000 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -352,8 +348,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -368,8 +363,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -384,8 +378,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -400,8 +393,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -416,8 +408,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -432,8 +423,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -448,8 +438,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -464,8 +453,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -480,8 +468,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -496,8 +483,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -512,8 +498,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -528,8 +513,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -544,8 +528,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -560,8 +543,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -576,8 +558,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -592,8 +573,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -608,8 +588,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -624,8 +603,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -640,8 +618,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -656,8 +633,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -672,8 +648,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -688,8 +663,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -704,8 +678,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -720,8 +693,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -736,8 +708,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -752,8 +723,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -768,8 +738,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -784,8 +753,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -800,8 +768,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -816,8 +783,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -832,8 +798,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -848,8 +813,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 32 ... Address 0x........ is 1 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... diff --git a/memcheck/tests/common/sh-mem-vec128-plo-no.stderr.exp-32bit-le b/memcheck/tests/common/sh-mem-vec128-plo-no.stderr.exp-32bit-le index 77dc067405..b4cdfe84ba 100644 --- a/memcheck/tests/common/sh-mem-vec128-plo-no.stderr.exp-32bit-le +++ b/memcheck/tests/common/sh-mem-vec128-plo-no.stderr.exp-32bit-le @@ -28,15 +28,13 @@ Expect 2 x error Invalid read of size 16 ... Address 0x........ is 1 bytes before a block of size 80,000 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... Invalid write of size 8 ... Address 0x........ is 1 bytes before a block of size 80,000 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -47,15 +45,13 @@ Expect 2 x error Invalid read of size 16 ... Address 0x........ is 79,985 bytes inside a block of size 80,000 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... Invalid write of size 8 ... Address 0x........ is 79,993 bytes inside a block of size 80,000 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -64,8 +60,7 @@ Invalid write of size 8 Invalid read of size 16 ... Address 0x........ is 0 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -80,8 +75,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 16 ... Address 0x........ is 0 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -96,8 +90,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 16 ... Address 0x........ is 0 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -112,8 +105,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 16 ... Address 0x........ is 0 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -128,8 +120,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 16 ... Address 0x........ is 0 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -144,8 +135,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 16 ... Address 0x........ is 0 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -160,8 +150,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 16 ... Address 0x........ is 0 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -176,8 +165,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 16 ... Address 0x........ is 0 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: posix_memalign (vg_replace_malloc.c:...) ... @@ -192,8 +180,7 @@ Conditional jump or move depends on uninitialised value(s) Invalid read of size 16 ... Address 0x........ is 0 bytes inside a block of size 64 alloc'd - at 0x........: memalign (vg_replace_malloc.c:...) - by 0x........: posix_memalign (vg_replace_malloc.c:...) + at 0x........: ... [truncated message content] |
|
From: Floyd, P. <pj...@wa...> - 2023-02-28 09:17:52
|
On 28/02/2023 02:18, Feiyang Chen wrote: > > Hi, Paul, > > There are some 'assert' instructions on LoongArch that may trigger SIGSYS. > The new architecture no longer defines SA_RESTORER on Linux. > > linux/include/uapi/asm-generic/signal-defs.h: > /* > * New architectures should not define the obsolete > * SA_RESTORER 0x04000000 > */ Hi Feiyang Thanks for the info. I was wondering if there was any link between the two, but it seems not. A+ Paul |
|
From: Feiyang C. <chr...@gm...> - 2023-02-28 01:18:40
|
On Tue, 28 Feb 2023 at 06:42, Paul Floyd <pj...@wa...> wrote: > > > > On 13-02-23 18:36, Mark Wielaard wrote: > > Hi valgrind developers, > > > >> Some issues we can discuss: > >> > >> - Pick a date for the April 3.21.0 release > >> Critical bugs that are must fix? > > > > We picked Friday April 14 for the RC and Friday April 28 for the final > > release. But we didn't designate any critical must fix bugs (yet?) > > Nothing critical, but always a lot of things that I'd like to get done > by then. > > > >> - loongarch - https://bugs.kde.org/show_bug.cgi?id=457504 > > > > This is split in several small patches and the contributor is really > > responsive. We should split the patches in those that change the core > > code and those that are are just for the loongarch backend. > > I had another look. There is a new signal, SISGSYS, and a lot of the > syscall changes are due to not handling SA_RESTART. I don't yet > understand why. > Hi, Paul, There are some 'assert' instructions on LoongArch that may trigger SIGSYS. The new architecture no longer defines SA_RESTORER on Linux. linux/include/uapi/asm-generic/signal-defs.h: /* * New architectures should not define the obsolete * SA_RESTORER 0x04000000 */ Thanks, Feiyang > >> - https://bugs.kde.org/show_bug.cgi?id=433859 aligned and sized stuff. > >> Do we have enough bits to track this efficiently? > > > > This is for C23, which isn't standard yet. So it won't need to go in > > soon. Julian said that he often disables the alloc/free/new/delete > > matching because it gets confused with some c++ allocators (?). It > > wasn't clear if there is a good solution for that. > > I've been in touch with the guys that proposed this for C23, and it > seems that at least tcmalloc implements this. So I think that we need to > do something sooner rather than later. As a stopgap, add redirs ofr the > two new functions. Probably a full implementation after the April release. > > > A+ > Paul > > > _______________________________________________ > Valgrind-developers mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-developers |