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

Allocator does not properly report OOM #613

Open
RalfJung opened this issue Feb 6, 2019 · 3 comments
Open

Allocator does not properly report OOM #613

RalfJung opened this issue Feb 6, 2019 · 3 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

RalfJung commented Feb 6, 2019

When you make a big allocation, creating the backing store in Allocation::undef just fails. We could use try_reserve to instead detect this and report it to the running application properly (returning NULL, I guess).

Cc @Amanieu

@oli-obk
Copy link
Contributor

oli-obk commented Feb 7, 2019

bubbling up is something that should only show up in a special mode. Otherwise you can run Vec::with_capacity(n) with a binary search for the n to figure out the size of the phyiscal memory of the host.

@RalfJung
Copy link
Member Author

RalfJung commented Feb 7, 2019

Yeah, we should only do this when Miri runs in "non-deterministic" mode.

@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 Mar 8, 2019
@RalfJung
Copy link
Member Author

Once we support this we also need tests for #[alloc_error_handler] (Cc rust-lang/rust#51540) and the no-std default handler.

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

2 participants