]> sourceware.org Git - valgrind.git/commit
vg_replace_malloc DELETE should not check size
authorMark Wielaard <mark@klomp.org>
Thu, 26 Oct 2023 10:25:44 +0000 (12:25 +0200)
committerMark Wielaard <mark@klomp.org>
Thu, 26 Oct 2023 10:35:26 +0000 (12:35 +0200)
commita8b6ee6b5f5efbd759c87fa987e9149800db2899
tree09054b8e80b2040bcd1864fb3335e79c901c1bff
parentbb162ac6c082f371da90fb3691f3185a53c2d56f
vg_replace_malloc DELETE should not check size

The DELETE replacement functions check the size argument, but this
doesn't actually exist.  Only the DELETE_SIZED replacement functions
get a size (and should check it).

On i386 (fedora gnu/linux) this causes the following failures:

memcheck/tests/cxx17_aligned_new         (stderr)
memcheck/tests/leak_cpp_interior         (stderr)
memcheck/tests/mismatches                (stderr)
memcheck/tests/mismatches_xml            (stderr)
memcheck/tests/new_aligned_delete_default (stderr)
memcheck/tests/new_nothrow               (stderr)
memcheck/tests/realloc_size_zero_mismatch (stderr)

All showing "size" being undefined:

+Conditional jump or move depends on uninitialised value(s)
+   at 0x........: ...operator delete[]... (vg_replace_malloc.c:...)

or

+Mismatched new/delete size value: 4
+   at 0x........: ...operator delete... (vg_replace_malloc.c:...)

Oddly no other architecture seems to show issues. Maybe we just got lucky?

This patch fixes the issues on i386 (and shows no regressions on x86_64)

https://bugs.kde.org/show_bug.cgi?id=476108
NEWS
coregrind/m_replacemalloc/vg_replace_malloc.c
This page took 0.02926 seconds and 5 git commands to generate.