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

Detect overflow in proc_macro_server subspan #75146

Merged
merged 3 commits into from
Sep 16, 2020

Conversation

tmiasko
Copy link
Contributor

@tmiasko tmiasko commented Aug 4, 2020

  • Detect overflow in proc_macro_server subspan
  • Add tests for overflow in Vec::drain
  • Add tests for overflow in String / VecDeque operations using ranges

@rust-highfive
Copy link
Collaborator

r? @sfackler

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 4, 2020
@crlf0710 crlf0710 added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 21, 2020
@bors
Copy link
Contributor

bors commented Aug 30, 2020

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

@bors
Copy link
Contributor

bors commented Sep 3, 2020

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

@tmiasko
Copy link
Contributor Author

tmiasko commented Sep 4, 2020

r? @Mark-Simulacrum

@Mark-Simulacrum
Copy link
Member

@estebank -- I note that the issue suggested that we were unsure about the DWIM semantics you meant (#72237 (comment)).

That said this has been open for a month now and looks reasonable to me; if there are semantics that move us from panicking to not panicking I think that'd relatively (if not perfectly) backwards compatible to move to. I am going to approve it, but we can revert or otherwise pause if necessary.

@bors r+

@bors
Copy link
Contributor

bors commented Sep 4, 2020

📌 Commit e7b0bb0056c268cce0682b99beaf4e2979745245 has been approved by Mark-Simulacrum

@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 Sep 4, 2020
@bors
Copy link
Contributor

bors commented Sep 4, 2020

🔒 Merge conflict

This pull request and the master branch diverged in a way that cannot be automatically merged. Please rebase on top of the latest master branch, and let the reviewer approve again.

How do I rebase?

Assuming self is your fork and upstream is this repository, you can resolve the conflict following these steps:

  1. git checkout range-overflow (switch to your branch)
  2. git fetch upstream master (retrieve the latest master)
  3. git rebase upstream/master -p (rebase on top of it)
  4. Follow the on-screen instruction to resolve conflicts (check git status if you got lost).
  5. git push self range-overflow --force-with-lease (update this PR)

You may also read Git Rebasing to Resolve Conflicts by Drew Blessing for a short tutorial.

Please avoid the "Resolve conflicts" button on GitHub. It uses git merge instead of git rebase which makes the PR commit history more difficult to read.

Sometimes step 4 will complete without asking for resolution. This is usually due to difference between how Cargo.lock conflict is handled during merge and rebase. This is normal, and you should still perform step 5 to update this PR.

Error message
Auto-merging library/alloc/src/vec.rs
CONFLICT (content): Merge conflict in library/alloc/src/vec.rs
Auto-merging library/alloc/src/string.rs
CONFLICT (content): Merge conflict in library/alloc/src/string.rs
Auto-merging library/alloc/src/collections/vec_deque.rs
CONFLICT (content): Merge conflict in library/alloc/src/collections/vec_deque.rs
Automatic merge failed; fix conflicts and then commit the result.

@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 Sep 4, 2020
@bors
Copy link
Contributor

bors commented Sep 4, 2020

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

@tmiasko
Copy link
Contributor Author

tmiasko commented Sep 4, 2020

The #75207 introduced a new bounds checking API for ranges, and used it to fix
most of overflow issues, making most of changes here unnecessary. It didn't add
any new tests, so I retained those.

@tmiasko tmiasko changed the title Detect overflow in operations using range bounds Detect overflow in proc_macro_server subspan Sep 4, 2020
@tmiasko
Copy link
Contributor Author

tmiasko commented Sep 15, 2020

@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Sep 15, 2020
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 15, 2020
@Mark-Simulacrum
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Sep 15, 2020

📌 Commit f8cfb2f has been approved by Mark-Simulacrum

@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 Sep 15, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 16, 2020
Rollup of 10 pull requests

Successful merges:

 - rust-lang#73955 (deny(unsafe_op_in_unsafe_fn) in libstd/process.rs)
 - rust-lang#75146 (Detect overflow in proc_macro_server subspan)
 - rust-lang#75304 (Note when a a move/borrow error is caused by a deref coercion)
 - rust-lang#75749 (Consolidate some duplicate code in the sys modules.)
 - rust-lang#75882 (Use translated variable for test string)
 - rust-lang#75886 (Test that bounds checks are elided for [..index] after .position())
 - rust-lang#76048 (Initial support for riscv32gc_unknown_linux_gnu)
 - rust-lang#76198 (Make some Ordering methods const)
 - rust-lang#76689 (Upgrade to pulldown-cmark 0.8.0)
 - rust-lang#76763 (Update cargo)

Failed merges:

r? `@ghost`
@bors
Copy link
Contributor

bors commented Sep 16, 2020

⌛ Testing commit f8cfb2f with merge f4e4485...

@bors bors merged commit fb9bb2b into rust-lang:master Sep 16, 2020
@rustbot rustbot added this to the 1.48.0 milestone Sep 16, 2020
@tmiasko tmiasko deleted the range-overflow branch September 16, 2020 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants