qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 2/1] libqtest: add more exit status checks


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH v2 2/1] libqtest: add more exit status checks
Date: Fri, 25 May 2018 07:40:43 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

"Michael S. Tsirkin" <address@hidden> writes:

> On Thu, May 24, 2018 at 01:16:24PM -0500, Eric Blake wrote:
>> On 05/24/2018 11:01 AM, Michael S. Tsirkin wrote:
>> > On Thu, May 24, 2018 at 11:00:19AM -0500, Eric Blake wrote:
>> > > On 05/24/2018 10:52 AM, Eric Blake wrote:
>> > > 
>> > > > Also, since waitpid() can only return either s->qemu_pid or -1 as we
>> > > > aren't using WNOHANG, it may also be worth asserting that if pid == -1,
>> > > > we either have EAGAIN (but why aren't we looping in that case?) or
>> > > > ECHILD.
>> > > 
>> > > I meant EINTR, not EAGAIN.  But in general, using waitpid() to collect
>> > > process status without doing it in a loop is risky.
>> > 
>> > Interesting. Risky how?
>> 
>> If your process has any signal handler installed, then an EINTR failure
>> means you interpret a transient failure to grab process status (because your
>> check was interrupted by something else) as a permanent failure, unless you
>> go back to another waitpid() in a loop.
>
> I don't think we have a handler installed, though.

That's a nasty assumption to make for a library.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]