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

AF_MAX/PF_MAX incorrect on local system #665

Closed
Susurrus opened this issue Jul 12, 2017 · 11 comments · Fixed by #1423
Closed

AF_MAX/PF_MAX incorrect on local system #665

Susurrus opened this issue Jul 12, 2017 · 11 comments · Fixed by #1423

Comments

@Susurrus
Copy link
Contributor

I'm running x86_64 Linux and when running libc-test I the following:

bad AF_MAX value at byte 0: rust: 42 (0x2a) != c 43 (0x2b)
bad PF_MAX value at byte 0: rust: 42 (0x2a) != c 43 (0x2b)

I don't remember getting these in the past, but I just upgraded to Fedora 26, so maybe newer libs changed this constant. Tests are also still passing in CI...

@marmistrz
Copy link
Contributor

The same for me, Arch Linux, glibc 2.25

@marmistrz
Copy link
Contributor

glibc 2.25 has added Qualcomm IPC Router and had to increment AF_MAX/PF_MAX:
https://fossies.org/diffs/glibc/2.24_vs_2.25/sysdeps/unix/sysv/linux/bits/socket.h-diff.html

@Susurrus
Copy link
Contributor Author

I think this ties into how does libc deal with API changes between OS versions. There's some work to be done to figure that out, and it should include things like this.

@alexcrichton
Copy link
Member

We should probably just ignore these constants in libc-test, the values don't seem too critical for keeping correct

@Susurrus
Copy link
Contributor Author

I was going to suggest they might just be worth removing, but that doesn't seem like the right answer either.

@marmistrz
Copy link
Contributor

Maybe we should instead generate such files during build based on the libc that is currently installed? It can possibly be a problem when rust-libc exports some constants libc doesn't.

@Susurrus
Copy link
Contributor Author

Digging around the internet more, I'm inclined to say that AF_MAX and PF_MAX should just be removed. I think this would need to wait to 1.0 to do given the backwards compatibility guarantees provided by libc, but I can't find any real code that uses AF_MAX and PF_MAX`.

In nix we don't expose these constants in our socket API which makes me even more inclined to say that these constants are unused.

I searched through all Rust projects on GitHub and in the first 20 pages couldn't find a use for AF_MAX that wasn't just declaring it.

@mati865
Copy link
Contributor

mati865 commented May 31, 2018

Since #904 tests now skip these 2 values.
Confirmed to pass tests on openSUSE Tumbleweed (rolling release distro with glibc 2.27 right now).

@gnzlbg
Copy link
Contributor

gnzlbg commented May 28, 2019

I've submitted a PR that deprecates these #1375 . After a couple of releases, if nobody complains, we can remove these.

@gnzlbg
Copy link
Contributor

gnzlbg commented Jun 27, 2019

Feel free to submit a PR removing these.

Susurrus added a commit to Susurrus/libc that referenced this issue Jul 5, 2019
These constants have already been deprecated for a few releases with
a deprecation notice, so they can finally be removed.

Closes rust-lang#665
@Susurrus
Copy link
Contributor Author

Susurrus commented Jul 5, 2019

NET_MAXID is included here as it relies on AF_MAX on many targets and had the same deprecation notice. Submitted #1423

bors added a commit that referenced this issue Jul 6, 2019
Remove AF_MAX, PF_MAX, NET_MAXID constants

These constants have already been deprecated for a few releases with
a deprecation notice, so they can finally be removed.

Closes #665
bors added a commit that referenced this issue Jul 6, 2019
Remove AF_MAX, PF_MAX, NET_MAXID constants

These constants have already been deprecated for a few releases with
a deprecation notice, so they can finally be removed.

Closes #665
@bors bors closed this as completed in #1423 Jul 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants