]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Darwin: no need to turn off alignment assert in leak check
authorPaul Floyd <pjfloyd@wanadoo.fr>
Fri, 5 Dec 2025 12:47:19 +0000 (13:47 +0100)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Fri, 5 Dec 2025 12:47:19 +0000 (13:47 +0100)
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.

coregrind/m_debuginfo/priv_readmacho.h
memcheck/mc_main.c

index 5ff5d048ce9d02f84a07cce87c0606b67e27ddb6..c945d9b185908aeb3df5154c9c68eccb053bde04 100644 (file)
@@ -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
index d4ac9fc202be823c5a60df9f45c4a2c1f5a63da4..d6c14923c53069cd38695ed492eec9ce1884774a 100644 (file)
@@ -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) {