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

Improve miri_print_borrow_stacks #2614

Merged
merged 2 commits into from
Oct 26, 2022

Conversation

saethlin
Copy link
Member

Per post-merge review on #2322

  • miri_print_stacks renamed to miri_print_borrow_stacks
  • A bit more details in docs, clarified how unstable these functions are meant to be
  • Print an unknown_bottom if one exists

Open question: Currently miri_get_alloc_id gets the expected AllocId for Wildcard pointers, but for pointers with no provenance, the function reports UB and halts the interpreter. That's definitely wrong. But what should we do? Is it reasonable to check if the pointer has None provenance and try to get an AllocId for its address? That still leaves us with a failure path, which in this case might be best-handled as an ICE? I'm just not sure that changing the return type of miri_get_alloc_id to Option is a win because it complicates all normal uses of this.

@RalfJung
Copy link
Member

Is it reasonable to check if the pointer has None provenance and try to get an AllocId for its address?

No, pointers with None provenance conceptually do nit have an AllocId.

@bors
Copy link
Contributor

bors commented Oct 25, 2022

☔ The latest upstream changes (presumably #2618) made this pull request unmergeable. Please resolve the merge conflicts.

@saethlin saethlin force-pushed the stack-inspection-tools branch from b01182a to ef5515c Compare October 25, 2022 21:52
@RalfJung
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Oct 26, 2022

📌 Commit 97043ac has been approved by RalfJung

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Oct 26, 2022

⌛ Testing commit 97043ac with merge 3e85970...

@bors
Copy link
Contributor

bors commented Oct 26, 2022

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

@bors bors merged commit 3e85970 into rust-lang:master Oct 26, 2022
@saethlin
Copy link
Member Author

Thanks for improving the docs :)

@saethlin saethlin deleted the stack-inspection-tools branch May 19, 2023 14:47
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.

4 participants