Allowing to run a buildfarm animal under valgrind - Mailing list pgsql-hackers

From Andres Freund
Subject Allowing to run a buildfarm animal under valgrind
Date
Msg-id 20160308013930.u2xcx3ophjwhibg7@alap3.anarazel.de
Whole thread Raw
Responses Re: Allowing to run a buildfarm animal under valgrind  (Andres Freund <andres@anarazel.de>)
Re: Allowing to run a buildfarm animal under valgrind  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
Hi,

I'm setting up a buildfarm animal that runs under
valgrind. Unfortunately there's not really any good solution to force
make check et al. to start postgres wrapped in valgrind.  For now I've
resorted to adding something like

sub replace_postgres
{   my $srcdir=$use_vpath ? "../pgsql/" : ".";   my $builddir=abs_path("$pgsql");   $srcdir=abs_path("$pgsql/$srcdir");
 chdir "$pgsql/src/backend/";   rename "postgres", "postgres.orig";   sysopen my $fh, "postgres",
O_CREAT|O_TRUNC|O_RDWR,0700       or die "Could not create postgres wrapper";   print $fh <<"END";
 
#!/bin/bash
~/src/valgrind/vg-in-place \\   --quiet \\   --error-exitcode=128 \\   --suppressions=$srcdir/src/tools/valgrind.supp
\\  --trace-children=yes --track-origins=yes --read-var-info=yes \\   --leak-check=no \\
$builddir/src/backend/postgres.orig\\   "\$@"
 
END   close $fh;   chdir $branch_root;
}
to the buildfarm client.

i.e. a script that replaces the postgres binary with a wrapper that
invokes postgres via valgrind.

That's obviously not a very good approach though. It's buildfarm
specific and thus can't be invoked by developers and it doesn't really
support being installed somewhere.

Does anybody have a better idea about how to do this?

Regards,

Andres



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Fix misspelling of "parallel"
Next
From: Tom Lane
Date:
Subject: Re: Typo in logicaldecoding docs