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

might_permit_raw_init: also check arrays #79296

Closed
wants to merge 3 commits into from

Conversation

nico-abram
Copy link
Contributor

This is the next step for #66151: when doing mem::zeroed/mem::uninitialized, also recursively check arrays for whether they permit zero/uninit initialization.

cc @RalfJung

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @matthewjasper (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-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 22, 2020
@RalfJung
Copy link
Member

r? @RalfJung

@RalfJung
Copy link
Member

This looks great, thanks! We should do a crater run.

@pietroalbini if I schedule a crater run now, will it use the same lockfiles as what was used back then for #71274, or have they been updated since then?

@RalfJung
Copy link
Member

@bors try

@bors
Copy link
Contributor

bors commented Nov 22, 2020

⌛ Trying commit a6f7780 with merge eafdee2dfae8c2233b74f98b123308be7ccefcc6...

@bors
Copy link
Contributor

bors commented Nov 22, 2020

☀️ Try build successful - checks-actions
Build commit: eafdee2dfae8c2233b74f98b123308be7ccefcc6 (eafdee2dfae8c2233b74f98b123308be7ccefcc6)

@pietroalbini
Copy link
Member

@RalfJung for projects with an existing Cargo.lock it will use that, for projects without one (like crates.io crates) it will generate a fresh one.

@RalfJung
Copy link
Member

All right, that should work then.

@craterbot test

@craterbot
Copy link
Collaborator

🚨 Error: failed to parse the command

🆘 If you have any trouble with Crater please ping @rust-lang/infra!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@RalfJung
Copy link
Member

@craterbot run

@craterbot
Copy link
Collaborator

👌 Experiment pr-79296 created and queued.
🤖 Automatically detected try build eafdee2dfae8c2233b74f98b123308be7ccefcc6
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 24, 2020
@craterbot
Copy link
Collaborator

🚧 Experiment pr-79296 is now running

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot
Copy link
Collaborator

🎉 Experiment pr-79296 is completed!
📊 419 regressed and 43 fixed (131737 total)
📰 Open the full report.

⚠️ If you notice any spurious failure please add them to the blacklist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-crater Status: Waiting on a crater run to be completed. labels Dec 2, 2020
@RalfJung
Copy link
Member

RalfJung commented Dec 2, 2020

All right, we got some data! And looks like we have quite a large amount of regressions again. @nico-abram let me know if you need any help analyzing this! I suggest you use some kind of shared editor so the intermediate results are easily shared (we often use hackmd.io for this).

@nico-abram
Copy link
Contributor Author

Do I mostly want to look at regressed: dependencies and regressed: root results`?

I started this hackmd (Not sure if I did it correctly)

@RalfJung
Copy link
Member

RalfJung commented Dec 2, 2020

"regressed: root results" should be enough (but I admit I am also a bit confused by the classification here, in particular "4 different results" is odd).

The goal in the analysis would be to figure out where the panic is coming from. at least roughly. As in, which crate is the one causing UB here?

@crlf0710 crlf0710 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-review Status: Awaiting review from the assignee but also interested parties. labels Dec 18, 2020
@crlf0710
Copy link
Member

@nico-abram Ping from triage: any updates on this?

@nico-abram
Copy link
Contributor Author

@crlf0710 No updates, still have to analyze the crater report (I got started with it but haven't touched it in a couple weeks. Still planning to work on it, probably after december)

@crlf0710
Copy link
Member

@nico-abram Ping from triage: any updates on this?

@JohnCSimon JohnCSimon added the S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. label Feb 8, 2021
@JohnCSimon
Copy link
Member

Ping from triage:
@nico-abram I'm closing this as inactive. Please feel free to reopen when you have the time.

@JohnCSimon JohnCSimon closed this Feb 8, 2021
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request May 25, 2022
Introduce stricter checks for might_permit_raw_init under a debug flag

This is intended to be a version of the strict checks tried out in rust-lang#79296, but also checking number validity (under the assumption that `let _ = std::mem::uninitialized::<u32>()` is UB, which seems to be what rust-lang/unsafe-code-guidelines#71 is leaning towards.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants