On Fri, May 17, 2013 at 11:07:38AM +0100, Daniel P. Berrange wrote:
> On Fri, May 17, 2013 at 11:54:12AM +0200, Markus Armbruster wrote:
> > If you want punishment, why not go for extra punishment?
> > 
> > MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
> 
> That could lead to non-reproducable failures though. I think it is better
> to use a fixed value so that you're more likely to be able to reproduce
> the issue every time you run the tests.

We've tested libguestfs for years with:

random_val="$(awk 'BEGIN{srand(); print 1+int(255*rand())}' < /dev/null)"
export MALLOC_PERTURB_=$random_val

and have never seen a non-reproducable failure caused by this.

It has, however, caught some simple memory failures, although valgrind
is a lot better if you can afford to run it.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW

Reply via email to