All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Markus Armbruster <armbru@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	qemu-devel@nongnu.org, Anthony Liguori <aliguori@amazon.com>,
	Laszlo Ersek <lersek@redhat.com>,
	Andreas Faerber <afaerber@suse.de>
Subject: Re: [Qemu-devel] [PATCH 3/3] qtest: kill QEMU process on g_assert() failure
Date: Mon, 17 Feb 2014 17:56:16 +0100	[thread overview]
Message-ID: <53023F30.4080701@redhat.com> (raw)
In-Reply-To: <878ut9u1k4.fsf@blackfin.pond.sub.org>

Il 17/02/2014 17:49, Markus Armbruster ha scritto:
> Assumes zero-initialization has the same effect as
> sigemptyset(&sigact.sa_mask).  Quoting POSIX:
>
>     The implementation of the sigemptyset() (or sigfillset()) function
>     could quite trivially clear (or set) all the bits in the signal set.
>     Alternatively, it would be reasonable to initialize part of the
>     structure, such as a version field, to permit binary-compatibility
>     between releases where the size of the set varies.  For such
>     reasons, either sigemptyset() or sigfillset() must be called prior
>     to any other use of the signal set, even if such use is read-only
>     (for example, as an argument to sigpending()).
>
> Looks like you better sigemptyset() here, for maximum portability.
>

Certainly memset of struct sigaction or sigset_t * is common enough that 
no one in their right minds would do this.  Is there really an OS that 
does it?  Also, the above justification is quite feeble; it would work 
for binary compatibility of sigset_t* arguments, but not for embedded 
sigset_t structs.  I'm CCing our resident POSIX experts in hope that 
this paragraph can be eliminated from the standard. :)

Related to this, there are a bunch of Coverity reports where we use 
uninitialized fields of a struct sigaction.

Paolo

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

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-17 15:44 [Qemu-devel] [PATCH 0/3] qtest: avoid pidfile and QEMU process leaks Stefan Hajnoczi
2014-02-17 15:44 ` [Qemu-devel] [PATCH 1/3] qtest: drop unused child_pid field Stefan Hajnoczi
2014-02-17 15:44 ` [Qemu-devel] [PATCH 2/3] qtest: make QEMU our direct child process Stefan Hajnoczi
2014-02-17 16:44   ` Markus Armbruster
2014-02-18  9:00     ` Stefan Hajnoczi
2014-02-18  9:53       ` Markus Armbruster
2014-02-17 15:44 ` [Qemu-devel] [PATCH 3/3] qtest: kill QEMU process on g_assert() failure Stefan Hajnoczi
2014-02-17 16:16   ` Paolo Bonzini
2014-02-17 17:00     ` Markus Armbruster
2014-02-18  9:05       ` Stefan Hajnoczi
2014-02-18 10:05         ` Markus Armbruster
2014-02-18 10:23           ` Paolo Bonzini
2014-02-18 10:43             ` Markus Armbruster
2014-02-18 14:38               ` Stefan Hajnoczi
2014-02-18 10:07         ` Paolo Bonzini
2014-02-18 10:17           ` Daniel P. Berrange
2014-02-18 10:23             ` Paolo Bonzini
2014-02-17 16:49   ` Markus Armbruster
2014-02-17 16:56     ` Paolo Bonzini [this message]
2014-02-18  9:17     ` Stefan Hajnoczi
2014-02-18  9:55       ` Markus Armbruster
2014-02-18 14:44         ` Stefan Hajnoczi
2014-02-18 14:56       ` Peter Maydell
2014-02-18 10:02     ` Markus Armbruster
2014-02-18 14:38       ` Stefan Hajnoczi
2014-02-18 14:52         ` 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=53023F30.4080701@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=afaerber@suse.de \
    --cc=aliguori@amazon.com \
    --cc=armbru@redhat.com \
    --cc=lersek@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /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.