From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: Endless loop in qcow2_alloc_cluster_offset Date: Mon, 07 Dec 2009 15:50:00 +0100 Message-ID: <4B1D1618.2080900@siemens.com> References: <4B0537EB.4000909@siemens.com> <4B055AEF.4030406@redhat.com> <4B055D32.3040601@siemens.com> <4B1D0E34.6070907@siemens.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit To: Kevin Wolf , qemu-devel , kvm Return-path: Received: from david.siemens.de ([192.35.17.14]:24869 "EHLO david.siemens.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932471AbZLGOuP (ORCPT ); Mon, 7 Dec 2009 09:50:15 -0500 In-Reply-To: <4B1D0E34.6070907@siemens.com> Sender: kvm-owner@vger.kernel.org List-ID: Jan Kiszka wrote: > And now it happened again (qemu-kvm head, during kernel installation > from network onto local qcow2-disk). Any clever idea how to proceed with > this? > > I could try to run the step in a loop, hopefully retriggering it once in > a (likely longer) while. But then we need some good instrumentation first. > Maybe I'm seeing ghosts, and I don't even have a minimal clue about what goes on in the code, but this looks fishy: preallocate() invokes qcow2_alloc_cluster_offset() passing &meta, a stack variable. It seems that qcow2_alloc_cluster_offset() may insert this structure into cluster_allocs and leave it there. So we corrupt the queue as soon as preallocate() returns, no? Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NHeuf-0000Sk-Ug for qemu-devel@nongnu.org; Mon, 07 Dec 2009 09:50:10 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NHeua-0000M5-N8 for qemu-devel@nongnu.org; Mon, 07 Dec 2009 09:50:08 -0500 Received: from [199.232.76.173] (port=34675 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHeua-0000Lm-Gy for qemu-devel@nongnu.org; Mon, 07 Dec 2009 09:50:04 -0500 Received: from david.siemens.de ([192.35.17.14]:24775) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NHeua-0005Je-AG for qemu-devel@nongnu.org; Mon, 07 Dec 2009 09:50:04 -0500 Message-ID: <4B1D1618.2080900@siemens.com> Date: Mon, 07 Dec 2009 15:50:00 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <4B0537EB.4000909@siemens.com> <4B055AEF.4030406@redhat.com> <4B055D32.3040601@siemens.com> <4B1D0E34.6070907@siemens.com> In-Reply-To: <4B1D0E34.6070907@siemens.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: Endless loop in qcow2_alloc_cluster_offset List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , qemu-devel , kvm Jan Kiszka wrote: > And now it happened again (qemu-kvm head, during kernel installation > from network onto local qcow2-disk). Any clever idea how to proceed with > this? > > I could try to run the step in a loop, hopefully retriggering it once in > a (likely longer) while. But then we need some good instrumentation first. > Maybe I'm seeing ghosts, and I don't even have a minimal clue about what goes on in the code, but this looks fishy: preallocate() invokes qcow2_alloc_cluster_offset() passing &meta, a stack variable. It seems that qcow2_alloc_cluster_offset() may insert this structure into cluster_allocs and leave it there. So we corrupt the queue as soon as preallocate() returns, no? Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux