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

Bugfix MiriAllocBytes to guarantee different addresses #3625

Merged
merged 3 commits into from
May 24, 2024

Conversation

Strophox
Copy link
Contributor

Fix in alloc_bytes.rs following #3526

Currently when an allocation of size == 0 is requested we return a std::ptr::without_provenance_mut(align), but this means returned ptrs may overlap, which breaks things.

@RalfJung
Copy link
Member

but this means returned ptrs may overlap

"overlap" isn't quite right, since arguably ranges with with size 0 can never overlap.

But two different allocations can end up at the same address, and that's a problem.

src/alloc_bytes.rs Outdated Show resolved Hide resolved
src/alloc_bytes.rs Outdated Show resolved Hide resolved
@Strophox Strophox changed the title Bugfix MiriAllocBytes overlapping addresses Bugfix MiriAllocBytes to guarantee different addresses May 23, 2024
@RalfJung
Copy link
Member

RalfJung commented May 23, 2024 via email

src/alloc_bytes.rs Outdated Show resolved Hide resolved
src/alloc_bytes.rs Outdated Show resolved Hide resolved
@RalfJung
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented May 24, 2024

📌 Commit 120efdc has been approved by RalfJung

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented May 24, 2024

⌛ Testing commit 120efdc with merge d7ddcaf...

@bors
Copy link
Contributor

bors commented May 24, 2024

☀️ Test successful - checks-actions
Approved by: RalfJung
Pushing d7ddcaf to master...

@bors bors merged commit d7ddcaf into rust-lang:master May 24, 2024
8 checks passed
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