Ticket #101 (closed defect: needinfo)

Opened 3 years ago

Last modified 2 years ago

Income data is lost after a timeout reading from libusb_interrupt_transfer

Reported by: jmarchetti Owned by:
Milestone: Component: libusb-1.0
Keywords: libusb_interrupt_transfer time out Cc:
Blocked By: Blocks:

Description

If libusb_interrupt_transfer times out then subsequent calls returns no data.
I tried a couple of different revisions, including the latest one libusb @ 295c9d.
Can reproduce the problem very easily, using 1ms timeout to see the problem more frequently.

In the log below, after getting libusb:debug [handle_events] poll() returned 0, all the other requests fail!

Here is the log:

libusb:debug [reap_for_handle] urb type=1 status=0 transferred=64
libusb:debug [handle_bulk_completion] handling completion status 0 of bulk urb 1/1
libusb:debug [handle_bulk_completion] last URB in transfer --> complete!
libusb:debug [bulk_transfer_cb] actual_length=64
libusb:debug [submit_bulk_transfer] need 1 urbs for new transfer with length 64
libusb:debug [libusb_get_next_timeout] next timeout in 0.000939s
libusb:debug [handle_events] poll() 2 fds with timeout in 1ms
libusb:debug [handle_events] poll() returned 0
libusb:debug [libusb_cancel_transfer]
libusb:debug [libusb_get_next_timeout] all URBs have already been processed for timeouts
libusb:debug [handle_events] poll() 2 fds with timeout in 60000ms
libusb:debug [handle_events] poll() returned 1
libusb:debug [reap_for_handle] urb type=1 status=-2 transferred=0
libusb:debug [handle_bulk_completion] handling completion status -2 of bulk urb 1/1
libusb:debug [handle_bulk_completion] abnormal reap: urb status -2
libusb:debug [handle_bulk_completion] abnormal reap: last URB handled, reporting
libusb:debug [usbi_handle_transfer_cancellation] detected timeout cancellation
libusb:debug [bulk_transfer_cb] actual_length=0
libusb:debug [submit_bulk_transfer] need 1 urbs for new transfer with length 64
libusb:debug [libusb_get_next_timeout] next timeout in 0.000933s
libusb:debug [handle_events] poll() 2 fds with timeout in 1ms
libusb:debug [handle_events] poll() returned 0
libusb:debug [libusb_cancel_transfer]
libusb:debug [libusb_get_next_timeout] all URBs have already been processed for timeouts
libusb:debug [handle_events] poll() 2 fds with timeout in 60000ms
libusb:debug [handle_events] poll() returned 1
libusb:debug [reap_for_handle] urb type=1 status=-2 transferred=0
libusb:debug [handle_bulk_completion] handling completion status -2 of bulk urb 1/1
libusb:debug [handle_bulk_completion] abnormal reap: urb status -2
libusb:debug [handle_bulk_completion] abnormal reap: last URB handled, reporting

Change History

comment:1 Changed 3 years ago by stuge

Are you sure that this is not a device firmware issue?

To debug, it would be helpful if you could provide output also from the usbmon application at http://people.redhat.com/zaitcev/linux/usbmon-6.tar.gz

Thanks!

comment:2 follow-ups: Changed 3 years ago by jmarchetti

Thanks for the reply.

Device works fine when I rolled back to libusb 0.1.12, which I am using
today.

I am going to provide the output you request.
Thanks.

comment:3 in reply to: ↑ 2 Changed 2 years ago by stuge

Replying to jmarchetti:

I am going to provide the output you request.

That would be great! Please also test using current libusb.git code, and attach or include in a code block (open with three { on a blank line and close with three }) a sample C code which exercises this problem.

I hope a solution for this problem can be identified.

comment:4 in reply to: ↑ 2 Changed 2 years ago by xiaofan

Replying to jmarchetti:

Thanks for the reply.

Device works fine when I rolled back to libusb 0.1.12, which I am using
today.

I am going to provide the output you request.
Thanks.

It would be great that you post your codes of 0.1.12 and libusb-1.0. If not, we may have to close the ticket since we need more information.

comment:5 Changed 2 years ago by stuge

  • Resolution set to needinfo
  • Status changed from new to closed

Closing as needinfo. Please reopen this and provide the requested usbmon output if you can reproduce the problem with current code.

Note: See TracTickets for help on using tickets.