All of lore.kernel.org
 help / color / mirror / Atom feed
From: qemu_oss--- via <qemu-devel@nongnu.org>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Stefan Weil" <sw@weilnetz.de>,
	"Roman Bolshakov" <r.bolshakov@yadro.com>,
	"Alexander Graf" <agraf@csgraf.de>
Subject: Re: macOS (Big Sur, Apple Silicon) 'make check' fails in test-crypto-tlscredsx509
Date: Tue, 02 Feb 2021 17:35:49 +0100	[thread overview]
Message-ID: <4581723.kQ5iP5sz2Z@silver> (raw)
In-Reply-To: <6d360ded-f8b6-d08b-b4fc-af8c52554a58@redhat.com>

On Dienstag, 2. Februar 2021 15:50:24 CET Eric Blake wrote:
> > If the program is compiled with -O0/O1 it returns zero exit code.
> > Here's the output:
> > IO
> > func1:16 foo: 0x0 counter 10
> > func2:4 foo: 0xa
> > good
> > 
> > If it is compiled with -O2 it returns 1:
> > IO
> > func1:16 foo: 0x0 counter 10
> > func2:4 foo: 0xa
> > func2:6 foo: 0x0
> 
> And this proves the point that the compiler was able to exploit the
> undefined behavior in your program.
> 
> > broken
> > 
> > That happens because clang uses register behind foo from func1 (it has
> > zero
> > pointer) inside inlined func2 (it should have non zero pointer).
> > 
> > So, immediate workaround would be to downgrade optimization level of
> > libtasn1 to -O1 in homebrew.
> > 
> > I've submitted the issue to Apple bugtracker:
> > FB8986815
> 
> Yes, it's annoying that as compilers get smarter, it exposes the
> presence of unspecified code in weird ways.  But I don't see this as a
> bug in clang, but as a bug in libtasn1 for assuming undefined behavior
> produces a sane result.

You are right Eric, but nevertheless it's a very aggressive behaviour change 
being introduced way too silent, especially regarding backward compatibility 
like this case proofs.

Personally I find the new semantic NULL + n == NULL makes sense, as it adds 
safety, but I do consider it a bug that clang did not even throw a warning. 
Even when I add -Wnull-pointer-arithmetic it does not complain to me at all.

Best regards,
Christian Schoenebeck




  reply	other threads:[~2021-02-02 17:16 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-26 16:32 macOS (Big Sur, Apple Silicon) 'make check' fails in test-crypto-tlscredsx509 Peter Maydell
2021-01-26 16:36 ` Daniel P. Berrangé
2021-01-26 16:41   ` Peter Maydell
2021-01-27 12:17     ` Daniel P. Berrangé
2021-01-27 12:35       ` Christian Schoenebeck
2021-01-27 12:38         ` Daniel P. Berrangé
2021-01-27 16:44       ` Stefan Weil
2021-01-27 16:53         ` Daniel P. Berrangé
2021-01-27 17:05           ` Stefan Weil
2021-01-27 18:17             ` Daniel P. Berrangé
2021-01-27 18:56               ` Stefan Weil
2021-01-27 18:59                 ` Daniel P. Berrangé
2021-01-27 19:42                   ` Stefan Weil
2021-01-27 20:57                     ` Stefan Weil
2021-01-29  8:43                   ` Roman Bolshakov
2021-01-29  9:53                     ` Daniel P. Berrangé
2021-02-02  5:19                       ` Roman Bolshakov
2021-02-02 14:19                         ` qemu_oss--- via
2021-02-02 14:50                         ` Eric Blake
2021-02-02 16:35                           ` qemu_oss--- via [this message]
2021-02-02 17:14                             ` Eric Blake
2021-02-02 20:31                               ` Stefan Weil
2021-02-02 20:50                                 ` Stefan Weil
2021-02-03 10:00                                   ` Daniel P. Berrangé
2021-02-02 16:50                           ` Daniel P. Berrangé
2021-02-03 14:28                           ` Roman Bolshakov
2021-02-02  5:46 ` 罗勇刚(Yonggang Luo)

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=4581723.kQ5iP5sz2Z@silver \
    --to=qemu-devel@nongnu.org \
    --cc=agraf@csgraf.de \
    --cc=berrange@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu_oss@crudebyte.com \
    --cc=r.bolshakov@yadro.com \
    --cc=sw@weilnetz.de \
    /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.