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

Fix cmsg(3) bugs for musl and OSX #1235

Merged
merged 4 commits into from
Feb 5, 2019
Merged

Fix cmsg(3) bugs for musl and OSX #1235

merged 4 commits into from
Feb 5, 2019

Conversation

asomers
Copy link
Contributor

@asomers asomers commented Feb 1, 2019

This PR fixes bugs in the cmsg(3) family of functions for Linux/musl and OSX, introduced by PR #1098 and PR #1212 . It also adds an integration test which hopefully will validate these functions on every platform.

@rust-highfive
Copy link

r? @gnzlbg

(rust_highfive has picked a reviewer for you, use r? to override)

@gnzlbg
Copy link
Contributor

gnzlbg commented Feb 1, 2019

Thank you for working on this @asomers. It appears that the tests are failing on some targets, maybe some more fine tuning is necessary.

@asomers
Copy link
Contributor Author

asomers commented Feb 1, 2019

I'm pretty sure that the s390x and sparc64 failures are not my fault. On s390x the test program hangs. On sparc64, it gets SIGILL. In both cases, the problem happens before it invokes the first cmsg test function. It's not Travis's fault; I can duplicate the problem locally. It might be QEMU bugs. If nobody else has a better idea, I'll disable the test for those architectures.

@asomers
Copy link
Contributor Author

asomers commented Feb 1, 2019

The two Android failures looks spurious; somebody should restart them. However, the s390x and sparc64 failures are more serious. They seem to be failing early in the test harness. Cargo doesn't provide a way to disable the entire test program on a per-target basis. So I'm stuck. If the decision were up to me; I would just remove those platforms from the test matrix.

@Ralith
Copy link
Contributor

Ralith commented Feb 2, 2019

Can we land the fixes without the new test in the meantime?

@gnzlbg
Copy link
Contributor

gnzlbg commented Feb 4, 2019

@bors: r+

@bors
Copy link
Contributor

bors commented Feb 4, 2019

📌 Commit 5b250ca has been approved by gnzlbg

@gnzlbg
Copy link
Contributor

gnzlbg commented Feb 4, 2019

@asomers could you fill in a bug in rust-lang/rust about the sparc64 and s390x failures ? We are able to run a lot of tests in other rust-lang repos like packed_simd, jemallocator, etc. in these platforms, so I find it weird that they fail for something "this simple".

@gnzlbg
Copy link
Contributor

gnzlbg commented Feb 4, 2019

@bors: retry

@asomers
Copy link
Contributor Author

asomers commented Feb 4, 2019

@gnzlbg are you sure you want to merge this PR without disabling those Travis targets first?

@asomers
Copy link
Contributor Author

asomers commented Feb 4, 2019

Actually, we definitely should not merge this PR without squashing first.

bors r-

@gnzlbg
Copy link
Contributor

gnzlbg commented Feb 4, 2019

@bors: r-

(let me know when you rebase / squash)


We should definitely figure out why these particular tests break on those targets (maybe a qemu bug, maybe a rustc/llvm bug), but we don't have to do that here. I don't think disabling all testing on those targets makes things better for these targets. So skipping these tests until we figure things out seems reasonable to me.

@asomers
Copy link
Contributor Author

asomers commented Feb 4, 2019

Ok, now there's an ACTUAL failure on sparc64. But given how much time I've already spent on this, I'm inclined just to skip that test on sparc64 and open an issue for it. I'll let somebody who actually uses sparc64 and/or Linux fix it.

The android failures are a trivial mistake. I'm locally investigating the s390x failure now.

@asomers
Copy link
Contributor Author

asomers commented Feb 5, 2019

Ok @gnzlbg everything's passing now. I only had to disable the cmsg test on s390x and sparc64. Let me know when you're satisfied review-wise and I'll squash things.

Copy link
Contributor

@gnzlbg gnzlbg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Let me know when you squash the changes!

@gnzlbg gnzlbg mentioned this pull request Feb 5, 2019
@bors
Copy link
Contributor

bors commented Feb 5, 2019

☔ The latest upstream changes (presumably #1217) made this pull request unmergeable. Please resolve the merge conflicts.

@gnzlbg
Copy link
Contributor

gnzlbg commented Feb 5, 2019

The Cargo.lock needs updating. @alexcrichton should we just remove the Cargo.lock ? EDIT: nvm, the PR causing this conflict removed it 👍

This was an oversight from PR rust-lang#1212.  It's been revealed by the new cmsg
test.
This is an error from PR rust-lang#1098.  The wrong definitions coincidentally
work on Linux/glibc, but fail on Linux/musl.
Since these are defined in C as macros, they must be reimplemented in
libc as Rust functions.  They're hard to get exactly right, and they
vary from platform to platform.  The test builds custom C code that uses
the real macros, and compares its output to the Rust versions' output
for various inputs.

Skip the CMSG_NXTHDR test on sparc64 linux because it hits a Bus Error.

Issue rust-lang#1239

Skip the entire cmsg test program on s390x because it dumps core
seemingly before the kernel finishes booting.

Issue rust-lang#1240
@asomers
Copy link
Contributor Author

asomers commented Feb 5, 2019

Rebased, squashed, and fixed on OpenBSD.

@gnzlbg
Copy link
Contributor

gnzlbg commented Feb 5, 2019

@bors: r+

@bors
Copy link
Contributor

bors commented Feb 5, 2019

📌 Commit 38cf5b1 has been approved by gnzlbg

bors added a commit that referenced this pull request Feb 5, 2019
Fix cmsg(3) bugs for musl and OSX

This PR fixes bugs in the cmsg(3) family of functions for Linux/musl and OSX, introduced by PR #1098 and PR #1212 .  It also adds an integration test which hopefully will validate these functions on every platform.
@bors
Copy link
Contributor

bors commented Feb 5, 2019

⌛ Testing commit 38cf5b1 with merge fcf28c6...

@bors
Copy link
Contributor

bors commented Feb 5, 2019

💔 Test failed - checks-travis

@gnzlbg
Copy link
Contributor

gnzlbg commented Feb 5, 2019

@bors: retry

@bors
Copy link
Contributor

bors commented Feb 5, 2019

⌛ Testing commit 38cf5b1 with merge f9b96ee...

bors added a commit that referenced this pull request Feb 5, 2019
Fix cmsg(3) bugs for musl and OSX

This PR fixes bugs in the cmsg(3) family of functions for Linux/musl and OSX, introduced by PR #1098 and PR #1212 .  It also adds an integration test which hopefully will validate these functions on every platform.
@bors
Copy link
Contributor

bors commented Feb 5, 2019

☀️ Test successful - checks-cirrus, checks-travis, status-appveyor
Approved by: gnzlbg
Pushing f9b96ee to master...

@bors bors merged commit 38cf5b1 into rust-lang:master Feb 5, 2019
@asomers asomers deleted the cmsg_osx branch July 13, 2021 02:59
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

Successfully merging this pull request may close these issues.

5 participants