Skip to content

Fixing memory exhaustion when formatting short code suggestion - #76598

Merged
bors merged 3 commits into
rust-lang:masterfrom
ad-anssi:diagnostic_errors_fix
Sep 13, 2020
Merged

Fixing memory exhaustion when formatting short code suggestion #76598
bors merged 3 commits into
rust-lang:masterfrom
ad-anssi:diagnostic_errors_fix

Conversation

@ad-anssi

Copy link
Copy Markdown
Contributor

Details can be found in issue #76597. This PR replaces substractions with saturating_sub's to avoid usize wrapping leading to memory exhaustion when formatting short suggestion messages.

@rust-highfive

Copy link
Copy Markdown
Contributor

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @davidtwco (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 11, 2020
@tesuji

tesuji commented Sep 11, 2020

Copy link
Copy Markdown
Contributor

Could you add a test in #76597 under src/test/ui ?

@ad-anssi

Copy link
Copy Markdown
ContributorAuthor

Ok, I will try to add this this afternoon.

@jyn514jyn514 added A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 11, 2020
@estebank

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented Sep 11, 2020

Copy link
Copy Markdown
Collaborator

📌 Commit 62068a5 has been approved by estebank

@borsbors 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 11, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Sep 12, 2020
…stebank
Fixing memory exhaustion when formatting short code suggestion
Details can be found in issue rust-lang#76597. This PR replaces substractions with `saturating_sub`'s to avoid usize wrapping leading to memory exhaustion when formatting short suggestion messages.
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Sep 12, 2020
…stebank
Fixing memory exhaustion when formatting short code suggestion
Details can be found in issue rust-lang#76597. This PR replaces substractions with `saturating_sub`'s to avoid usize wrapping leading to memory exhaustion when formatting short suggestion messages.
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Sep 12, 2020
…stebank
Fixing memory exhaustion when formatting short code suggestion
Details can be found in issue rust-lang#76597. This PR replaces substractions with `saturating_sub`'s to avoid usize wrapping leading to memory exhaustion when formatting short suggestion messages.
@bors

bors commented Sep 13, 2020

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 62068a5 with merge 17d3277...

@bors

bors commented Sep 13, 2020

Copy link
Copy Markdown
Collaborator

☀️ Test successful - checks-actions, checks-azure
Approved by: estebank
Pushing 17d3277 to master...

@borsbors added the merged-by-bors This PR was explicitly merged by bors. label Sep 13, 2020
@bors
bors merged commit 17d3277 into rust-lang:masterSep 13, 2020
@rustbotrustbot added this to the 1.48.0 milestone Sep 13, 2020
@camelidcamelid added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Oct 2, 2020
@camelid

Copy link
Copy Markdown
Member

I think it might be good to backport this to beta so it lands in 1.47.

@Mark-Simulacrum

Copy link
Copy Markdown
Member

Approving unilaterally for beta backport -- looks like this only affects diagnostics, is a minimal patch, and will prevent another release with memory exhaustion on a fairly easily hittable case.

cc @pnkfelix@nikomatsakis -- if you disagree, please let me know and we can back it out.

@Mark-SimulacrumMark-Simulacrum added beta-accepted Accepted for backporting to the compiler in the beta channel. and removed beta-nominated Nominated for backporting to the compiler in the beta channel. labels Oct 2, 2020
@Mark-SimulacrumMark-Simulacrum modified the milestones: 1.48.0, 1.47.0Oct 3, 2020
@Mark-SimulacrumMark-Simulacrum mentioned this pull request Oct 3, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 3, 2020
…k-Simulacrum
[beta] backports
This backports a number of PRs to beta, not all of which have been approved (yet).
* Switch to environment files to change the environment on GHA rust-lang#77418
* cache types during normalization rust-lang#76928
* Fixing memory exhaustion when formatting short code suggestion rust-lang#76598
* Issue 72408 nested closures exponential rust-lang#72412
r? `@Mark-Simulacrum`
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsbeta-acceptedAccepted for backporting to the compiler in the beta channel.merged-by-borsThis PR was explicitly merged by bors.S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants

@ad-anssi@rust-highfive@tesuji@estebank@bors@camelid@Mark-Simulacrum@davidtwco@jyn514@rustbot