From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:51223) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ue6pa-0001Yq-4M for qemu-devel@nongnu.org; Sun, 19 May 2013 12:51:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ue6pV-00014E-Ax for qemu-devel@nongnu.org; Sun, 19 May 2013 12:51:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:15516) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ue6pV-000149-3D for qemu-devel@nongnu.org; Sun, 19 May 2013 12:51:29 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r4JGpSdd028498 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 19 May 2013 12:51:28 -0400 Date: Sun, 19 May 2013 17:51:24 +0100 From: "Richard W.M. Jones" Message-ID: <20130519165124.GB18311@redhat.com> References: <1368780720-14852-1-git-send-email-stefanha@redhat.com> <87obcaaq4b.fsf@blackfin.pond.sub.org> <20130517100738.GF2342@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130517100738.GF2342@redhat.com> Subject: Re: [Qemu-devel] [PATCH] tests: set MALLOC_PERTURB_ to expose memory bugs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" Cc: Lucas Meneghel Rodrigues , Markus Armbruster , Stefan Hajnoczi , qemu-devel@nongnu.org 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