miri icon indicating copy to clipboard operation
miri copied to clipboard

Allocator does not properly report OOM

Open RalfJung opened this issue 6 years ago • 3 comments

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

RalfJung avatar Feb 06 '19 13:02 RalfJung

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.

oli-obk avatar Feb 07 '19 10:02 oli-obk

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

RalfJung avatar Feb 07 '19 13:02 RalfJung

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

RalfJung avatar Dec 21 '22 14:12 RalfJung