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

Sometimes reuse stack addresses #3487

Open
RalfJung opened this issue Apr 18, 2024 · 0 comments
Open

Sometimes reuse stack addresses #3487

RalfJung opened this issue Apr 18, 2024 · 0 comments
Labels
A-interpreter Area: affects the core interpreter C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement

Comments

@RalfJung
Copy link
Member

In real executions, when a function returns and the same function is called again, variables will often get the same address again. In Miri this never happens; address reuse is disabled for stack variables currently. This is because the reuse pool is shared among all threads, and address reuse induces synchronization, so by reusing stack addresses from different threads we basically kill weak memory emulation and data race detection as everything is always synchronized.

We could still do address reuse for stack allocations within the same thread though. This should probably be a separate per-thread reuse pool. Stack allocations are very common so we need to be careful with the performance impact.

@RalfJung RalfJung added C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement A-interpreter Area: affects the core interpreter labels Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-interpreter Area: affects the core interpreter C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement
Projects
None yet
Development

No branches or pull requests

1 participant