<sigh>. listen the EFAULT error is being thrown by this bit of code inside 
libusb:

static int reap_for_handle(struct libusb_device_handle *handle)
{
    struct usbfs_urb *urb;

    int r = ioctl(hpriv->fd, IOCTL_USBFS_REAPURBNDELAY, &urb);
    if (r < 0) {
        ....

Notice how the only address we're passing in is an address on the stack. So 
that definitely is not a bad address, that leaves the buffers in which the 
kernel code in drivers/usb/core/devio.c: processcompl() will
copy any received data, and those buffers are provided by applications using 
libusb, not by libusb itself.

So this very very likely is an application bug. We are not, I repeat NOT going 
to add error handling for EFAULT to libusb, that is just crazy. EFAULT is a 
syscalls variant of segfaulting it means someone is passing around bad 
pointers. Normally a program would immediately segfault then, but if the 
pointer gets passed to a syscall you get EFAULT instead.  What you're asking 
for is the equivalent of adding a signal 11 handler which somehow magically 
fixes things to continue running after some application bug.


---
Reply to this email directly or view it on GitHub:
https://github.com/libusbx/libusbx/issues/76#issuecomment-31690454
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel

Reply via email to