https://sourceware.org/cgit/valgrind/commit/?id=19054d9a8fe14c6b20f989c2c8ff3d7eea8ce40a
commit 19054d9a8fe14c6b20f989c2c8ff3d7eea8ce40a
Author: Paul Floyd <pj...@wa...>
Date: Fri Dec 5 13:47:19 2025 +0100
Darwin: no need to turn off alignment assert in leak check
Mixed up 2 files with previous commit. This also contains
a missing proto and the previous commit fixes issues with badly formed
segments. Needs more investigation.
Diff:
---
coregrind/m_debuginfo/priv_readmacho.h | 3 +++
memcheck/mc_main.c | 14 --------------
2 files changed, 3 insertions(+), 14 deletions(-)
diff --git a/coregrind/m_debuginfo/priv_readmacho.h b/coregrind/m_debuginfo/priv_readmacho.h
index 5ff5d048ce..c945d9b185 100644
--- a/coregrind/m_debuginfo/priv_readmacho.h
+++ b/coregrind/m_debuginfo/priv_readmacho.h
@@ -37,6 +37,9 @@
it. Also count the number of RW segements. */
extern Bool ML_(check_macho_and_get_rw_loads)( Int fd, Int* rw_loads );
+/* Same as above, but reads from memory instead of a file descriptor. */
+extern Bool ML_(check_macho_and_get_rw_loads_from_memory)( const void* buf, SizeT size, Int* rw_loads );
+
/* The central function for reading Mach-O debug info. For the
object/exe specified by the DebugInfo, find Mach-O sections, then read
the symbols, line number info, file name info, CFA (stack-unwind
diff --git a/memcheck/mc_main.c b/memcheck/mc_main.c
index d4ac9fc202..d6c14923c5 100644
--- a/memcheck/mc_main.c
+++ b/memcheck/mc_main.c
@@ -5893,21 +5893,7 @@ Bool MC_(is_within_valid_secondary) ( Addr a )
Bool MC_(is_valid_aligned_word) ( Addr a )
{
tl_assert(sizeof(UWord) == 4 || sizeof(UWord) == 8);
-#if defined(VGO_darwin)
- // on Darwin some of the memcheck/tests/leak-autofreepool-*
- // tests are failing here. VALGRIND_MALLOCLIKE_BLOCK is passed
- // an address that is not word aligned. But that's also the case
- // on other platforms, on FreeBSD leak-autofreepool 0 uses addresses
- // that are only 2 aligned. The problem is more likely that Darwin
- // should not be looking at this chunk of memory.
- if (!VG_IS_WORD_ALIGNED(a) && VG_(clo_verbosity) > 1)
- {
- VG_(printf)("In %s, invariant violation, pointer %p should be word aligned\n", __func__, (void*)a);
- MC_(pp_describe_addr) (VG_(current_DiEpoch)(), a);
- }
-#else
tl_assert(VG_IS_WORD_ALIGNED(a));
-#endif
if (get_vabits8_for_aligned_word32 (a) != VA_BITS8_DEFINED)
return False;
if (sizeof(UWord) == 8) {
|