Date: Mon, 03 Sep 2018 16:32:45 +0000 From: bugzilla-noreply@freebsd.org To: usb@FreeBSD.org Subject: [Bug 231076] libusb_cancel_transfer() does NOT cancel a transfer after the USB device is removed Message-ID: <bug-231076-19105-LlDRWYgDlh@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-231076-19105@https.bugs.freebsd.org/bugzilla/> References: <bug-231076-19105@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D231076 --- Comment #3 from Ludovic Rousseau <ludovic.rousseau+freebsd@gmail.com> -= -- I added logs in my code. When I start the transfer I have: 00000006 ccid_usb.c:1329:InterruptRead() uxfer->dev_handle: 0x28c0c9c0 When I cancel the transfer I have: 00000004 ccid_usb.c:1399:InterruptStop() uxfer->dev_handle: 0x28c0c9c0 So the problem is not at line 1501 as I initially mentioned. https://github.com/freebsd/freebsd/blob/master/lib/libusb/libusb10.c#L1501 No, the handle has not been closed. libusb_close() is called _after_ the transfer is cancelled. Yes, the transfer has started. At least I get no error when I start it. Yes, I get data from the interrupt pipe when a smart card is inserted or removed. So the USB communication does work with the interrupt pipe. Yes, I can cancel the transfer when the USB device is present. The program = does that when Ctrl-C is used to stop it. The problem happens when the USB device is no more connected. I added a call to libusb_set_debug(ctx, LIBUSB_LOG_LEVEL_DEBUG); in my code= but I don't see more debug. I see that libusb uses DPRINTF(). How can I get the generated log messages? --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-231076-19105-LlDRWYgDlh>