qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Michal Privoznik <mprivozn@redhat.com>, qemu-devel@nongnu.org
Cc: armbru@redhat.com, peter.maydell@linaro.org
Subject: Re: [Qemu-devel] [PATCH v3 0/2] Produce better termination message
Date: Mon, 26 Sep 2016 11:07:34 +0200	[thread overview]
Message-ID: <353bd1d9-3b2f-0581-c56d-d56a18b9965f@redhat.com> (raw)
In-Reply-To: <155c94e1-29f2-d294-01e3-a78b394518f2@redhat.com>



On 26/09/2016 11:02, Michal Privoznik wrote:
> Huh, this has beacame more hairy than I initially thought. An
> alternative suggestion might be to not call PID->name translate function
> from the signal handler, but call it just from the qemu_kill_report().
> Yes, this will increase the chances of reporting incorrect process name,
> but there's no way to make this 100% correct. I mean even at the time
> that our signal callback is ran, the sender might be dead already and
> kernel might have spawn a different process under the same PID.
> Therefore I guess there's no real harm in doing the translation later.
> Moreover, if we want this to work on *BSD-s (where an libutil function
> is called which does malloc), then we must call the translate function
> from a safe place. On the other hand, malloc there could be reentrant.

Still extremely unlikely to be async-signal safe, so I guess calling it
from qemu_kill_report is better.

Thanks!

Paolo

      reply	other threads:[~2016-09-26  9:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-21 16:27 [Qemu-devel] [PATCH v3 0/2] Produce better termination message Michal Privoznik
2016-09-21 16:27 ` [Qemu-devel] [PATCH v3 1/2] util: Introduce qemu_get_pid_name Michal Privoznik
2016-09-21 16:32   ` Paolo Bonzini
2016-09-21 16:27 ` [Qemu-devel] [PATCH v3 2/2] qemu_kill_report: Report PID name too Michal Privoznik
2016-09-21 16:46 ` [Qemu-devel] [PATCH v3 0/2] Produce better termination message no-reply
2016-09-21 17:47 ` no-reply
2016-09-22 16:43 ` Paolo Bonzini
2016-09-26  9:02   ` Michal Privoznik
2016-09-26  9:07     ` Paolo Bonzini [this message]

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=353bd1d9-3b2f-0581-c56d-d56a18b9965f@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=armbru@redhat.com \
    --cc=mprivozn@redhat.com \
    --cc=peter.maydell@linaro.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).