Received: from eggs.gnu.org ([2001:4830:134:3::10]:56980) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bT7xz-00066u-SY for qemu-devel@nongnu.org; Fri, 29 Jul 2016 09:36:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bT7xt-0003QE-Kz for qemu-devel@nongnu.org; Fri, 29 Jul 2016 09:36:42 -0400 Received: from mx2.suse.de ([195.135.220.15]:58019) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bT7xt-0003Pv-DJ for qemu-devel@nongnu.org; Fri, 29 Jul 2016 09:36:37 -0400 References: <937d1786-8e61-b7be-793b-914e9a6cb5f3@suse.com> From: Juergen Gross Message-ID: <66d67f6e-a4d9-d250-1c02-1d9af32cdd1f@suse.com> Date: Fri, 29 Jul 2016 15:36:36 +0200 MIME-Version: 1.0 In-Reply-To: <937d1786-8e61-b7be-793b-914e9a6cb5f3@suse.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] bug in usb_bus_release() ? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "qemu-devel@nongnu.org" Cc: Gerd Hoffmann On 27/07/16 16:56, Juergen Gross wrote: > I can reproduce a problem in qemu with Xen just by adding and removing a > USB bus. The bus is added via usb_bus_new() in hw/usb/xen-usb.c and > removed later via usb_bus_release(). > > Nothing bad happens until I close an active VNC viewer connected to the > graphical console emulated by the same qemu process. In the log file I > see "*** Error in `/usr/lib/xen/bin/qemu-system-i386': corrupted double- > linked list: 0x000055b236bd56b0 ***" and the qemu process will hang. > > Looking into the sources I suspected a missing > > object_unparent(OBJECT(&usbif->bus)); > > after calling usb_bus_release(&usbif->bus) to be the culprit, but > adding this call didn't help (shouldn't this be called from > usb_bus_release() instead?) > > I suspect something else is missing in qemu for removing a USB bus > without leaking resources, but I couldn't find anything up to now. Does > anyone have an idea what could be wrong? Okay, problem solved. The bug was completely unrelated to usb_bus_release(). It was just always triggered just after that call. The problem was in Xen backend handling releasing more memory than desired. Patch already sent out. Juergen