qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] tests: set MALLOC_PERTURB_ to expose memory bug


From: Richard W.M. Jones
Subject: Re: [Qemu-devel] [PATCH] tests: set MALLOC_PERTURB_ to expose memory bugs
Date: Sun, 19 May 2013 17:51:24 +0100
User-agent: Mutt/1.5.20 (2009-12-10)

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

[Prev in Thread] Current Thread [Next in Thread]