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: Drop guard was deallocating with the incorrect size #120145

Merged
merged 1 commit into from
Jan 22, 2024

Conversation

the8472
Copy link
Member

@the8472 the8472 commented Jan 19, 2024

InPlaceDstBufDrop holds onto the allocation before the shrinking happens which means it must deallocate the destination elements but the source allocation.

Thanks @cuviper for spotting this.

@the8472 the8472 added beta-nominated Nominated for backporting to the compiler in the beta channel. I-unsound Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jan 19, 2024
@rustbot rustbot added I-prioritize Issue: Indicates that prioritization has been requested for this issue. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 19, 2024
@compiler-errors compiler-errors removed the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Jan 19, 2024
@rust-log-analyzer

This comment has been minimized.

InPlaceDstBufDrop holds onto the allocation before the shrinking happens
which means it must deallocate the destination elements but the source
allocation.
@cuviper
Copy link
Member

cuviper commented Jan 19, 2024

@bors r+

@bors
Copy link
Contributor

bors commented Jan 19, 2024

📌 Commit 5796b3c has been approved by cuviper

It is now in the queue for this repository.

@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 Jan 19, 2024
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jan 20, 2024
…uviper

fix: Drop guard was deallocating with the incorrect size

InPlaceDstBufDrop holds onto the allocation before the shrinking happens which means it must deallocate the destination elements but the source allocation.

Thanks `@cuviper` for spotting this.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 21, 2024
…uviper

fix: Drop guard was deallocating with the incorrect size

InPlaceDstBufDrop holds onto the allocation before the shrinking happens which means it must deallocate the destination elements but the source allocation.

Thanks ``@cuviper`` for spotting this.
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 21, 2024
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#120005 (Update Readme)
 - rust-lang#120045 (Un-hide `iter::repeat_n`)
 - rust-lang#120128 (Make stable_mir::with_tables sound)
 - rust-lang#120145 (fix: Drop guard was deallocating with the incorrect size)
 - rust-lang#120158 (`rustc_mir_dataflow`: Restore removed exports)
 - rust-lang#120167 (Capture the rationale for `-Zallow-features=` in bootstrap.py)
 - rust-lang#120174 (Warn users about limited review for tier 2 and 3 code)
 - rust-lang#120180 (Document some alternatives to `Vec::split_off`)

Failed merges:

 - rust-lang#120171 (Fix assume and assert in jump threading)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 21, 2024
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#120005 (Update Readme)
 - rust-lang#120045 (Un-hide `iter::repeat_n`)
 - rust-lang#120128 (Make stable_mir::with_tables sound)
 - rust-lang#120145 (fix: Drop guard was deallocating with the incorrect size)
 - rust-lang#120158 (`rustc_mir_dataflow`: Restore removed exports)
 - rust-lang#120167 (Capture the rationale for `-Zallow-features=` in bootstrap.py)
 - rust-lang#120174 (Warn users about limited review for tier 2 and 3 code)
 - rust-lang#120180 (Document some alternatives to `Vec::split_off`)

Failed merges:

 - rust-lang#120171 (Fix assume and assert in jump threading)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 21, 2024
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#120005 (Update Readme)
 - rust-lang#120045 (Un-hide `iter::repeat_n`)
 - rust-lang#120128 (Make stable_mir::with_tables sound)
 - rust-lang#120145 (fix: Drop guard was deallocating with the incorrect size)
 - rust-lang#120158 (`rustc_mir_dataflow`: Restore removed exports)
 - rust-lang#120167 (Capture the rationale for `-Zallow-features=` in bootstrap.py)
 - rust-lang#120174 (Warn users about limited review for tier 2 and 3 code)
 - rust-lang#120180 (Document some alternatives to `Vec::split_off`)

Failed merges:

 - rust-lang#120171 (Fix assume and assert in jump threading)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 21, 2024
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#120005 (Update Readme)
 - rust-lang#120045 (Un-hide `iter::repeat_n`)
 - rust-lang#120128 (Make stable_mir::with_tables sound)
 - rust-lang#120145 (fix: Drop guard was deallocating with the incorrect size)
 - rust-lang#120158 (`rustc_mir_dataflow`: Restore removed exports)
 - rust-lang#120167 (Capture the rationale for `-Zallow-features=` in bootstrap.py)
 - rust-lang#120174 (Warn users about limited review for tier 2 and 3 code)
 - rust-lang#120180 (Document some alternatives to `Vec::split_off`)

Failed merges:

 - rust-lang#120171 (Fix assume and assert in jump threading)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 22, 2024
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#120005 (Update Readme)
 - rust-lang#120045 (Un-hide `iter::repeat_n`)
 - rust-lang#120128 (Make stable_mir::with_tables sound)
 - rust-lang#120145 (fix: Drop guard was deallocating with the incorrect size)
 - rust-lang#120158 (`rustc_mir_dataflow`: Restore removed exports)
 - rust-lang#120167 (Capture the rationale for `-Zallow-features=` in bootstrap.py)
 - rust-lang#120174 (Warn users about limited review for tier 2 and 3 code)
 - rust-lang#120180 (Document some alternatives to `Vec::split_off`)

Failed merges:

 - rust-lang#120171 (Fix assume and assert in jump threading)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 4a941d3 into rust-lang:master Jan 22, 2024
11 checks passed
@rustbot rustbot added this to the 1.77.0 milestone Jan 22, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jan 22, 2024
Rollup merge of rust-lang#120145 - the8472:fix-inplace-dest-drop, r=cuviper

fix: Drop guard was deallocating with the incorrect size

InPlaceDstBufDrop holds onto the allocation before the shrinking happens which means it must deallocate the destination elements but the source allocation.

Thanks `@cuviper` for spotting this.
@cuviper
Copy link
Member

cuviper commented Jan 25, 2024

@rustbot rustbot added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Jan 25, 2024
@cuviper cuviper mentioned this pull request Jan 25, 2024
@cuviper cuviper modified the milestones: 1.77.0, 1.76.0 Jan 25, 2024
@cuviper cuviper removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Jan 25, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 27, 2024
[beta] backports

- Remove alignment-changing in-place collect rust-lang#120116
- fix: Drop guard was deallocating with the incorrect size rust-lang#120145

r? ghost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel. I-unsound Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants