From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:39447) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uf9vq-0003XG-TM for qemu-devel@nongnu.org; Wed, 22 May 2013 10:22:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uf9vg-0005Xc-RQ for qemu-devel@nongnu.org; Wed, 22 May 2013 10:22:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39531) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uf9vg-0005XE-EB for qemu-devel@nongnu.org; Wed, 22 May 2013 10:22:12 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r4MEMAUQ020783 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 22 May 2013 10:22:10 -0400 Message-ID: <519CD491.5000907@redhat.com> Date: Wed, 22 May 2013 08:22:09 -0600 From: Eric Blake MIME-Version: 1.0 References: <1369210609-24023-1-git-send-email-stefanha@redhat.com> In-Reply-To: <1369210609-24023-1-git-send-email-stefanha@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2WVBNVKRUTSVQGANPCQGW" Subject: Re: [Qemu-devel] [PATCH v3] tests: set MALLOC_PERTURB_ to expose memory bugs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: lmr@redhat.com, qemu-devel@nongnu.org, Markus Armbruster This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2WVBNVKRUTSVQGANPCQGW Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 05/22/2013 02:16 AM, Stefan Hajnoczi wrote: > glibc wipes malloc(3) memory when the MALLOC_PERTURB_ environment > variable is set. The value of the environment variable determines the > bit pattern used to wipe memory. For more information, see > http://udrepper.livejournal.com/11429.html. >=20 > Set MALLOC_PERTURB_ for gtester and qemu-iotests. Note we pick a rando= m > value from 1 to 255 to expose more bugs. If you need to reproduce a > crash use 'show environment' in gdb to extract the MALLOC_PERTURB_ > value from a core dump. >=20 > Both make check and qemu-iotests pass with MALLOC_PERTURB_ enabled. >=20 > Signed-off-by: Stefan Hajnoczi > --- > v3: > * Use $ escaping in tests/Makefile [eblake] That was one of my comments, but you missed the other: > +++ b/tests/Makefile > @@ -171,6 +171,7 @@ GCOV_OPTIONS =3D -n $(if $(V),-f,) > $(patsubst %, check-qtest-%, $(QTEST_TARGETS)): check-qtest-%: $(check= -qtest-y) > $(if $(CONFIG_GCOV),@rm -f *.gcda */*.gcda */*/*.gcda */*/*/*.gcda,) > $(call quiet-command,QTEST_QEMU_BINARY=3D$*-softmmu/qemu-system-$* \ > + MALLOC_PERTURB_=3D$${MALLOC_PERTURB_:-$$(($$RANDOM % 255 + 1))} \ This is broken if /bin/sh is dash. s/\$\$RANDOM/RANDOM/ > gtester $(GTESTER_OPTIONS) -m=3D$(SPEED) $(check-qtest-$*-y),"GTESTE= R $@") > $(if $(CONFIG_GCOV),@for f in $(gcov-files-$*-y); do \ > echo Gcov report for $$f:;\ > @@ -180,7 +181,9 @@ $(patsubst %, check-qtest-%, $(QTEST_TARGETS)): che= ck-qtest-%: $(check-qtest-y) > .PHONY: $(patsubst %, check-%, $(check-unit-y)) > $(patsubst %, check-%, $(check-unit-y)): check-%: % > $(if $(CONFIG_GCOV),@rm -f *.gcda */*.gcda */*/*.gcda */*/*/*.gcda,) > - $(call quiet-command,gtester $(GTESTER_OPTIONS) -m=3D$(SPEED) $*,"GTE= STER $*") > + $(call quiet-command, \ > + MALLOC_PERTURB_=3D$${MALLOC_PERTURB_:-$$(($$RANDOM % 255 + 1))} \ Same problem on dash, same fix is needed. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2WVBNVKRUTSVQGANPCQGW Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJRnNSRAAoJEKeha0olJ0NqPO4H/0DokoV8qPQBEewCvHHwV4w8 jOJA7E6Y2vN9uTGK5f8LJmhzXcItExYPltTKDT4sedKnyeO0DSsWteikfcEhyxaX 28JE4mpZ1xQTCYzZbzqGMtAfoiS4yX6t8GEcUZXKvsxaGVl/M8/AwFIsiK0q+YXV 2/a52OkcBdJQOj1m9i5y5TeU9ykHyBASwiLNKimAOm/cp+l9zctC6IHNEJ+rjqaV l3CjlMZ03VtbvPMm/Umkj1P1qwQ5XmnxXHIOfYuPqhcmRAQhO0OzRdBJkKNRHFvg Z+oomDRzbhDe/xrVy674eqUCgU5iQ9iKBcrUEbNMwZBuS4cv9QXwvcPCnTwhj68= =16XZ -----END PGP SIGNATURE----- ------enig2WVBNVKRUTSVQGANPCQGW--