From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38710) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQiyw-0004IZ-0u for qemu-devel@nongnu.org; Tue, 02 Feb 2016 16:59:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aQiyv-0001H0-0i for qemu-devel@nongnu.org; Tue, 02 Feb 2016 16:59:29 -0500 References: <56B10B86.4020505@redhat.com> From: Eric Blake Message-ID: <56B126B6.3070701@redhat.com> Date: Tue, 2 Feb 2016 14:59:18 -0700 MIME-Version: 1.0 In-Reply-To: <56B10B86.4020505@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="cj2lGRKNv8mTcpH7M29AOG4w4n5Sb1ups" Subject: Re: [Qemu-devel] iotest 013 failure under clang -fsanitize=undefined List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow , Qemu-block Cc: Kevin Wolf , Paolo Bonzini , Laszlo Ersek , qemu-devel , Peter Maydell This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --cj2lGRKNv8mTcpH7M29AOG4w4n5Sb1ups Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 02/02/2016 01:03 PM, John Snow wrote: > The problem is that in the print report for read_f, t2 and t1 can > actually be the same exact timestamp, and tdiv will try to divide by 0.= 0. >=20 > Normally this is not a problem as this is defined to be INFINITY in C99= > Annex F. >=20 > Clang, however, has once again decided to take the pedantic road and > state that Annex F is optional, and therefore division by 0.0 is > actually undefined when using -fsanitize=3Dundefined. >=20 > Groan. No kidding. :( A compiler ceases to be useful when it spews out noise "just because it can". >=20 > Two workarounds: >=20 > (1) Modify the tdiv() function to just return INFINITY manually if the > timestamp provided is 0 Seems reasonable to me. > https://github.com/jnsnow/qemu/commit/af93977dd2bc7ea936b8064c41c5a0f9d= 25ae2d1 I'd be okay with this patch, if you want to make it a formal submission, and if no one else chimes in with any opinion other than disgust at clang's shenanigans. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --cj2lGRKNv8mTcpH7M29AOG4w4n5Sb1ups Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWsSa2AAoJEKeha0olJ0NqLicIAJ2B9tc/g46aP503vRkpBAoZ pdUSCYvR1hEzOj2Fd5q/JlTwchNaX/MiDKGA6blayknyhD/HD0BHveMtZHatwnfN 9PlLcsrqoPgtEOnAUWqIKMZ8UjqdWzXI3FKHPlbBZaBQTb0tagFyJB1kgG5WJmZZ dcmti7BFNjlkc36+hlW5JX5oY+YzKTYnZuc6FHBQwq9cozABrVueQWEoKDrbMusY VGUGsmPjSte0htz/IyJbrEfrn5hl/Z83Zezh9HiZo+F+Ebd1fU35qA8mmhTFPOP3 utPGxaeIySpkvMEYXvbmCqIg8riZUcndS+mywXJIBJVIoOyIKzOiE34O8ASD5hk= =lHua -----END PGP SIGNATURE----- --cj2lGRKNv8mTcpH7M29AOG4w4n5Sb1ups--