Notification time stamped 2023-10-31 22:24:17 UTC
From 79f7a0b69f360048736c7eb4da31473a42146726 Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mark(a)klomp.org>
Date: Oct 30 2023 19:38:48 +0000
Subject: 3.22.0-0.2.RC2 - Update valgrind-3.21.0-no-memcpy-replace-check.patch
---
diff --git a/valgrind-3.21.0-no-memcpy-replace-check.patch
b/valgrind-3.21.0-no-memcpy-replace-check.patch
index 6e26e04..1f59a90 100644
--- a/valgrind-3.21.0-no-memcpy-replace-check.patch
+++ b/valgrind-3.21.0-no-memcpy-replace-check.patch
@@ -1,22 +1,54 @@
+diff --git a/memcheck/tests/overlap.vgtest b/memcheck/tests/overlap.vgtest
+index 54a0baacf..eba65897c 100644
+--- a/memcheck/tests/overlap.vgtest
++++ b/memcheck/tests/overlap.vgtest
+@@ -1,2 +1,4 @@
+ prog: overlap
+ vgopts: -q
++#
https://bugs.kde.org/show_bug.cgi?id=402833
++prereq: ! ../../tests/arch_test amd64
diff --git a/shared/vg_replace_strmem.c b/shared/vg_replace_strmem.c
-index b32f13f76..464e8d4ca 100644
+index 8de6a0698..79e640189 100644
--- a/shared/vg_replace_strmem.c
+++ b/shared/vg_replace_strmem.c
-@@ -1128,7 +1128,7 @@ static inline void my_exit ( int x )
+@@ -1128,8 +1128,15 @@ static inline void my_exit ( int x )
+ #define MEMMOVE(soname, fnname) \
MEMMOVE_OR_MEMCPY(20181, soname, fnname, 0)
- #define MEMCPY(soname, fnname) \
-- MEMMOVE_OR_MEMCPY(20180, soname, fnname, 1)
-+ MEMMOVE_OR_MEMCPY(20180, soname, fnname, 0) /* See KDE bug #402833 */
+-#define MEMCPY(soname, fnname) \
++/* See
https://bugs.kde.org/show_bug.cgi?id=402833
++ why we disable the overlap check on x86_64. */
++#if defined(VGP_amd64_linux)
++ #define MEMCPY(soname, fnname) \
++ MEMMOVE_OR_MEMCPY(20180, soname, fnname, 0)
++#else
++ #define MEMCPY(soname, fnname) \
+ MEMMOVE_OR_MEMCPY(20180, soname, fnname, 1)
++#endif
#if defined(VGO_linux)
/* For older memcpy we have to use memmove-like semantics and skip
-@@ -1714,8 +1714,6 @@ static inline void my_exit ( int x )
+@@ -1704,6 +1711,14 @@ static inline void my_exit ( int x )
+
+ /*-------------------- memcpy_chk --------------------*/
+
++/* See
https://bugs.kde.org/show_bug.cgi?id=402833
++ why we disable the overlap check on x86_64. */
++#if defined(VGP_amd64_linux)
++ #define CHECK_OVERLAP 0
++#else
++ #define CHECK_OVERLAP 1
++#endif
++
+ #define GLIBC26___MEMCPY_CHK(soname, fnname) \
+ void* VG_REPLACE_FUNCTION_EZU(20300,soname,fnname) \
+ (void* dst, const void* src, SizeT len, SizeT dstlen ); \
+@@ -1717,7 +1732,7 @@ static inline void my_exit ( int x )
RECORD_COPY(len); \
if (len == 0) \
return dst; \
- if (is_overlap(dst, src, len, len)) \
-- RECORD_OVERLAP_ERROR("memcpy_chk", dst, src, len); \
++ if (CHECK_OVERLAP && is_overlap(dst, src, len, len)) \
+ RECORD_OVERLAP_ERROR("memcpy_chk", dst, src, len); \
if ( dst > src ) { \
d = (HChar *)dst + len - 1; \
- s = (const HChar *)src + len - 1; \
diff --git a/valgrind.spec b/valgrind.spec
index 80231ec..277bf90 100644
--- a/valgrind.spec
+++ b/valgrind.spec
@@ -3,7 +3,7 @@
Summary: Dynamic analysis tools to detect memory or thread bugs and profile
Name: %{?scl_prefix}valgrind
Version: 3.22.0
-Release: 0.1.RC2%{?dist}
+Release: 0.2.RC2%{?dist}
Epoch: 1
License: GPLv2+
URL:
https://www.valgrind.org/
@@ -458,6 +458,9 @@ fi
%endif
%changelog
+* Mon Oct 30 2023 Mark Wielaard <mjw(a)fedoraproject.org> - 3.22.0-0.2.RC2
+- Update valgrind-3.21.0-no-memcpy-replace-check.patch
+
* Thu Oct 26 2023 Mark Wielaard <mjw(a)fedoraproject.org> - 3.22.0-0.1.RC2
- Upstream 3.22.0-RC2
https://src.fedoraproject.org/rpms/valgrind/c/79f7a0b69f360048736c7eb4da3...