From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:48741) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOrc3-00011R-OJ for qemu-devel@nongnu.org; Thu, 18 Oct 2012 11:02:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TOrbu-0004A9-0H for qemu-devel@nongnu.org; Thu, 18 Oct 2012 11:02:19 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:64274) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOrbt-00049u-Bp for qemu-devel@nongnu.org; Thu, 18 Oct 2012 11:02:09 -0400 Received: by mail-pb0-f45.google.com with SMTP id rp2so8503952pbb.4 for ; Thu, 18 Oct 2012 08:02:08 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <508019E6.7070807@redhat.com> Date: Thu, 18 Oct 2012 17:01:58 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1350570527-24187-1-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1350570527-24187-1-git-send-email-peter.maydell@linaro.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] ui/vnc-jobs: Delete unused and buggy vnc_stop_worker_thread() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Corentin Chary , qemu-devel@nongnu.org, patches@linaro.org Il 18/10/2012 16:28, Peter Maydell ha scritto: > The function vnc_stop_worker_thread() is buggy, beacuse it tries to > delete jobs from the worker thread's queue but the worker thread itself > will not cope with this happening (it would end up trying to remove > an already-removed list item from its queue list). Fortunately > nobody ever calls vnc_stop_worker_thread(), so we can fix this by > simply deleting all the untested racy code. Note that there is just one queue. The queue global == the arg argument of vnc_worker_thread == the queue argument of vnc_worker_thread_loop. So I'm not sure I follow your reasoning. So the bug may be that we never call vnc_stop_worker_thread from vnc_disconnect_finish. BTW vnc_jobs_join is called there so we could just assert that the queue is empty... Paolo > Signed-off-by: Peter Maydell > --- > Seems the easiest way to deal with this bug spotted via code > inspection :-)