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 UB in test_ref_as_expected #13

Closed
wants to merge 1 commit into from
Closed

Fix UB in test_ref_as_expected #13

wants to merge 1 commit into from

Conversation

saethlin
Copy link

@saethlin saethlin commented Mar 9, 2024

Rust has Provenance, so this attempt to round-trip a pointer through a usize by transmuting it then deallocating through that round-tripped pointer is UB somewhere.

I found this error in a crater run: rust-lang/rust#121282 and here is a fix.

@facebook-github-bot
Copy link
Contributor

Hi @saethlin!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@saethlin
Copy link
Author

saethlin commented Mar 9, 2024

Ah. I see. Feel free to make this fix yourself.

@saethlin saethlin closed this Mar 9, 2024
@ndmitchell
Copy link
Contributor

Thanks so much for the report, and the thoughtful fix. I'll go ahead and apply a version of this. Much appreciated!

facebook-github-bot pushed a commit to facebook/buck2 that referenced this pull request Mar 10, 2024
Summary: From facebookincubator/gazebo#13. Fix up some UB in a test.

Reviewed By: dtolnay

Differential Revision: D54718707

fbshipit-source-id: 52169c051bc5efd399d0e92f1438e97e7a3d2833
facebook-github-bot pushed a commit to facebook/starlark-rust that referenced this pull request Mar 10, 2024
Summary: From facebookincubator/gazebo#13. Fix up some UB in a test.

Reviewed By: dtolnay

Differential Revision: D54718707

fbshipit-source-id: 52169c051bc5efd399d0e92f1438e97e7a3d2833
facebook-github-bot pushed a commit that referenced this pull request Mar 10, 2024
Summary: From #13. Fix up some UB in a test.

Reviewed By: dtolnay

Differential Revision: D54718707

fbshipit-source-id: 52169c051bc5efd399d0e92f1438e97e7a3d2833
@ndmitchell
Copy link
Contributor

Fixed as 6ea3db4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants