From patchwork Fri Nov 26 15:22:15 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Chary X-Patchwork-Id: 73191 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D29D6B70D5 for ; Sat, 27 Nov 2010 02:22:42 +1100 (EST) Received: from localhost ([127.0.0.1]:51879 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PM08F-0007AW-Vc for incoming@patchwork.ozlabs.org; Fri, 26 Nov 2010 10:22:40 -0500 Received: from [140.186.70.92] (port=44559 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PM07N-00078p-HE for qemu-devel@nongnu.org; Fri, 26 Nov 2010 10:21:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PM07J-0001SJ-RH for qemu-devel@nongnu.org; Fri, 26 Nov 2010 10:21:45 -0500 Received: from smtp5-g21.free.fr ([212.27.42.5]:59780) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PM07J-0001QK-5k for qemu-devel@nongnu.org; Fri, 26 Nov 2010 10:21:41 -0500 Received: from localhost.localdomain (unknown [82.241.209.44]) by smtp5-g21.free.fr (Postfix) with ESMTP id 0ACEAD4807F; Fri, 26 Nov 2010 16:21:33 +0100 (CET) From: Corentin Chary To: Anthony Liguori Date: Fri, 26 Nov 2010 16:22:15 +0100 Message-Id: <1290784935-27258-1-git-send-email-corentincj@iksaif.net> X-Mailer: git-send-email 1.7.3.2 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: Corentin Chary , QEMU-devel Developers Subject: [Qemu-devel] [PATCH] vnc: qemu can die if the client is disconnected while updating screen X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org agraf reported that qemu_mutex_destroy(vs->output_mutex) was failing in vnc_disconnect_finish() when the vnc client was disconnected while updating the screen. 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; }