Received: from eggs.gnu.org ([2001:4830:134:3::10]:45057) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V74px-0003oi-1G for qemu-devel@nongnu.org; Wed, 07 Aug 2013 10:35:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V74pr-0003zk-F1 for qemu-devel@nongnu.org; Wed, 07 Aug 2013 10:35:40 -0400 Received: from indium.canonical.com ([91.189.90.7]:43945) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V74pq-0003zX-Uc for qemu-devel@nongnu.org; Wed, 07 Aug 2013 10:35:35 -0400 Received: from loganberry.canonical.com ([91.189.90.37]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1V74pp-0005M2-PW for ; Wed, 07 Aug 2013 14:35:33 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id BF9362E80C1 for ; Wed, 7 Aug 2013 14:35:33 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Wed, 07 Aug 2013 14:26:55 -0000 From: Cole Robinson <1209180@bugs.launchpad.net> Sender: bounces@canonical.com References: <20130807110901.6617.23985.malonedeb@soybean.canonical.com> Message-Id: <20130807142655.5489.70019.malone@gac.canonical.com> Errors-To: bounces@canonical.com Subject: [Qemu-devel] [Bug 1209180] Re: hw/usb/core.c:415: usb_handle_packet: Assertion `p->ep->type != 3 || (dev->flags & (1 << USB_DEV_FLAG_IS_HOST))' failed Reply-To: Bug 1209180 <1209180@bugs.launchpad.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Your observation is correct, but this is already fixed upstream: commit 628e54857a82a3cb65ef96c12640c30d6307a064 Author: Gerd Hoffmann Date: Wed Jun 12 13:17:02 2013 +0200 usb-host-libusb: set USB_DEV_FLAG_IS_HOST ** Changed in: qemu Status: New =3D> Fix Committed -- = You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1209180 Title: hw/usb/core.c:415: usb_handle_packet: Assertion `p->ep->type !=3D 3 || (dev->flags & (1 << USB_DEV_FLAG_IS_HOST))' failed Status in QEMU: Fix Committed Bug description: After the patch at http://lists.nongnu.org/archive/html/qemu- devel/2013-05/msg01567.html, I cannot get my Logitech Unifying USB receiver passed to the guest anymore. Minimal reproduction command: qemu-system-x86_64 -usbdevice host:046d:c52b Debug patch: diff --git a/hw/usb/core.c b/hw/usb/core.c index 05948ca..20753cc 100644 --- a/hw/usb/core.c +++ b/hw/usb/core.c @@ -409,6 +409,8 @@ void usb_handle_packet(USBDevice *dev, USBPacket *p) /* hcd drivers cannot handle async for isoc */ assert(p->ep->type !=3D USB_ENDPOINT_XFER_ISOC); /* using async for interrupt packets breaks migration */ + printf("type=3D%x %x %x %p %p\n", p->ep->type, + dev->flags, p->ep->dev->flags, dev, p->ep->dev); assert(p->ep->type !=3D USB_ENDPOINT_XFER_INT || (dev->flags & (1 << USB_DEV_FLAG_IS_HOST))); usb_packet_set_state(p, USB_PACKET_ASYNC); yields: type=3D0 1 1 0x5555565de4c0 0x5555565de4c0 type=3D0 1 1 0x5555565de4c0 0x5555565de4c0 type=3D0 1 1 0x5555565de4c0 0x5555565de4c0 type=3D0 1 1 0x5555565de4c0 0x5555565de4c0 type=3D0 1 1 0x5555565de4c0 0x5555565de4c0 type=3D3 1 1 0x5555565de4c0 0x5555565de4c0 qemu-system-x86_64: hw/usb/core.c:415: usb_handle_packet: Assertion `p->e= p->type !=3D 3 || (dev->flags & (1 << USB_DEV_FLAG_IS_HOST))' failed. Program received signal SIGABRT, Aborted. 0x00007ffff10c61c9 in raise () from /usr/lib/libc.so.6 (gdb) bt #0 0x00007ffff10c61c9 in raise () from /usr/lib/libc.so.6 #1 0x00007ffff10c75c8 in abort () from /usr/lib/libc.so.6 #2 0x00007ffff10bf356 in __assert_fail_base () from /usr/lib/libc.so.6 #3 0x00007ffff10bf402 in __assert_fail () from /usr/lib/libc.so.6 #4 0x00005555556e4b38 in usb_handle_packet (dev=3D, p=3Dp= @entry=3D0x5555565da610) at hw/usb/core.c:414 #5 0x00005555556f93ef in uhci_handle_td (s=3Ds@entry=3D0x5555565ce5d0, q= =3D0x5555566a9dc0, q@entry=3D0x0, qh_addr=3Dqh_addr@entry=3D980834, td=3Dtd= @entry=3D0x7fffffffdd30, td_addr=3D, int_mask=3Dint_mask@ent= ry=3D0x7fffffffdd1c) at hw/usb/hcd-uhci.c:904 #6 0x00005555556f9949 in uhci_process_frame (s=3Ds@entry=3D0x5555565ce5d= 0) at hw/usb/hcd-uhci.c:1084 #7 0x00005555556f9c35 in uhci_frame_timer (opaque=3D0x5555565ce5d0) at h= w/usb/hcd-uhci.c:1183 #8 0x000055555573e086 in qemu_run_timers (clock=3D0x55555654e200) at qem= u-timer.c:394 #9 0x000055555573e325 in qemu_run_timers (clock=3D) at qe= mu-timer.c:459 #10 qemu_run_all_timers () at qemu-timer.c:452 #11 0x0000555555711bee in main_loop_wait (nonblocking=3D) = at main-loop.c:470 #12 0x00005555555e0161 in main_loop () at vl.c:2029 #13 main (argc=3D, argv=3D, envp=3D) at vl.c:4419 Looking around, I see that host-bsd.c and host-linux.c both set USB_DEV_FLAG_IS_HOST, but host-libusbx.c doesn't do that. Affected QEMU versions: 1.5.1, 1.5.2 Not affected: 1.5.0 libusb version: 1.0.16 To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1209180/+subscriptions