Date: Sat, 05 Jun 2021 22:30:37 +0000 From: bugzilla-noreply@freebsd.org To: usb@FreeBSD.org Subject: [Bug 256296] "No Device" error after using asynchronous API of libusb once Message-ID: <bug-256296-19105-l2smbRnESO@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-256296-19105@https.bugs.freebsd.org/bugzilla/> References: <bug-256296-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=3D256296 Sergii <sergii.dmytruk@3mdeb.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #225431|0 |1 is obsolete| | --- Comment #6 from Sergii <sergii.dmytruk@3mdeb.com> --- Created attachment 225579 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D225579&action= =3Dedit Better bug reproducer Made a better example that showcases the bug. No help from debugger is necessary. Demonstrates the issue 100% runs for me. Device is opened and cl= osed twice. Second time its opened there is a transfer attempt which always fails (returns "no device" error). The API is used properly as far as I can tell and the code "works" if you remove sleep() calls, but doesn't if you leave them. I'm pretty confident t= his is a bug in libusb. Another suggestion for a fix: before handling an event check whether device= is still in the polling queue and if not, ignore the event. This might be the = best fix because the issue is that device is being polled after it was closed (background thread was blocked on poll() at that time), so any events from = this device should be rightfully discarded as if it wasn't on the polling queue = when the event has arrived. --=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-256296-19105-l2smbRnESO>