Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ports/167506: valgrind not working on FreeBSD 9 (maybe others), fixed upstream, patch attached

19 views
Skip to first unread message

Brett Gmoser

unread,
May 1, 2012, 8:20:53 PM5/1/12
to

>Number: 167506
>Category: ports
>Synopsis: valgrind not working on FreeBSD 9 (maybe others), fixed upstream, patch attached
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Wed May 02 00:30:11 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator: Brett Gmoser
>Release: FreeBSD 9.0-RELEASE amd64
>Organization:
None
>Environment:
System: FreeBSD europa.cyber-lead.com 9.0-RELEASE FreeBSD 9.0-RELEASE #16: Wed Apr 18 07:09:54 EDT 2012 ro...@europa.cyber-lead.com:/usr/obj/usr/src/sys/EUROPA

Freebsd9 amd64 devel/valgrind port
>Description:
Serious severity because it renders valgrind useless on FreeBSD 9. Using valgrind on any binary on my system produces the following:
valgrind: m_debuginfo/readdwarf.c:2338 (copy_convert_CfiExpr_tree): Assertion 'srcix >= 0 && srcix < VG_(sizeXA)(srcxa)' failed.
>How-To-Repeat:
Use valgrind on any binary on my system.
>Fix:
This problem has been fixed upstream. More information is available here:

https://bugs.kde.org/show_bug.cgi?id=277045

Applying the patches there fixes the problem. For your convenience, I've pasted the patches here:

Index: coregrind/m_debuginfo/readdwarf.c
===================================================================
--- coregrind/m_debuginfo/readdwarf.c (revision 11852)
+++ coregrind/m_debuginfo/readdwarf.c (working copy)
@@ -2899,6 +2899,22 @@
op = Cop_And; opname = "and"; goto binop;
case DW_OP_mul:
op = Cop_Mul; opname = "mul"; goto binop;
+ case DW_OP_shl:
+ op = Cop_Shl; opname = "shl"; goto binop;
+ case DW_OP_shr:
+ op = Cop_Shr; opname = "shr"; goto binop;
+ case DW_OP_eq:
+ op = Cop_Eq; opname = "eq"; goto binop;
+ case DW_OP_ge:
+ op = Cop_Ge; opname = "ge"; goto binop;
+ case DW_OP_gt:
+ op = Cop_Gt; opname = "gt"; goto binop;
+ case DW_OP_le:
+ op = Cop_Le; opname = "le"; goto binop;
+ case DW_OP_lt:
+ op = Cop_Lt; opname = "lt"; goto binop;
+ case DW_OP_ne:
+ op = Cop_Ne; opname = "ne"; goto binop;
binop:
POP( ix );
POP( ix2 );
Index: coregrind/m_debuginfo/debuginfo.c
===================================================================
--- coregrind/m_debuginfo/debuginfo.c (revision 11852)
+++ coregrind/m_debuginfo/debuginfo.c (working copy)
@@ -1880,6 +1880,14 @@
case Cop_Sub: return wL - wR;
case Cop_And: return wL & wR;
case Cop_Mul: return wL * wR;
+ case Cop_Shl: return wL << wR;
+ case Cop_Shr: return wL >> wR;
+ case Cop_Eq: return wL == wR ? 1 : 0;
+ case Cop_Ge: return wL >= wR ? 1 : 0;
+ case Cop_Gt: return wL > wR ? 1 : 0;
+ case Cop_Le: return wL <= wR ? 1 : 0;
+ case Cop_Lt: return wL < wR ? 1 : 0;
+ case Cop_Ne: return wL != wR ? 1 : 0;
default: goto unhandled;
}
/*NOTREACHED*/
Index: coregrind/m_debuginfo/storage.c
===================================================================
--- coregrind/m_debuginfo/storage.c (revision 11852)
+++ coregrind/m_debuginfo/storage.c (working copy)
@@ -603,6 +603,14 @@
case Cop_Sub: VG_(printf)("-"); break;
case Cop_And: VG_(printf)("&"); break;
case Cop_Mul: VG_(printf)("*"); break;
+ case Cop_Shl: VG_(printf)("<<"); break;
+ case Cop_Shr: VG_(printf)(">>"); break;
+ case Cop_Eq: VG_(printf)("=="); break;
+ case Cop_Ge: VG_(printf)(">="); break;
+ case Cop_Gt: VG_(printf)(">"); break;
+ case Cop_Le: VG_(printf)("<="); break;
+ case Cop_Lt: VG_(printf)("<"); break;
+ case Cop_Ne: VG_(printf)("!="); break;
default: vg_assert(0);
}
}
Index: coregrind/m_debuginfo/priv_storage.h
===================================================================
--- coregrind/m_debuginfo/priv_storage.h (revision 11852)
+++ coregrind/m_debuginfo/priv_storage.h (working copy)
@@ -249,7 +249,15 @@
Cop_Add=0x321,
Cop_Sub,
Cop_And,
- Cop_Mul
+ Cop_Mul,
+ Cop_Shl,
+ Cop_Shr,
+ Cop_Eq,
+ Cop_Ge,
+ Cop_Gt,
+ Cop_Le,
+ Cop_Lt,
+ Cop_Ne
}
CfiOp;

--- coregrind/m_debuginfo/debuginfo.c.jj 2011-07-21 16:35:56.000000000 +0200
+++ coregrind/m_debuginfo/debuginfo.c 2011-07-21 16:39:22.000000000 +0200
@@ -1883,10 +1883,10 @@ UWord evalCfiExpr ( XArray* exprs, Int i
case Cop_Shl: return wL << wR;
case Cop_Shr: return wL >> wR;
case Cop_Eq: return wL == wR ? 1 : 0;
- case Cop_Ge: return wL >= wR ? 1 : 0;
- case Cop_Gt: return wL > wR ? 1 : 0;
- case Cop_Le: return wL <= wR ? 1 : 0;
- case Cop_Lt: return wL < wR ? 1 : 0;
+ case Cop_Ge: return (Word) wL >= (Word) wR ? 1 : 0;
+ case Cop_Gt: return (Word) wL > (Word) wR ? 1 : 0;
+ case Cop_Le: return (Word) wL <= (Word) wR ? 1 : 0;
+ case Cop_Lt: return (Word) wL < (Word) wR ? 1 : 0;
case Cop_Ne: return wL != wR ? 1 : 0;
default: goto unhandled;
}

>Release-Note:
>Audit-Trail:
>Unformatted:
_______________________________________________
freebsd-p...@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports-bugs
To unsubscribe, send any mail to "freebsd-ports-b...@freebsd.org"

Zhihao Yuan

unread,
May 1, 2012, 9:20:11 PM5/1/12
to
The following reply was made to PR ports/167506; it has been noted by GNATS.

From: Zhihao Yuan <lic...@gmail.com>
To: bug-fo...@FreeBSD.org, bgm...@codexterous.com
Cc:
Subject: Re: ports/167506: valgrind not working on FreeBSD 9 (maybe others),
fixed upstream, patch attached
Date: Tue, 1 May 2012 20:10:44 -0500

This is a duplicate to ports/166341. Please just commit it. I'm pretty
sure the patch is correct and works for the recent compilers.

--
Zhihao Yuan, nickname lichray
The best way to predict the future is to invent it.
___________________________________________________
4BSD -- http://4bsd.biz/

Brett Gmoser

unread,
May 1, 2012, 9:40:11 PM5/1/12
to
The following reply was made to PR ports/167506; it has been noted by GNATS.

From: Brett Gmoser <bgm...@codexterous.com>
To: Zhihao Yuan <lic...@gmail.com>
Cc: bug-fo...@FreeBSD.org
Subject: Re: ports/167506: valgrind not working on FreeBSD 9 (maybe others),
fixed upstream, patch attached
Date: Tue, 01 May 2012 21:32:13 -0400

On 5/1/2012 9:10 PM, Zhihao Yuan wrote:
> This is a duplicate to ports/166341. Please just commit it. I'm pretty
> sure the patch is correct and works for the recent compilers.

Thanks! Indeed the other submitter isolated it a bit more than I did,
and it makes sense that it happens with binaries built with gcc46 (all
of my ports binaries are built with gcc46, which is why I didn't notice).
0 new messages