Re: [Libusbx-devel] [libusbx] Core: libusb_interrupt_transfer and libusb_control_transfer does not return in case of error (#76)

2014-01-06 Thread miguelfreitas
@jwrdegoede here is what happens with current master: ``` libusbx: error [reap_for_handle] reap failed error -1 errno=14 libusbx: error [handle_events] backend handle_events failed with error -1 libusbx: error [sync_transfer_wait_for_completion] libusb_handle_events failed: LIBUSB_ERROR_IO,

Re: [Libusbx-devel] [libusbx] Core: libusb_interrupt_transfer and libusb_control_transfer does not return in case of error (#76)

2014-01-06 Thread miguelfreitas
@jwrdegoede you are right about the previous patch being incorrect as you pointed here: http://sourceforge.net/mailarchive/message.php?msg_id=31068411 I have just tried exiting the while when libusb_cancel_transfer() != 0. As you predicted, we can't use libusb_free_transfer() because it will

Re: [Libusbx-devel] [libusbx] Core: libusb_interrupt_transfer and libusb_control_transfer does not return in case of error (#76)

2014-01-07 Thread miguelfreitas
I chose not to use memmove but rather read and write all buffer bytes in a loop (not sure if memmove would optimize src==dst case). I could successfully trigger the EFAULT and it did not cause any segfault. patch (just for reference): https://gist.github.com/miguelfreitas/8298825 besides i

Re: [Libusbx-devel] [libusbx] Core: libusb_interrupt_transfer and libusb_control_transfer does not return in case of error (#76)

2014-01-07 Thread miguelfreitas
@jwrdegoede I have read the processcompl() you mention and i agree the only failure case is when one of the put_user or copy_to_user fails. -EFAULT is the only error code used there. Another raw guess: is it possible that data was corrupted during USB transfer (this actually happens here due

[Libusbx-devel] [libusbx] break from never ending loop. fix #76. (#167)

2014-01-09 Thread miguelfreitas
. if we don#39;t break here libusbx will get stuck in this loop forever. fix #76. You can merge this Pull Request by running: git pull https://github.com/miguelfreitas/libusbx issue_76 Or you can view, comment on it, or merge it online at: https://github.com/libusbx/libusbx/pull/167 -- Commit