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

[stable] Fix TcpListener::accept() on x86 Android on stable by disabling the use of accept4. #82475

Closed

Conversation

de-vri-es
Copy link
Contributor

TcpListener::accept is broken on Android x86 on stable and beta because it performs a raw accept4 syscall, which doesn't exist on that platform. This was originally reported in #82400, so you can find more details there.

This PR fixes it by simply falling back to accept on x86 Android platforms.

Note that for the main branch it would be nice to fix the issue with #82473, rust-lang/libc#2079 and another libc bump. However, if that can't happen before the next beta release, then a similar fix as this PR should be applied on the main branch too.

@rustbot label +O-android
r? @Mark-Simulacrum

On x86 before Linux 4.3, accept4 is not a separate syscall.
Instead, it can be called using `socketcall(SYS_ACCEPT4, ...).
Rather than implementing that here, just fall back to `accept`.
@rustbot rustbot added the O-android Operating system: Android label Feb 24, 2021
@rust-highfive
Copy link
Collaborator

⚠️ Warning ⚠️

  • Pull requests are usually filed against the master branch for this repo, but this one is against stable. Please double check that you specified the right target!

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 24, 2021
@Mark-Simulacrum Mark-Simulacrum changed the title Fix TcpListener::accept() on x86 Android on stable by disabling the use of accept4. [stable] Fix TcpListener::accept() on x86 Android on stable by disabling the use of accept4. Mar 1, 2021
@Mark-Simulacrum Mark-Simulacrum added stable-nominated Nominated for backporting to the compiler in the stable channel. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Mar 1, 2021
@Mark-Simulacrum
Copy link
Member

Nominating for stable backport (though I don't think a stable point release is likely at this time), but reassigning to @joshtriplett who reviewed parts of this in the libc repository. r? @joshtriplett

@joshtriplett
Copy link
Member

This seems like a reasonable approach for a low-impact fix on stable.

@bors r+

@bors
Copy link
Contributor

bors commented Mar 1, 2021

📌 Commit 960cb69 has been approved by joshtriplett

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 1, 2021
@Mark-Simulacrum
Copy link
Member

@bors r-

We don't generally want to merge into stable branch currently unless we're intending to make a stable point release, which isn't currently the case. Marking as stable-accepted.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 1, 2021
@Mark-Simulacrum Mark-Simulacrum added the stable-accepted Accepted for backporting to the compiler in the stable channel. label Mar 1, 2021
@joshtriplett
Copy link
Member

@Mark-Simulacrum Ah, thanks; I didn't know the procedure there.

bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 5, 2021
…=joshtriplett

[beta] Fix TcpListener::accept() on x86 Android on beta by disabling the use of accept4.

This is the same as rust-lang#82475, but for beta.

In a nutshell: `TcpListener::accept` is broken on Android x86 on stable and beta because it performs a raw `accept4` syscall, which doesn't exist on that platform. This was originally reported in rust-lang#82400, so you can find more details there.

`@rustbot` label +O-android
r? `@Mark-Simulacrum`
@Mark-Simulacrum Mark-Simulacrum removed stable-accepted Accepted for backporting to the compiler in the stable channel. stable-nominated Nominated for backporting to the compiler in the stable channel. labels Mar 19, 2021
@Mark-Simulacrum
Copy link
Member

We won't be making a point release this cycle, so closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-android Operating system: Android S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants