diff mbox

[v3,01/16] vnc: qemu can die if the client is disconnected while updating screen

Message ID 1296806768-27787-2-git-send-email-corentincj@iksaif.net
State New
Headers show

Commit Message

Corentin Chary Feb. 4, 2011, 8:05 a.m. UTC
agraf reported that qemu_mutex_destroy(vs->output_mutex) while failing
in vnc_disconnect_finish().

It's because vnc_worker_thread_loop() tries to unlock the mutex while
not locked. The unlocking call doesn't fail (pthread bug ?), but
the destroy call does.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
---
 ui/vnc-jobs-async.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

Comments

Anthony Liguori Feb. 4, 2011, 12:51 p.m. UTC | #1
On 02/04/2011 02:05 AM, Corentin Chary wrote:
> agraf reported that qemu_mutex_destroy(vs->output_mutex) while failing
> in vnc_disconnect_finish().
>
> It's because vnc_worker_thread_loop() tries to unlock the mutex while
> not locked. The unlocking call doesn't fail (pthread bug ?), but
> the destroy call does.
>
> Signed-off-by: Corentin Chary<corentincj@iksaif.net>
>    

Applied (just this patch) to master, Thanks.

Regards,

Anthony Liguori

> ---
>   ui/vnc-jobs-async.c |    4 ++++
>   1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/ui/vnc-jobs-async.c b/ui/vnc-jobs-async.c
> index 6e9cf08..0b5d750 100644
> --- a/ui/vnc-jobs-async.c
> +++ b/ui/vnc-jobs-async.c
> @@ -227,6 +227,10 @@ static int vnc_worker_thread_loop(VncJobQueue *queue)
>
>           if (job->vs->csock == -1) {
>               vnc_unlock_display(job->vs->vd);
> +            /* output mutex must be locked before going to
> +             * disconnected:
> +             */
> +            vnc_lock_output(job->vs);
>               goto disconnected;
>           }
>
>
Alexander Graf Feb. 7, 2011, 4:38 p.m. UTC | #2
On 04.02.2011, at 13:51, Anthony Liguori wrote:

> On 02/04/2011 02:05 AM, Corentin Chary wrote:
>> agraf reported that qemu_mutex_destroy(vs->output_mutex) while failing
>> in vnc_disconnect_finish().
>> 
>> It's because vnc_worker_thread_loop() tries to unlock the mutex while
>> not locked. The unlocking call doesn't fail (pthread bug ?), but
>> the destroy call does.
>> 
>> Signed-off-by: Corentin Chary<corentincj@iksaif.net>
>>   
> 
> Applied (just this patch) to master, Thanks.

What about the others?


Alex
Anthony Liguori Feb. 23, 2011, 11:23 p.m. UTC | #3
On 02/04/2011 02:05 AM, Corentin Chary wrote:
> agraf reported that qemu_mutex_destroy(vs->output_mutex) while failing
> in vnc_disconnect_finish().
>
> It's because vnc_worker_thread_loop() tries to unlock the mutex while
> not locked. The unlocking call doesn't fail (pthread bug ?), but
> the destroy call does.
>
> Signed-off-by: Corentin Chary<corentincj@iksaif.net>
>    

Applied 2/16.  Thanks!

Regards,

Anthony Liguori

> ---
>   ui/vnc-jobs-async.c |    4 ++++
>   1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/ui/vnc-jobs-async.c b/ui/vnc-jobs-async.c
> index 6e9cf08..0b5d750 100644
> --- a/ui/vnc-jobs-async.c
> +++ b/ui/vnc-jobs-async.c
> @@ -227,6 +227,10 @@ static int vnc_worker_thread_loop(VncJobQueue *queue)
>
>           if (job->vs->csock == -1) {
>               vnc_unlock_display(job->vs->vd);
> +            /* output mutex must be locked before going to
> +             * disconnected:
> +             */
> +            vnc_lock_output(job->vs);
>               goto disconnected;
>           }
>
>
Corentin Chary Feb. 25, 2011, 10:10 a.m. UTC | #4
On Wed, Feb 23, 2011 at 11:23 PM, Anthony Liguori
<aliguori@linux.vnet.ibm.com> wrote:
> On 02/04/2011 02:05 AM, Corentin Chary wrote:
>>
>> agraf reported that qemu_mutex_destroy(vs->output_mutex) while failing
>> in vnc_disconnect_finish().
>>
>> It's because vnc_worker_thread_loop() tries to unlock the mutex while
>> not locked. The unlocking call doesn't fail (pthread bug ?), but
>> the destroy call does.
>>
>> Signed-off-by: Corentin Chary<corentincj@iksaif.net>
>>
>
> Applied 2/16.  Thanks!
>
> Regards,
>
> Anthony Liguori

Great, Thanks !

Please also merge these two patchs:
http://patchwork.ozlabs.org/patch/84517/
http://patchwork.ozlabs.org/patch/84496/
diff mbox

Patch

diff --git a/ui/vnc-jobs-async.c b/ui/vnc-jobs-async.c
index 6e9cf08..0b5d750 100644
--- a/ui/vnc-jobs-async.c
+++ b/ui/vnc-jobs-async.c
@@ -227,6 +227,10 @@  static int vnc_worker_thread_loop(VncJobQueue *queue)
 
         if (job->vs->csock == -1) {
             vnc_unlock_display(job->vs->vd);
+            /* output mutex must be locked before going to
+             * disconnected:
+             */
+            vnc_lock_output(job->vs);
             goto disconnected;
         }