Received: from eggs.gnu.org ([140.186.70.92]:38636) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RDWrw-0005H3-GK for qemu-devel@nongnu.org; Tue, 11 Oct 2011 03:35:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RDWrr-00065d-VE for qemu-devel@nongnu.org; Tue, 11 Oct 2011 03:35:20 -0400 Received: from mtagate7.uk.ibm.com ([194.196.100.167]:43871) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RDWrr-000657-ME for qemu-devel@nongnu.org; Tue, 11 Oct 2011 03:35:15 -0400 Received: from d06nrmr1507.portsmouth.uk.ibm.com (d06nrmr1507.portsmouth.uk.ibm.com [9.149.38.233]) by mtagate7.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p9B7ZDvV006977 for ; Tue, 11 Oct 2011 07:35:13 GMT Received: from d06av08.portsmouth.uk.ibm.com (d06av08.portsmouth.uk.ibm.com [9.149.37.249]) by d06nrmr1507.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p9B7ZCBv2412554 for ; Tue, 11 Oct 2011 08:35:13 +0100 Received: from d06av08.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p9B7ZCMD032229 for ; Tue, 11 Oct 2011 08:35:12 +0100 Date: Tue, 11 Oct 2011 09:35:11 +0200 From: Thomas Huth Message-ID: <20111011093511.03741ed6@BR8GGW75.de.ibm.com> In-Reply-To: <20111010150341.35f19e79@BR8GGW75.de.ibm.com> References: <20111010150341.35f19e79@BR8GGW75.de.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [BUG] USB assertion triggers in usb_packet_complete() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann Am Mon, 10 Oct 2011 15:03:41 +0200 schrieb Thomas Huth : > > I am currently facing a problem when running QEMU (up-to-date git > version) with OHCI and a lot of virtual USB devices. > The emulator dies with the following assertion: > > qemu-system-arm: hw/usb.c:337: usb_packet_complete: > Assertion `p->owner != ((void *)0)' failed. Not sure whether this is the right solution, but this patch fixes the problem for me: diff --git a/hw/usb.c b/hw/usb.c index fa90204..7cef9e2 100644 --- a/hw/usb.c +++ b/hw/usb.c @@ -25,6 +25,7 @@ */ #include "qemu-common.h" #include "usb.h" +#include "usb-desc.h" #include "iov.h" void usb_attach(USBPort *port) @@ -334,7 +335,9 @@ int usb_handle_packet(USBDevice *dev, USBPacket *p) void usb_packet_complete(USBDevice *dev, USBPacket *p) { /* Note: p->owner != dev is possible in case dev is a hub */ - assert(p->owner != NULL); + if (dev->device->bDeviceClass != USB_CLASS_HUB) { + assert(p->owner != NULL); + } p->owner = NULL; dev->port->ops->complete(dev->port, p); } Thomas