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

hashbrown try_reserve test fails under miri #655

Closed
gnzlbg opened this issue Mar 7, 2019 · 3 comments
Closed

hashbrown try_reserve test fails under miri #655

gnzlbg opened this issue Mar 7, 2019 · 3 comments

Comments

@gnzlbg
Copy link

gnzlbg commented Mar 7, 2019

It seems that miri fails when someone tries to allocate too much memory, instead of returning an error. I'll try to minimize this.

@gnzlbg
Copy link
Author

gnzlbg commented Mar 7, 2019

MWE (playground):

fn main() {
    let layout = std::alloc::Layout::from_size_align(usize::max_value(), 1).unwrap();
    let ptr: *mut u8 = unsafe { std::alloc::alloc(layout) };
    assert!(ptr.is_null());
}

fails with:

memory allocation of 18446744073709551615 bytes failed

@RalfJung
Copy link
Member

RalfJung commented Mar 8, 2019

Looks like a duplicate of #613 ? If yes, please close this.

@RalfJung
Copy link
Member

RalfJung commented Mar 8, 2019

(Closing for now, we can always reopen.)

@RalfJung RalfJung closed this as completed Mar 8, 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

No branches or pull requests

2 participants