[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 0/2] Produce better termination message
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH v3 0/2] Produce better termination message |
Date: |
Mon, 26 Sep 2016 11:07:34 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 |
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
- [Qemu-devel] [PATCH v3 0/2] Produce better termination message, Michal Privoznik, 2016/09/21
- [Qemu-devel] [PATCH v3 1/2] util: Introduce qemu_get_pid_name, Michal Privoznik, 2016/09/21
- [Qemu-devel] [PATCH v3 2/2] qemu_kill_report: Report PID name too, Michal Privoznik, 2016/09/21
- Re: [Qemu-devel] [PATCH v3 0/2] Produce better termination message, no-reply, 2016/09/21
- Re: [Qemu-devel] [PATCH v3 0/2] Produce better termination message, no-reply, 2016/09/21
- Re: [Qemu-devel] [PATCH v3 0/2] Produce better termination message, Paolo Bonzini, 2016/09/22