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

Interrupted system call #25

Open
rlewkowicz opened this issue Aug 15, 2024 · 3 comments
Open

Interrupted system call #25

rlewkowicz opened this issue Aug 15, 2024 · 3 comments

Comments

@rlewkowicz
Copy link

I'm trying to sniff a handshake between an xbox series x and its controller. I'm sure I'll run into issues after this, but I think it's not terming correctly?

pthread_kill(ep->thread_read, SIGUSR1);

Here you kill the threads, but here it exits the application with usb_raw_ep_read(): Interrupted system call

exit(EXIT_FAILURE);

@xairy
Copy link
Contributor

xairy commented Aug 16, 2024

Please try this patch:

diff --git a/proxy.cpp b/proxy.cpp
index beefeb2..b28b726 100644
--- a/proxy.cpp
+++ b/proxy.cpp
@@ -249,6 +249,11 @@ void *ep_loop_read(void *arg) {
                                        ep.bEndpointAddress, transfer_type.c_str(), dir.c_str());
                                break;
                        }
+                       if (rv < 0 && errno == EINTR) {
+                               printf("EP%x(%s_%s): interface likely changing, stopping thread\n",
+                                       ep.bEndpointAddress, transfer_type.c_str(), dir.c_str());
+                               break;
+                       }
                        else if (rv < 0) {
                                perror("usb_raw_ep_read()");
                                exit(EXIT_FAILURE);

@rlewkowicz
Copy link
Author

I did something similar. I'm doing so many devices right now so I lose tack of what errors I got where. Ultimately something strange is going on with iSync transfer. I straight up pass the read threads on iSync and it keeps running otherwise it segfaults.

It starts ep5 (which I'm sure is different device to device), passes flag of 0 and gets invalid Args. I know there's issues for isync.

I'm getting heavy into a lot of this stuff. My cynthion from great Scott just arrived, I'll play with it a bit and come back to this.

xairy added a commit to xairy/usb-proxy that referenced this issue Aug 24, 2024
Commit 4a48d46 added a EINTR handler for usb_raw_ep_write but not
for usb_raw_ep_read; fix this.

Fixes AristoChen#25.
@AristoChen
Copy link
Owner

Hi @rlewkowicz

thanks for reporting the issue, do you have any chance to see if the PR #26 (Thanks @xairy !) fixes the issue?

thanks!

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

3 participants