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

libusbmuxd and libimobiledevice-glue built for Windows can lockup on a disconnect #131

Open
sctol opened this issue Aug 18, 2023 · 2 comments

Comments

@sctol
Copy link

sctol commented Aug 18, 2023

Ran into an issue using libimobiledevice tools locking up with a iOS device connected with a faulty USB cable and tracked it down to libusbmuxd and libimobiledevice-glue.

Code linked against the Windows MSVC runtime library using its send(), recv(), and select() functions can return on a hard disconnect or connection reset with errno set to 0.

One possible workaround would be to replace returns of -errno with (errno == 0) ? -ECONNRESET : -errno

@sctol
Copy link
Author

sctol commented Feb 23, 2024

Still running into lockup issues on Windows with send() in libusbmuxd and recv() in libimobiledevice-glue/socket.c

Specifically at lines 210 and 224 of libusbmuxd.c, suggest changing "res = -errno;" with "res = (errno == 0) ? -ECONNRESET : -errno;"

and at line 1595, change "num_sent = errno;" with "num_sent = (errno == 0) ? ECONNRESET : errno;"

All because errno can still be zero on a socket error with send() and recv() on Windows.

@nikias
Copy link
Member

nikias commented Feb 23, 2024

See my comment here:
libimobiledevice/libimobiledevice-glue#41 (comment)
working on a solution.

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