qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] iothread: Make iothread_stop() idempotent


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] iothread: Make iothread_stop() idempotent
Date: Fri, 29 Sep 2017 16:13:04 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0

On 29/09/2017 15:47, Christian Borntraeger wrote:
> Is anybody going to pick this up? upstream qemu is still happily filling
> up my disk with coredumps on exit.

I can, but I'll only send the pull request next Monday, probably.

Paolo

> On 09/26/2017 03:00 PM, Eduardo Habkost wrote:
>> Currently, iothread_stop_all() makes all iothread objects unsafe
>> to be destroyed, because qemu_thread_join() ends up being called
>> twice.
>>
>> To fix this, make iothread_stop() idempotent by checking
>> thread->stopped.
>>
>> Fixes the following crash:
>>
>>   qemu-system-x86_64 -object iothread,id=iothread0 -monitor stdio -display 
>> none
>>   QEMU 2.10.50 monitor - type 'help' for more information
>>   (qemu) quit
>>   qemu: qemu_thread_join: No such process
>>   Aborted (core dumped)
>>
>> Reported-by: Christian Borntraeger <address@hidden>
>> Signed-off-by: Eduardo Habkost <address@hidden>
>> ---
>>  iothread.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/iothread.c b/iothread.c
>> index 44c8944dc4..59d0850988 100644
>> --- a/iothread.c
>> +++ b/iothread.c
>> @@ -85,7 +85,7 @@ static int iothread_stop(Object *object, void *opaque)
>>      IOThread *iothread;
>>
>>      iothread = (IOThread *)object_dynamic_cast(object, TYPE_IOTHREAD);
>> -    if (!iothread || !iothread->ctx) {
>> +    if (!iothread || !iothread->ctx || iothread->stopping) {
>>          return 0;
>>      }
>>      iothread->stopping = true;
>>
> 




reply via email to

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