All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Jamie Lokier <jamie@shareable.org>
Cc: jcody@redhat.com, Luiz Capitulino <lcapitulino@redhat.com>,
	mdroth@linux.vnet.ibm.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/2] qemu-ga: Add the guest-suspend command
Date: Wed, 18 Jan 2012 12:13:42 -0700	[thread overview]
Message-ID: <4F1719E6.3050401@redhat.com> (raw)
In-Reply-To: <20120117105703.GG7180@jl-vm1.vm.bytemark.co.uk>

[-- Attachment #1: Type: text/plain, Size: 1472 bytes --]

On 01/17/2012 03:57 AM, Jamie Lokier wrote:
> You're right, but it looks like it may be removed in the next edition:
> 
>    https://www.opengroup.org/austin/docs/austin_446.txt
> 
>> it was only pthread_atfork() which was removed.
> 
> I didn't think pthread_atfork() ever was async-signal-safe.
> 
>> That is, fork() is _required_
>> to be async-signal-safe (and usable from signal handlers), provided that
>> the actions following the fork also follow safety rules.
> 
> Nonethless, Glibc fork() isn't async-signal-safe even if it should be:
> 
>     http://sourceware.org/bugzilla/show_bug.cgi?id=4737

Thanks for the (depressing) pointers.  You posted the link to the Austin
Group meeting where fork() was discusses; here's a further link to the
actual defect and resolution, which is that the next version of POSIX
_will_ be removing fork() from the list of async-signal-safe functions,
by replacing it with _Fork() which does _not_ call any of the
pthread_atfork() handlers:

http://austingroupbugs.net/view.php?id=62

You are right that the only reason that fork() is not signal-safe is
because of pthread_atfork(), so I was almost right in my above
characterization that pthread_atfork() was the culprit.  Maybe we should
start probing at configure time whether _Fork already exists, and if so,
use it instead of fork().

-- 
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: 620 bytes --]

  reply	other threads:[~2012-01-18 19:14 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-13 19:15 [Qemu-devel] [PATCH v5 0/2]: qemu-ga: Add the guest-suspend command Luiz Capitulino
2012-01-13 19:15 ` [Qemu-devel] [PATCH 1/2] qemu-ga: set O_NONBLOCK for serial channels Luiz Capitulino
2012-01-13 19:15 ` [Qemu-devel] [PATCH 2/2] qemu-ga: Add the guest-suspend command Luiz Capitulino
2012-01-13 21:48   ` Eric Blake
2012-01-16 10:51     ` Jamie Lokier
2012-01-16 15:59       ` Eric Blake
2012-01-17 10:57         ` Jamie Lokier
2012-01-18 19:13           ` Eric Blake [this message]
2012-01-16 15:46     ` Luiz Capitulino
2012-01-16 17:08     ` Luiz Capitulino
2012-01-16 17:13       ` Daniel P. Berrange
2012-01-16 17:18         ` Luiz Capitulino
2012-01-16 17:23           ` Luiz Capitulino
2012-01-16 20:02             ` Michael Roth
2012-01-16 20:35               ` Daniel P. Berrange
2012-01-16 22:06                 ` Michael Roth
2012-01-17 11:05                   ` Jamie Lokier
2012-01-16 20:08       ` Eric Blake
2012-01-16 20:19         ` Luiz Capitulino
2012-01-16 21:10           ` Eric Blake
  -- strict thread matches above, loose matches on Subject: below --
2012-01-17 13:27 [Qemu-devel] [PATCH v7 0/2]: " Luiz Capitulino
2012-01-17 13:27 ` [Qemu-devel] [PATCH 2/2] " Luiz Capitulino
2012-01-16 20:09 [Qemu-devel] [PATCH v6 0/2]: " Luiz Capitulino
2012-01-16 20:09 ` [Qemu-devel] [PATCH 2/2] " Luiz Capitulino
2012-01-16 21:06   ` Daniel P. Berrange
2012-01-17 12:18     ` Luiz Capitulino
2012-01-17 12:27       ` Daniel P. Berrange
2012-01-16 22:17   ` Michael Roth
2012-01-17 12:22     ` Luiz Capitulino
2012-01-04 19:45 [Qemu-devel] [PATCH v4 0/2]: " Luiz Capitulino
2012-01-04 19:45 ` [Qemu-devel] [PATCH 2/2] " Luiz Capitulino
2012-01-04 20:00   ` Michael Roth
2012-01-04 20:03   ` Eric Blake
2012-01-05 12:29     ` Luiz Capitulino
2012-01-05 12:46   ` Daniel P. Berrange
2012-01-05 12:58     ` Luiz Capitulino

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=4F1719E6.3050401@redhat.com \
    --to=eblake@redhat.com \
    --cc=jamie@shareable.org \
    --cc=jcody@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --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 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.