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 unsoundness in bootstrap cache code #105624

Merged
merged 1 commit into from
Dec 14, 2022

Conversation

compiler-errors
Copy link
Member

Discovered via #105575, which showed that rustc was failing to build during a perf run.

@rustbot
Copy link
Collaborator

rustbot commented Dec 12, 2022

r? @Mark-Simulacrum

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

@rustbot rustbot added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 12, 2022
@compiler-errors compiler-errors force-pushed the cache-unsound branch 2 times, most recently from 02519f7 to d8d84d8 Compare December 12, 2022 20:27
let l = T::intern_cache().lock().unwrap();
unsafe { mem::transmute::<&U, &'static U>(l.get(*self).as_ref()) }
unsafe { mem::transmute::<&U, &U>(l.get(*self).as_ref()) }
Copy link
Member Author

Choose a reason for hiding this comment

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

We still need to unsafely transmute the lifetime from the temporary borrow on this line to the &self lifetime in the signature.

@jyn514
Copy link
Member

jyn514 commented Dec 14, 2022

@bors r+

I want to rip out all this interning code at some point and use a library instead, but this a good change in the meantime, thanks.

@bors
Copy link
Contributor

bors commented Dec 14, 2022

📌 Commit 675fa0b has been approved by jyn514

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 Dec 14, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 14, 2022
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#105399 (Use more LFS functions.)
 - rust-lang#105578 (Fix transmutes between pointers in different address spaces (e.g. fn ptrs on AVR))
 - rust-lang#105598 (explain mem::forget(env_lock) in fork/exec)
 - rust-lang#105624 (Fix unsoundness in bootstrap cache code)
 - rust-lang#105630 (Add a test for rust-lang#92481)
 - rust-lang#105684 (Improve rustdoc markdown variable naming)
 - rust-lang#105697 (Remove fee1-dead from reviewers)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 0e861cc into rust-lang:master Dec 14, 2022
@rustbot rustbot added this to the 1.68.0 milestone Dec 14, 2022
@cuviper
Copy link
Member

cuviper commented Jan 28, 2023

Not high priority itself, but I'd like to include this if we do a stable 1.67.x release, as it fixes local rebuild (#107349).

@rustbot label +stable-nominated

@rustbot rustbot added the stable-nominated Nominated for backporting to the compiler in the stable channel. label Jan 28, 2023
@apiraino
Copy link
Contributor

apiraino commented Feb 3, 2023

I guess it missed the mark and the nomination can probably be now deleted

@rustbot label -stable-nominated

@rustbot rustbot removed the stable-nominated Nominated for backporting to the compiler in the stable channel. label Feb 3, 2023
@cuviper
Copy link
Member

cuviper commented Feb 3, 2023

No, this is still relevant in case we do a new point release on 1.67, as we might for #107611.

@rustbot label +stable-nominated

@rustbot rustbot added the stable-nominated Nominated for backporting to the compiler in the stable channel. label Feb 3, 2023
@pnkfelix
Copy link
Member

pnkfelix commented Feb 6, 2023

I'm unilaterally approving this for stable backport, to ensure it gets into the next point release for 1.67.

@rustbot label: stable-accepted

@rustbot rustbot added the stable-accepted Accepted for backporting to the compiler in the stable channel. label Feb 6, 2023
@cuviper cuviper mentioned this pull request Feb 6, 2023
@cuviper cuviper removed the stable-nominated Nominated for backporting to the compiler in the stable channel. label Feb 6, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 7, 2023
…crum

Release 1.67.1

- Revert back to LlvmArchiveBuilder on all platforms rust-lang#107360
- 🚨 fix unsoundness in bootstrap cache code rust-lang#105624
- Mark uninlined_format_args as pedantic rust-lang/rust-clippy#10265
- Revert "switch to the macos-12-xl builder" rust-lang#107574

r? `@Mark-Simulacrum`
@cuviper cuviper modified the milestones: 1.68.0, 1.67.1 Feb 8, 2023
wip-sync pushed a commit to NetBSD/pkgsrc-wip that referenced this pull request Feb 12, 2023
Pkgsrc changes:
 * checksums only.

Upstream changes:

Version 1.67.1 (2023-02-09)
===========================

- [Fix interoperability with thin archives.]
  (rust-lang/rust#107360)
- [Fix an internal error in the compiler build process.]
  (rust-lang/rust#105624)
- [Downgrade `clippy::uninlined_format_args` to pedantic.]
  (rust-lang/rust-clippy#10265)
@compiler-errors compiler-errors deleted the cache-unsound branch August 11, 2023 19:56
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. stable-accepted Accepted for backporting to the compiler in the stable channel. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants