[valgrind/f15] valgrind-3.6.1-4

Jakub Jelinek jakub at fedoraproject.org
Tue Jun 14 11:36:09 UTC 2011


commit 7aaae1e59f345dcbfabea01d291a50cd739af6dd
Author: Jakub Jelinek <jakub at redhat.com>
Date:   Tue Jun 14 13:35:58 2011 +0200

    valgrind-3.6.1-4

 valgrind-3.6.1-ppc64-build.patch           |   20 ++++++
 valgrind-3.6.1-tests-_GNU_SOURCE.patch     |   90 +++++++++++++++++++++++++++
 valgrind-3.6.1-x86_64-memcpy-memmove.patch |   92 ++++++++++++++++++++++++++++
 valgrind.spec                              |   36 ++++++++---
 4 files changed, 229 insertions(+), 9 deletions(-)
---
diff --git a/valgrind-3.6.1-ppc64-build.patch b/valgrind-3.6.1-ppc64-build.patch
new file mode 100644
index 0000000..44430b3
--- /dev/null
+++ b/valgrind-3.6.1-ppc64-build.patch
@@ -0,0 +1,20 @@
+--- valgrind/coregrind/m_dispatch/dispatch-ppc64-linux.S	(revision 11699)
++++ valgrind/coregrind/m_dispatch/dispatch-ppc64-linux.S	(revision 11700)
+@@ -310,7 +310,7 @@
+ 	/* start over */
+ 	b	.VG_(run_innerloop__dispatch_unprofiled)
+ 	/*NOTREACHED*/
+-        .size VG_(run_innerloop), .-VG_(run_innerloop)
++        .size .VG_(run_innerloop), .-.VG_(run_innerloop)
+ 
+ 
+ /*----------------------------------------------------*/
+@@ -385,7 +385,7 @@
+ 	/* start over */
+ 	b	.VG_(run_innerloop__dispatch_profiled)
+ 	/*NOTREACHED*/
+-        .size VG_(run_a_noredir_translation), .-VG_(run_a_noredir_translation)
++        .size .VG_(run_a_noredir_translation), .-.VG_(run_a_noredir_translation)
+ 
+ 
+ /*----------------------------------------------------*/
diff --git a/valgrind-3.6.1-tests-_GNU_SOURCE.patch b/valgrind-3.6.1-tests-_GNU_SOURCE.patch
new file mode 100644
index 0000000..a54d545
--- /dev/null
+++ b/valgrind-3.6.1-tests-_GNU_SOURCE.patch
@@ -0,0 +1,90 @@
+--- valgrind/memcheck/tests/x86-linux/scalar.c	(revision 11801)
++++ valgrind/memcheck/tests/x86-linux/scalar.c	(revision 11802)
+@@ -1,3 +1,5 @@
++#define _GNU_SOURCE
++
+ #include "../../memcheck.h"
+ #include "scalar.h"
+ #include <unistd.h>
+--- valgrind/memcheck/tests/x86-linux/scalar.stderr.exp	(revision 11801)
++++ valgrind/memcheck/tests/x86-linux/scalar.stderr.exp	(revision 11802)
+@@ -578,25 +578,25 @@
+    ...
+  Address 0x........ is 0 bytes after a block of size 4 alloc'd
+    at 0x........: malloc (vg_replace_malloc.c:...)
+-   by 0x........: main (scalar.c:28)
++   by 0x........: main (scalar.c:30)
+ 
+ Syscall param sigaction(act->sa_mask) points to unaddressable byte(s)
+    ...
+  Address 0x........ is 4 bytes after a block of size 4 alloc'd
+    at 0x........: malloc (vg_replace_malloc.c:...)
+-   by 0x........: main (scalar.c:28)
++   by 0x........: main (scalar.c:30)
+ 
+ Syscall param sigaction(act->sa_flags) points to unaddressable byte(s)
+    ...
+  Address 0x........ is 8 bytes after a block of size 4 alloc'd
+    at 0x........: malloc (vg_replace_malloc.c:...)
+-   by 0x........: main (scalar.c:28)
++   by 0x........: main (scalar.c:30)
+ 
+ Syscall param sigaction(oldact) points to unaddressable byte(s)
+    ...
+  Address 0x........ is 0 bytes after a block of size 4 alloc'd
+    at 0x........: malloc (vg_replace_malloc.c:...)
+-   by 0x........: main (scalar.c:28)
++   by 0x........: main (scalar.c:30)
+ 
+ -----------------------------------------------------
+  68:       __NR_sgetmask n/a
+@@ -1228,13 +1228,13 @@
+    ...
+  Address 0x........ is 0 bytes after a block of size 4 alloc'd
+    at 0x........: malloc (vg_replace_malloc.c:...)
+-   by 0x........: main (scalar.c:28)
++   by 0x........: main (scalar.c:30)
+ 
+ Syscall param sigprocmask(oldset) points to unaddressable byte(s)
+    ...
+  Address 0x........ is 0 bytes after a block of size 4 alloc'd
+    at 0x........: malloc (vg_replace_malloc.c:...)
+-   by 0x........: main (scalar.c:28)
++   by 0x........: main (scalar.c:30)
+ 
+ -----------------------------------------------------
+ 127:  __NR_create_module ni
+@@ -1747,7 +1747,7 @@
+    ...
+  Address 0x........ is 4 bytes after a block of size 4 alloc'd
+    at 0x........: malloc (vg_replace_malloc.c:...)
+-   by 0x........: main (scalar.c:28)
++   by 0x........: main (scalar.c:30)
+ 
+ Syscall param rt_sigaction(act->sa_mask) points to unaddressable byte(s)
+    ...
+@@ -1757,13 +1757,13 @@
+    ...
+  Address 0x........ is 8 bytes after a block of size 4 alloc'd
+    at 0x........: malloc (vg_replace_malloc.c:...)
+-   by 0x........: main (scalar.c:28)
++   by 0x........: main (scalar.c:30)
+ 
+ Syscall param rt_sigaction(oldact) points to unaddressable byte(s)
+    ...
+  Address 0x........ is 4 bytes after a block of size 4 alloc'd
+    at 0x........: malloc (vg_replace_malloc.c:...)
+-   by 0x........: main (scalar.c:28)
++   by 0x........: main (scalar.c:30)
+ 
+ -----------------------------------------------------
+ 175: __NR_rt_sigprocmask 4s 2m
+--- valgrind/memcheck/tests/linux/stack_switch.c	(revision 11801)
++++ valgrind/memcheck/tests/linux/stack_switch.c	(revision 11802)
+@@ -1,5 +1,6 @@
+ #define _XOPEN_SOURCE 600
+ #define _BSD_SOURCE
++#define _GNU_SOURCE
+ 
+ #include <stdio.h>
+ 
diff --git a/valgrind-3.6.1-x86_64-memcpy-memmove.patch b/valgrind-3.6.1-x86_64-memcpy-memmove.patch
new file mode 100644
index 0000000..39bc1cf
--- /dev/null
+++ b/valgrind-3.6.1-x86_64-memcpy-memmove.patch
@@ -0,0 +1,92 @@
+--- valgrind/memcheck/mc_replace_strmem.c.jj	2011-06-08 17:26:29.000000000 +0200
++++ valgrind/memcheck/mc_replace_strmem.c	2011-06-09 14:49:11.000000000 +0200
+@@ -558,11 +558,7 @@ MEMCHR(VG_Z_DYLD,        memchr)
+ #endif
+ 
+ 
+-#define MEMCPY(soname, fnname) \
+-   void* VG_REPLACE_FUNCTION_ZU(soname,fnname) \
+-            ( void *dst, const void *src, SizeT len ); \
+-   void* VG_REPLACE_FUNCTION_ZU(soname,fnname) \
+-            ( void *dst, const void *src, SizeT len ) \
++#define MEMCPY_BODY \
+    { \
+       if (is_overlap(dst, src, len, len)) \
+          RECORD_OVERLAP_ERROR("memcpy", dst, src, len); \
+@@ -628,6 +624,18 @@ MEMCHR(VG_Z_DYLD,        memchr)
+       \
+       return dst; \
+    }
++#define MEMCPY(soname, fnname) \
++   void* VG_REPLACE_FUNCTION_ZU(soname,fnname) \
++            ( void *dst, const void *src, SizeT len ); \
++   void* VG_REPLACE_FUNCTION_ZU(soname,fnname) \
++            ( void *dst, const void *src, SizeT len ) \
++   MEMCPY_BODY
++#define MEMCPY_ZZ(soname, fnname) \
++   void* VG_REPLACE_FUNCTION_ZZ(soname,fnname) \
++            ( void *dst, const void *src, SizeT len ); \
++   void* VG_REPLACE_FUNCTION_ZZ(soname,fnname) \
++            ( void *dst, const void *src, SizeT len ) \
++   MEMCPY_BODY
+ 
+ MEMCPY(VG_Z_LIBC_SONAME, memcpy)
+ #if defined(VGO_linux)
+@@ -636,6 +644,11 @@ MEMCPY(VG_Z_LD64_SO_1,   memcpy) /* ld64
+ #elif defined(VGO_darwin)
+ MEMCPY(VG_Z_DYLD,        memcpy)
+ #endif
++#if defined(VGP_amd64_linux)
++/* In glibc 2.14+, memcpy at GLIBC_2.2.5 is an alias to memmove and only
++   memcpy@@GLIBC_2.14 is a real memcpy.  */
++MEMCPY_ZZ(VG_Z_LIBC_SONAME, memcpyZAZAGLIBCZu2Zd14) /* memcpy@@GLIBC_2.14 */
++#endif
+ /* icc9 blats these around all over the place.  Not only in the main
+    executable but various .so's.  They are highly tuned and read
+    memory beyond the source boundary (although work correctly and
+@@ -738,11 +751,7 @@ MEMSET(VG_Z_DYLD,        memset)
+ #endif
+ 
+ 
+-#define MEMMOVE(soname, fnname) \
+-   void* VG_REPLACE_FUNCTION_ZU(soname,fnname) \
+-            (void *dstV, const void *srcV, SizeT n); \
+-   void* VG_REPLACE_FUNCTION_ZU(soname,fnname) \
+-            (void *dstV, const void *srcV, SizeT n) \
++#define MEMMOVE_BODY \
+    { \
+       SizeT i; \
+       Char* dst = (Char*)dstV; \
+@@ -758,12 +767,31 @@ MEMSET(VG_Z_DYLD,        memset)
+       } \
+       return dst; \
+    }
++#define MEMMOVE(soname, fnname) \
++   void* VG_REPLACE_FUNCTION_ZU(soname,fnname) \
++            (void *dstV, const void *srcV, SizeT n); \
++   void* VG_REPLACE_FUNCTION_ZU(soname,fnname) \
++            (void *dstV, const void *srcV, SizeT n) \
++   MEMMOVE_BODY
++#define MEMMOVE_ZZ(soname, fnname) \
++   void* VG_REPLACE_FUNCTION_ZZ(soname,fnname) \
++            (void *dstV, const void *srcV, SizeT n); \
++   void* VG_REPLACE_FUNCTION_ZZ(soname,fnname) \
++            (void *dstV, const void *srcV, SizeT n) \
++   MEMMOVE_BODY
+ 
+ MEMMOVE(VG_Z_LIBC_SONAME, memmove)
+ #if defined(VGO_darwin)
+ MEMMOVE(VG_Z_DYLD,        memmove)
+ #endif
+-
++#if defined(VGP_amd64_linux)
++/* In glibc 2.14+, memcpy at GLIBC_2.2.5 is an alias to memmove and only
++   memcpy@@GLIBC_2.14 is a real memcpy.  It would be nice for
++   memcpy at GLIBC_2.2.5 to differentiate based on whether the caller
++   was calling memmove or memcpy at GLIBC_2.2.5, for now just treat
++   all such calls as memmove.  */
++MEMMOVE_ZZ(VG_Z_LIBC_SONAME, memcpyZAGLIBCZu2Zd2Zd5) /* memcpy at GLIBC_2.2.5 */
++#endif
+ 
+ #define BCOPY(soname, fnname) \
+    void VG_REPLACE_FUNCTION_ZU(soname,fnname) \
diff --git a/valgrind.spec b/valgrind.spec
index 932c724..8ea3de9 100644
--- a/valgrind.spec
+++ b/valgrind.spec
@@ -1,7 +1,7 @@
 Summary: Tool for finding memory management bugs in programs
 Name: valgrind
 Version: 3.6.1
-Release: 1%{?dist}
+Release: 4%{?dist}
 Epoch: 1
 Source0: http://www.valgrind.org/downloads/valgrind-%{version}.tar.bz2
 Patch1: valgrind-3.6.1-cachegrind-improvements.patch
@@ -22,6 +22,9 @@ Patch15: valgrind-3.6.1-ppc64-pwrite64.patch
 Patch16: valgrind-3.6.1-pie.patch
 Patch17: valgrind-3.6.1-gen_insn_test.patch
 Patch18: valgrind-3.6.1-x86-ldso-strlen.patch
+Patch19: valgrind-3.6.1-ppc64-build.patch
+Patch20: valgrind-3.6.1-tests-_GNU_SOURCE.patch
+Patch21: valgrind-3.6.1-x86_64-memcpy-memmove.patch
 License: GPLv2
 URL: http://www.valgrind.org/
 Group: Development/Debuggers
@@ -32,7 +35,7 @@ Obsoletes: valgrind-callgrind
 BuildRequires: /lib/libc.so.6 /usr/lib/libc.so /lib64/libc.so.6 /usr/lib64/libc.so
 %endif
 %if 0%{?fedora} >= 15
-BuildRequires: glibc-devel >= 2.13
+BuildRequires: glibc-devel >= 2.14
 %else
 BuildRequires: glibc-devel >= 2.12
 %endif
@@ -114,8 +117,11 @@ for details.
 %patch16 -p1
 %patch17 -p1
 %patch18 -p1
+%patch19 -p1
+%patch20 -p1
+%patch21 -p1
 
-chmod 755 none/tests/s390x/filter_stderr
+chmod 755 none/tests/s390x/filter_stderr || :
 
 %build
 CC=gcc
@@ -157,12 +163,6 @@ gcc $RPM_OPT_FLAGS -o close_fds close_fds.c
 # XXX pth_cancel2 hangs on x86_64
 echo 'int main (void) { return 0; }' > none/tests/pth_cancel2.c
 
-# test
-make check || :
-echo ===============TESTING===================
-./close_fds make regtest || :
-echo ===============END TESTING===============
-
 %install
 rm -rf $RPM_BUILD_ROOT
 
@@ -187,6 +187,12 @@ popd
 
 rm -f $RPM_BUILD_ROOT%{_libdir}/valgrind/*.supp.in
 
+%check
+make %{?_smp_mflags} check || :
+echo ===============TESTING===================
+./close_fds make regtest || :
+echo ===============END TESTING===============
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -215,6 +221,18 @@ rm -rf $RPM_BUILD_ROOT
 %endif
 
 %changelog
+* Mon Jun 13 2011 Jakub Jelinek <jakub at redhat.com> 3.6.1-4
+- fix memcpy/memmove redirection on x86_64 (#705790)
+
+* Wed Jun  8 2011 Jakub Jelinek <jakub at redhat.com> 3.6.1-3
+- fix testing against glibc 2.14
+
+* Wed Jun  8 2011 Jakub Jelinek <jakub at redhat.com> 3.6.1-2
+- fix build on ppc64 (#711608)
+- don't fail if s390x support patch hasn't been applied,
+  move testing into %%check (#708522)
+- rebuilt against glibc 2.14
+
 * Wed Feb 23 2011 Jakub Jelinek <jakub at redhat.com> 3.6.1-1
 - update to 3.6.1
 


More information about the scm-commits mailing list