Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why event.inner.length == 4294967295 ep0_loop return #5

Open
imatespl opened this issue Apr 8, 2023 · 2 comments
Open

why event.inner.length == 4294967295 ep0_loop return #5

imatespl opened this issue Apr 8, 2023 · 2 comments

Comments

@imatespl
Copy link

imatespl commented Apr 8, 2023

I run usb-proxy in banana pi m2 plus, when i disconnect usb device from broad then raw_gadget return 4294967295, this number ep0_loop break, so usb_proxy main thread Segmentation fault
./usb-proxy --device=musb-hdrc.4.auto --driver=musb-hdrc
Device is: musb-hdrc.4.auto
Driver is: musb-hdrc
vendor_id is: -1
product_id is: -1
Device opened successfully
Setup USB config successfully
Start hotplug_monitor thread, thread id(10504)
Start for EP0, thread id(10487)
event: connect, length: 0
Hotplug event
Received SIGINT, stopping...
event: unknown, length: 4294967295
End for EP0, thread id(10487)
Segmentation fault

i want to known why event.inner.length == 4294967295 ep0_loop return,thanks

@AristoChen
Copy link
Owner

Hi @imatespl ,

Thank you for being interesting in this project, and sorry for the late reply.

There is a hotplug detecting mechanism for USB device, once the USB device hotplug event is detected, it will send a SIGINT signal, and which will cause usb_raw_event_fetch recived a EINTR, inorder to identify whether the EINTR is caused by hotplug or real EINTR, so I set the length to UINT_MAX(which is 4294967295) to identify that it is highly possible that EINTR is caused by USB device hotplug

@imatespl
Copy link
Author

Thank you very very much,this make process Segmentation fault,when remove usb device from host

		if (event.inner.length == 4294967295) {
			printf("End for EP0, thread id(%d)\n", gettid());
			return;
		}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants