[valgrind] 3.8.0-4 valgrind-3.8.0-find-buildid.patch workaround bug #849435 (KDE#305431).

Mark Wielaard mjw at fedoraproject.org
Sun Aug 19 13:58:17 UTC 2012


commit 56078f130e18656a4051162a028c163965e1fcc0
Author: Mark Wielaard <mjw at redhat.com>
Date:   Sun Aug 19 15:37:33 2012 +0200

    3.8.0-4 valgrind-3.8.0-find-buildid.patch workaround bug #849435 (KDE#305431).

 valgrind-3.8.0-find-buildid.patch |   44 +++++++++++++++++++++++++++++++++++++
 valgrind.spec                     |    7 +++++-
 2 files changed, 50 insertions(+), 1 deletions(-)
---
diff --git a/valgrind-3.8.0-find-buildid.patch b/valgrind-3.8.0-find-buildid.patch
new file mode 100644
index 0000000..f58d59f
--- /dev/null
+++ b/valgrind-3.8.0-find-buildid.patch
@@ -0,0 +1,44 @@
+Index: coregrind/m_debuginfo/readelf.c
+===================================================================
+--- valgrind-3.8.0/coregrind/m_debuginfo/readelf.c	(revision 12871)
++++ valgrind-3.8.0/coregrind/m_debuginfo/readelf.c	(working copy)
+@@ -888,7 +888,7 @@
+  * http://fedoraproject.org/wiki/RolandMcGrath/BuildID
+  */
+ static
+-Char *find_buildid(Addr image, UWord n_image, Bool rel_ok)
++Char *find_buildid(Addr image, UWord n_image, Bool rel_ok, Bool search_shdrs)
+ {
+    Char* buildid = NULL;
+    __attribute__((unused)) /* on Android, at least */
+@@ -930,7 +930,11 @@
+          }
+       }
+ 
+-      if (buildid || !rel_ok)
++      /* Normally we would only search shdrs for ET_REL files, but when
++         we search for a separate .debug file phdrs might not be there
++         (they are never loaded) or have been corrupted, so try again
++         against shdrs. */
++      if (buildid || (!rel_ok && !search_shdrs))
+          return buildid;
+ 
+       for (i = 0; i < ehdr->e_shnum; i++) {
+@@ -1074,7 +1078,7 @@
+       return 0;
+ 
+    if (buildid) {
+-      Char* debug_buildid = find_buildid(sr_Res(sres), *size, rel_ok);
++      Char* debug_buildid = find_buildid(sr_Res(sres), *size, rel_ok, True);
+       if (debug_buildid == NULL || VG_(strcmp)(buildid, debug_buildid) != 0) {
+          SysRes res = VG_(am_munmap_valgrind)(sr_Res(sres), *size);
+          vg_assert(!sr_isError(res));
+@@ -2274,7 +2278,7 @@
+       vg_assert(dimage == 0 && n_dimage == 0);
+ 
+       /* Look for a build-id */
+-      buildid = find_buildid(oimage, n_oimage, False);
++      buildid = find_buildid(oimage, n_oimage, False, False);
+ 
+       /* Look for a debug image */
+       if (buildid != NULL || debuglink_img != NULL) {
diff --git a/valgrind.spec b/valgrind.spec
index 49791b9..947ae5b 100644
--- a/valgrind.spec
+++ b/valgrind.spec
@@ -1,7 +1,7 @@
 Summary: Tool for finding memory management bugs in programs
 Name: valgrind
 Version: 3.8.0
-Release: 3%{?dist}
+Release: 4%{?dist}
 Epoch: 1
 License: GPLv2
 URL: http://www.valgrind.org/
@@ -19,6 +19,7 @@ Patch8: valgrind-3.8.0-tests.patch
 Patch9: valgrind-3.8.0-enable-armv5.patch
 Patch10: valgrind-3.8.0-ldso-supp.patch
 Patch11: valgrind-3.8.0-x86-backtrace.patch
+Patch12: valgrind-3.8.0-find-buildid.patch
 
 Obsoletes: valgrind-callgrind
 %ifarch x86_64 ppc64
@@ -109,6 +110,7 @@ for details.
 %patch9 -p1
 %patch10 -p1
 %patch11 -p1
+%patch12 -p1
 
 %build
 CC=gcc
@@ -219,6 +221,9 @@ echo ===============END TESTING===============
 %endif
 
 %changelog
+* Sun Aug 19 2012 Mark Wielaard <mjw at redhat.com> 3.8.0-4
+- Add valgrind-3.8.0-find-buildid.patch workaround bug #849435 (KDE#305431).
+
 * Wed Aug 15 2012 Jakub Jelinek <jakub at redhat.com> 3.8.0-3
 - fix up last change
 


More information about the scm-commits mailing list