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

curl_multi_poll always returns immediately if the wakeup socket has been disconnected #6132

Closed
tomalakgeretkal opened this issue Oct 26, 2020 · 4 comments

Comments

@tomalakgeretkal
Copy link

curl_multi_poll delegates to Curl_multi_wait, which checks multi->wakeup_pair[0] for POLLIN activity then attempts to read from it.

Unfortunately, waking an iPad breaks the wakeup socket pair, triggering a POLLIN event and resulting in SOCKERRNO being set to ENOTCONN in Curl_multi_wait's final #ifdef ENABLE_WAKEUP block.

This condition, and other possible error conditions on the wakeup socket, are not handled, so the condition remains on the FD and curl_multi_poll will never block again.

Even if the iOS wake scenario is to be considered an edge case, it seems to me we'd be best off looking for and handling any wakeup socket errors anyway.

tomalakgeretkal added a commit to tomalakgeretkal/curl that referenced this issue Oct 26, 2020
@bagder bagder closed this as completed in 10818dc Nov 21, 2020
bagder pushed a commit that referenced this issue Aug 25, 2022
Sockets may be shut down by the kernel when the app is moved to the
background, but pipes are not.

Removed from KNOWN_BUGS

Fixes #6132
Closes #9368
@TXTT2016
Copy link

This problem reappear when iphone's OS version update to 16.x.
@rcombs

@TXTT2016
Copy link

TXTT2016 commented Apr 12, 2023

My base libcurl version is 7.80.0, and pick your commit to build

But this won't happen when I use libcurl 7.85.0, are there any other commits affect this problem? @bagder

@bagder
Copy link
Member

bagder commented Apr 12, 2023

This issue was fixed in #9368 (07f80f9).

@TXTT2016
Copy link

This issue was fixed in #9368 (07f80f9).

Yes, I picked this commit , and it doesn't raise before, but recently, when iphone OS version update to 16.2, it raised again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants