Bug 166341 - devel/valgrind crash on binaries built with gcc46
Summary: devel/valgrind crash on binaries built with gcc46
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Xin LI
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-23 17:10 UTC by Thomas Russo
Modified: 2012-05-09 01:19 UTC (History)
0 users

See Also:


Attachments
file.diff (4.02 KB, patch)
2012-03-23 17:10 UTC, Thomas Russo
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Russo 2012-03-23 17:10:13 UTC
While this is apparently fixed upstream, the valgrind port in FreeBSD will fail when run with binaries built by gcc 4.6.  The failure is:

Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x2a

While this says it's just a warning, the result is a failure with many subsequent errors such as:

valgrind: m_debuginfo/readdwarf.c:2338 (copy_convert_CfiExpr_tree): Assertion 'srcix >= 0 && srcix < VG_(sizeXA)(srcxa)' failed.
==45514==    at 0x3802B517: ??? (in /usr/local/lib/valgrind/memcheck-amd64-freebsd)
==45514==    by 0x4050FDFDF: ???
==45514==    by 0x3802CB26: ??? (in /usr/local/lib/valgrind/memcheck-amd64-freebsd)
==45514==    by 0x3802B516: ??? (in /usr/local/lib/valgrind/memcheck-amd64-freebsd)
==45514==    by 0x4050FDFDE: ???


Since this is fixed upstream, it is possible to backport the fix, as for example:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=632666

I am attaching a patch produced according to the scheme suggested in the link above.  My patch file is a kitchen-sink patch, including all diffs needed to address the issue, not a collection of individual patch-file-name-X files as is customary in the ports system.  But it works.

This will probably become unnecessary when the valgrind port is updated to a newer release, but it has been failing in this way for at least a couple of months (I first noticed it when gcc 4.5 was removed from ports and replaced by gcc 4.6).

Fix: Add the file attached to ports/devel/valgrind/files as "patch-valgrind-extra" and rebuild valgrind.  It will no longer fail.

Patch attached with submission follows:
How-To-Repeat: Build gcc 4.6.x, compile a program with it.  Install devel/valgrind, run valgrind over the program you built.  It will die.
Comment 1 Xin LI freebsd_committer 2012-05-09 01:09:37 UTC
Responsible Changed
From-To: freebsd-ports-bugs->delphij

Take.
Comment 2 Xin LI freebsd_committer 2012-05-09 01:18:49 UTC
State Changed
From-To: open->closed

Committed, thanks!