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

Reject huge alignments on macos with system allocator only #49573

Merged
merged 1 commit into from
Apr 4, 2018

Conversation

glandium
Copy link
Contributor

@glandium glandium commented Apr 2, 2018

ef8804b addressed #30170 by rejecting
huge alignments at the allocator API level, transforming a specific
platform bug/limitation into an enforced API limitation on all
platforms.

This change essentially reverts that commit, and instead makes alloc()
itself return AllocErr::Unsupported when receiving huge alignments.

This was discussed in #32838 (comment)
and following.

@glandium
Copy link
Contributor Author

glandium commented Apr 2, 2018

Cc @SimonSapin

@TimNN
Copy link
Contributor

TimNN commented Apr 2, 2018

Your PR failed on Travis. Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
[00:00:46] configure: rust.quiet-tests     := True
---
[00:04:16] error: attributes are not yet allowed on `if` expressions
[00:04:16]    --> liballoc_system/lib.rs:137:17
[00:04:16]     |
[00:04:16] 137 |                 #[cfg(target_os = "macos")]
[00:04:16]     |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:04:16]
[00:04:16] error: aborting due to previous error
[00:04:16]
[00:04:16] error: Could not compile `alloc_system`.
[00:04:16]
[00:04:16] Caused by:
[00:04:16]   process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc --crate-name alloc_system liballoc_system/lib.rs --color always --error-format json --crate-type lib --emit=dep-info,link -C opt-level=2 -C metadata=ed94ac9e95a953a9 -C extra-filename=-ed94ac9e95a953a9 --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-std/release/deps --extern core=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release/deps/libcore-811292bee4a6b310.rlib --extern libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stageux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu
---
113580 ./obj/build/bootstrap/debug/incremental/bootstrap-1xj36c8o119z7/s-ezq968k9js-1lqr5ph-1qldka3x57wek

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN.

ef8804b addressed rust-lang#30170 by rejecting
huge alignments at the allocator API level, transforming a specific
platform bug/limitation into an enforced API limitation on all
platforms.

This change essentially reverts that commit, and instead makes alloc()
itself return AllocErr::Unsupported when receiving huge alignments.

This was discussed in rust-lang#32838 (comment)
and following.
@SimonSapin SimonSapin added A-allocators Area: Custom and system allocators T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Apr 2, 2018
@SimonSapin
Copy link
Contributor

Looks good to me. I think we discussed doing exactly this, but just to be sure let’s get some more libs team eyes on it.

@rfcbot fcp merge

@rfcbot rfcbot added the proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. label Apr 2, 2018
@rfcbot
Copy link

rfcbot commented Apr 2, 2018

Team member @SimonSapin has proposed to merge this. The next step is review by the rest of the tagged teams:

No concerns currently listed.

Once a majority of reviewers approve (and none object), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

@rfcbot
Copy link

rfcbot commented Apr 2, 2018

🔔 This is now entering its final comment period, as per the review above. 🔔

@rfcbot rfcbot added final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. and removed proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. labels Apr 2, 2018
@alexcrichton
Copy link
Member

@bors: r=SimonSapin

@bors
Copy link
Contributor

bors commented Apr 2, 2018

📌 Commit 98175a8 has been approved by SimonSapin

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Apr 2, 2018
@SimonSapin
Copy link
Contributor

@bors: p=1

I’m working on large-ish changes that should go on top of this to avoid merge conflicts.

@bors
Copy link
Contributor

bors commented Apr 4, 2018

⌛ Testing commit 98175a8 with merge 20338a5...

bors added a commit that referenced this pull request Apr 4, 2018
Reject huge alignments on macos with system allocator only

ef8804b addressed #30170 by rejecting
huge alignments at the allocator API level, transforming a specific
platform bug/limitation into an enforced API limitation on all
platforms.

This change essentially reverts that commit, and instead makes alloc()
itself return AllocErr::Unsupported when receiving huge alignments.

This was discussed in #32838 (comment)
and following.
@bors
Copy link
Contributor

bors commented Apr 4, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: SimonSapin
Pushing 20338a5 to master...

@bors bors merged commit 98175a8 into rust-lang:master Apr 4, 2018
@glandium glandium deleted the huge-align branch April 4, 2018 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-allocators Area: Custom and system allocators final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants