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

This commit is contained in:
Mark Wielaard 2012-08-19 15:37:33 +02:00
parent 70985ab935
commit 56078f130e
2 changed files with 50 additions and 1 deletions

View File

@ -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) {

View File

@ -1,7 +1,7 @@
Summary: Tool for finding memory management bugs in programs Summary: Tool for finding memory management bugs in programs
Name: valgrind Name: valgrind
Version: 3.8.0 Version: 3.8.0
Release: 3%{?dist} Release: 4%{?dist}
Epoch: 1 Epoch: 1
License: GPLv2 License: GPLv2
URL: http://www.valgrind.org/ URL: http://www.valgrind.org/
@ -19,6 +19,7 @@ Patch8: valgrind-3.8.0-tests.patch
Patch9: valgrind-3.8.0-enable-armv5.patch Patch9: valgrind-3.8.0-enable-armv5.patch
Patch10: valgrind-3.8.0-ldso-supp.patch Patch10: valgrind-3.8.0-ldso-supp.patch
Patch11: valgrind-3.8.0-x86-backtrace.patch Patch11: valgrind-3.8.0-x86-backtrace.patch
Patch12: valgrind-3.8.0-find-buildid.patch
Obsoletes: valgrind-callgrind Obsoletes: valgrind-callgrind
%ifarch x86_64 ppc64 %ifarch x86_64 ppc64
@ -109,6 +110,7 @@ for details.
%patch9 -p1 %patch9 -p1
%patch10 -p1 %patch10 -p1
%patch11 -p1 %patch11 -p1
%patch12 -p1
%build %build
CC=gcc CC=gcc
@ -219,6 +221,9 @@ echo ===============END TESTING===============
%endif %endif
%changelog %changelog
* Sun Aug 19 2012 Mark Wielaard <mjw@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@redhat.com> 3.8.0-3 * Wed Aug 15 2012 Jakub Jelinek <jakub@redhat.com> 3.8.0-3
- fix up last change - fix up last change