From: Eric Blake <eblake@redhat.com>
To: John Snow <jsnow@redhat.com>, Qemu-block <qemu-block@nongnu.org>
Cc: Kevin Wolf <kwolf@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Laszlo Ersek <lersek@redhat.com>,
qemu-devel <qemu-devel@nongnu.org>,
Peter Maydell <peter.maydell@linaro.org>
Subject: Re: [Qemu-devel] iotest 013 failure under clang -fsanitize=undefined
Date: Tue, 2 Feb 2016 14:59:18 -0700 [thread overview]
Message-ID: <56B126B6.3070701@redhat.com> (raw)
In-Reply-To: <56B10B86.4020505@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1114 bytes --]
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.
>
> Normally this is not a problem as this is defined to be INFINITY in C99
> Annex F.
>
> 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=undefined.
>
> Groan.
No kidding. :(
A compiler ceases to be useful when it spews out noise "just because it
can".
>
> Two workarounds:
>
> (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/af93977dd2bc7ea936b8064c41c5a0f9d25ae2d1
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.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2016-02-02 21:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-02 20:03 [Qemu-devel] iotest 013 failure under clang -fsanitize=undefined John Snow
2016-02-02 21:47 ` Laszlo Ersek
2016-02-02 22:00 ` John Snow
2016-02-02 22:13 ` Laszlo Ersek
2016-02-03 7:19 ` Markus Armbruster
2016-02-02 21:59 ` Eric Blake [this message]
2016-02-02 22:16 ` Paolo Bonzini
2016-02-03 7:21 ` Markus Armbruster
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=56B126B6.3070701@redhat.com \
--to=eblake@redhat.com \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=lersek@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).