ports/71832: Default Valgrind suppresion files for different FreeBSD releases

Frerich Raabe raabe at kde.org
Tue Sep 21 02:30:30 UTC 2004


The following reply was made to PR ports/71832; it has been noted by GNATS.

From: Frerich Raabe <raabe at kde.org>
To: Simon Barner <barner at in.tum.de>
Cc: frerich at athame.co.uk, FreeBSD-gnats-submit at freebsd.org
Subject: Re: ports/71832: Default Valgrind suppresion files for different FreeBSD releases
Date: Tue, 21 Sep 2004 03:59:41 +0200

 --Boundary-00=_Ns4TBVyv80bVLp8
 Content-Type: text/plain;
   charset="iso-8859-1"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline
 
 On Tuesday 21 September 2004 03:22, Simon Barner wrote:
 > > I'll try to generate suppresion files for different FreeBSD versions, and
 > > attach them to this report as I get them.
 
 > If you want, you can send me those suppression files before submitting
 > them to GNATs, so I can have a look at them.
 
 Actually, I came up with a different (IMHO superior) way to implement this. 
 The most flexible solution would be to run a script at post-install time 
 which automatically generates a suppression file for whatever system the port 
 is being built on.
 
 I attached a patch which attempts to implement this, it would be much 
 appreciated if you could review it.
 
 - Frerich
 
 --Boundary-00=_Ns4TBVyv80bVLp8
 Content-Type: text/x-diff;
   charset="iso-8859-1";
   name="devel-valgrind.diff"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
 	filename="devel-valgrind.diff"
 
 diff -ruN /usr/ports/devel/valgrind/Makefile devel/valgrind/Makefile
 --- /usr/ports/devel/valgrind/Makefile	Thu Sep  2 07:15:19 2004
 +++ devel/valgrind/Makefile	Tue Sep 21 03:54:57 2004
 @@ -68,9 +68,14 @@
  	${INSTALL_DATA} ${WRKSRC}/coregrind/vg_unistd.h \
  		${PREFIX}/include/valgrind
  
 +	${SCRIPTDIR}/make-suppressions.sh ${PREFIX}/bin/valgrind \
 +		> ${WRKDIR}/freebsd-default.supp
 +	${INSTALL_DATA} ${WRKDIR}/freebsd-default.supp \
 +		${PREFIX}/etc
 +
  	@${ECHO} ""
  	@${ECHO} ""
 -	@${CAT} ${PKGMESSAGE}
 +	@${CAT} ${PKGMESSAGE} | ${SED} -e 's,%%PREFIX%%,${PREFIX},g'
  	@${ECHO} ""
  
  .include <bsd.port.post.mk>
 diff -ruN /usr/ports/devel/valgrind/pkg-message devel/valgrind/pkg-message
 --- /usr/ports/devel/valgrind/pkg-message	Sun Jul 25 19:01:59 2004
 +++ devel/valgrind/pkg-message	Tue Sep 21 03:56:06 2004
 @@ -7,3 +7,14 @@
  
        As a workaround you can use the devel/valgrind-snapshot port, which is
        based on a more recent snapshot.
 +
 +Note2: A sample suppression file was installed to \
 +       %%PREFIX%%/etc/freebsd-default.supp. It makes Valgrind hide warnings
 +       caused by flawed code sequences - if any - in your system libraries,
 +       so that you can concentrate on the warnings issued for your own code.
 +
 +	   To use these suppressions, either pass
 +       --suppressions=%%PREFIX%%/etc/freebsd-default.supp
 +       to Valgrind on the commandline, or add that line to your
 +       ~/.valgrindrc file, which is the recommended way.
 +
 diff -ruN /usr/ports/devel/valgrind/pkg-plist devel/valgrind/pkg-plist
 --- /usr/ports/devel/valgrind/pkg-plist	Wed Sep  1 18:27:20 2004
 +++ devel/valgrind/pkg-plist	Tue Sep 21 03:39:28 2004
 @@ -36,6 +36,7 @@
  lib/valgrind/xfree-3.supp
  lib/valgrind/xfree-4.supp
  libdata/pkgconfig/valgrind.pc
 +etc/freebsd-default.supp
  %%PORTDOCS%%%%DOCSDIR%%/ac_main.html
  %%PORTDOCS%%%%DOCSDIR%%/cc_main.html
  %%PORTDOCS%%%%DOCSDIR%%/cg_main.html
 diff -ruN /usr/ports/devel/valgrind/scripts/make-suppressions.sh devel/valgrind/scripts/make-suppressions.sh
 --- /usr/ports/devel/valgrind/scripts/make-suppressions.sh	Thu Jan  1 01:00:00 1970
 +++ devel/valgrind/scripts/make-suppressions.sh	Tue Sep 21 03:40:24 2004
 @@ -0,0 +1,18 @@
 +#!/bin/sh
 +myself=`basename $0`
 +sandbox=`mktemp -d -q /tmp/$myself.XXXXXX`
 +if [ $? -ne 0 ]; then
 +	echo "$0: Cannot generate temporary directory."
 +	exit 1
 +fi
 +
 +curdir=$PWD
 +
 +cd $sandbox
 +echo 'int main(){}' > mini.c
 +cc -o mini mini.c
 +yes | $1 --tool=memcheck --gen-suppressions=yes ./mini > supp 2>&1
 +perl -p -e 's,.*{$,{,' supp | grep -v '^='
 +
 +cd $curdir
 +rm -rf $sandbox
 
 --Boundary-00=_Ns4TBVyv80bVLp8--
 



More information about the freebsd-ports-bugs mailing list