qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH for-4.0 v9 16/16] qemu_thread_join: fix segmenta


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH for-4.0 v9 16/16] qemu_thread_join: fix segmentation fault
Date: Tue, 08 Jan 2019 18:29:47 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

fei <address@hidden> writes:

>> 在 2019年1月8日,01:55,Markus Armbruster <address@hidden> 写道:
>> 
>> Fei Li <address@hidden> writes:
>> 
>>> To avoid the segmentation fault in qemu_thread_join(), just directly
>>> return when the QemuThread *thread failed to be created in either
>>> qemu-thread-posix.c or qemu-thread-win32.c.
>>> 
>>> Cc: Stefan Weil <address@hidden>
>>> Signed-off-by: Fei Li <address@hidden>
>>> Reviewed-by: Fam Zheng <address@hidden>
>>> ---
>>> util/qemu-thread-posix.c | 3 +++
>>> util/qemu-thread-win32.c | 2 +-
>>> 2 files changed, 4 insertions(+), 1 deletion(-)
>>> 
>>> diff --git a/util/qemu-thread-posix.c b/util/qemu-thread-posix.c
>>> index 39834b0551..3548935dac 100644
>>> --- a/util/qemu-thread-posix.c
>>> +++ b/util/qemu-thread-posix.c
>>> @@ -571,6 +571,9 @@ void *qemu_thread_join(QemuThread *thread)
>>>     int err;
>>>     void *ret;
>>> 
>>> +    if (!thread->thread) {
>>> +        return NULL;
>>> +    }
>> 
>> How can this happen?
> I think I have answered this earlier, please check the following link to see 
> whether it helps:
> http://lists.nongnu.org/archive/html/qemu-devel/2018-11/msg06554.html

Thanks for the pointer.  Unfortunately, I don't understand your
explanation.  You also wrote there "I will remove this patch in next
version"; looks like you've since changed your mind.

What exactly breaks if we omit this patch?  Assuming something does
break: imagine we did omit this patch, then forgot we ever saw it, and
now you've discovered the breakage.  Write us the bug report, complete
with reproducer.

[...]



reply via email to

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