Received: from [140.186.70.92] (port=49253 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PlGen-0003dJ-Ea for qemu-devel@nongnu.org; Fri, 04 Feb 2011 03:04:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PlGel-0001fn-OT for qemu-devel@nongnu.org; Fri, 04 Feb 2011 03:04:41 -0500 Received: from smtp5-g21.free.fr ([212.27.42.5]:50947) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PlGel-0001fR-4n for qemu-devel@nongnu.org; Fri, 04 Feb 2011 03:04:39 -0500 From: Corentin Chary Date: Fri, 4 Feb 2011 09:05:53 +0100 Message-Id: <1296806768-27787-2-git-send-email-corentincj@iksaif.net> In-Reply-To: <1296806768-27787-1-git-send-email-corentincj@iksaif.net> References: <1296806768-27787-1-git-send-email-corentincj@iksaif.net> Subject: [Qemu-devel] [PATCH v3 01/16] vnc: qemu can die if the client is disconnected while updating screen List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Corentin Chary , Andre Przywara , Qemu-development List , Alexander Graf 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 --- 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; } -- 1.7.3.4