All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Richard W.M. Jones" <rjones@redhat.com>
To: "Daniel P. Berrange" <berrange@redhat.com>
Cc: Lucas Meneghel Rodrigues <lmr@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] tests: set MALLOC_PERTURB_ to expose memory bugs
Date: Sun, 19 May 2013 17:51:24 +0100	[thread overview]
Message-ID: <20130519165124.GB18311@redhat.com> (raw)
In-Reply-To: <20130517100738.GF2342@redhat.com>


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

  parent reply	other threads:[~2013-05-19 16:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-17  8:52 [Qemu-devel] [PATCH] tests: set MALLOC_PERTURB_ to expose memory bugs Stefan Hajnoczi
2013-05-17  9:54 ` Markus Armbruster
2013-05-17 10:07   ` Daniel P. Berrange
2013-05-17 10:58     ` Markus Armbruster
2013-05-17 12:52       ` Lucas Meneghel Rodrigues
2013-05-17 11:16     ` Stefan Hajnoczi
2013-05-17 12:49     ` Lucas Meneghel Rodrigues
2013-05-19 16:51     ` Richard W.M. Jones [this message]
2013-05-17 11:15   ` Stefan Hajnoczi
2013-05-17 12:50     ` Lucas Meneghel Rodrigues

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130519165124.GB18311@redhat.com \
    --to=rjones@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=lmr@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.