Skip to content

Miri: fix error on dangling pointer inbounds offset #114333

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

Merged
merged 2 commits into from
Aug 2, 2023

Conversation

RalfJung
Copy link
Member

@RalfJung RalfJung commented Aug 1, 2023

We used to claim that the pointer was "dereferenced", but that is just not true.

Can be reviewed commit-by-commit. The first commit is an unrelated rename that didn't seem worth splitting into its own PR.

r? @oli-obk

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 1, 2023
@rustbot
Copy link
Collaborator

rustbot commented Aug 1, 2023

Some changes occurred to the CTFE / Miri engine

cc @rust-lang/miri

The Miri subtree was changed

cc @rust-lang/miri

Some changes occurred to the CTFE / Miri engine

cc @rust-lang/miri

also simplify the in-bounds checking in Miri's borrow trackers
@RalfJung RalfJung force-pushed the dangling-ptr-offset branch from 6d016a3 to 8496292 Compare August 1, 2023 15:57
--> $DIR/dangling_pointer_offset.rs:LL:CC
|
LL | let x = unsafe { p.offset(42) };
| ^^^^^^^^^^^^ out-of-bounds pointer arithmetic: ALLOC has been freed, so this pointer is dangling
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the key change, previously this talked about "pointer to alloc859 was dereferenced after this allocation got freed"

@oli-obk
Copy link
Contributor

oli-obk commented Aug 2, 2023

@bors r+

@bors
Copy link
Collaborator

bors commented Aug 2, 2023

📌 Commit 8496292 has been approved by oli-obk

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 Aug 2, 2023
@bors
Copy link
Collaborator

bors commented Aug 2, 2023

⌛ Testing commit 8496292 with merge 64ad036...

@bors
Copy link
Collaborator

bors commented Aug 2, 2023

☀️ Test successful - checks-actions
Approved by: oli-obk
Pushing 64ad036 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 2, 2023
@bors bors merged commit 64ad036 into rust-lang:master Aug 2, 2023
@rustbot rustbot added this to the 1.73.0 milestone Aug 2, 2023
@RalfJung RalfJung deleted the dangling-ptr-offset branch August 2, 2023 19:15
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (64ad036): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.7% [2.4%, 2.9%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.2% [-2.2%, -2.2%] 1
All ❌✅ (primary) - - 0

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 648.769s -> 647.763s (-0.16%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants