Skip to content

glossary: define pointer provenance #179

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 15 commits into from
Jul 28, 2019
Merged

Conversation

RalfJung
Copy link
Member

No description provided.

@RalfJung RalfJung changed the title define pointer provenance glossary: define pointer provenance Jul 26, 2019
@RalfJung
Copy link
Member Author

@rkruppe I would particularly appreciate your feedback here.

@hanna-kruppe
Copy link

The example and explanation seems good to me. But AFAIK the exact form provenance information takes is still up for debate and will probably wind up richer than just a simple numeric ID for allocations. Also, pointer<->integer casts interact with provenance and cautious readers may wonder how the simple "one pointer, in one specific allocation" provenance model works with such casts (it doesn't really). So IMO there should be a note saying that this @N provenance is a simplified model for the sake of example and the real deal will be more complex but isn't decided yet.

@RalfJung
Copy link
Member Author

@rkruppe the alloc ID was meant as just an example for what provenance can be. I did not mean to say that this is exactly what provenance is in Rust. But I think it nicely demonstrates that rules like cross-object address arithmetic not producing usable pointers need some "magic" in the pointers, and how provenance can implement such rules operationally.

The entire discussion of alloc IDs starts with "For example", but I guess you are saying that is not enough? I will try to make it clearer.

@hanna-kruppe
Copy link

Yes, I just meant that it's not as clear as could be. But reading again, I think the pointers to other kinds of provenance at the end (stacked borrows, the proposals for C coming out of Cerberus) should be sufficient. The unresolved interaction with int<->ptr casts (do integers have provenance?) does deserve mention though, IMO.

@RalfJung
Copy link
Member Author

@rkruppe I did some edits, what do you think?

@RalfJung RalfJung merged commit 0266f8e into rust-lang:master Jul 28, 2019
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