Skip to content
This repository has been archived by the owner on Dec 9, 2018. It is now read-only.

Segfault on ButReader::new #137

Open
aleksander opened this issue Apr 18, 2017 · 4 comments
Open

Segfault on ButReader::new #137

aleksander opened this issue Apr 18, 2017 · 4 comments

Comments

@aleksander
Copy link
Contributor

This code:

fn main() {
    use std::io::{BufRead, BufReader};
    let buf = vec![0u8; 10];
    let reader = BufReader::new(&buf[..]);
}

segfaults at:

0x0000000000204763 in core::ptr::write<u8> (dst=0x215000 <error: Cannot access memory at address 0x215000>, src=0) at /home/usov/.rustup/toolchains/nightly-2017-04-15-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore/ptr.rs:246
246	    intrinsics::move_val_init(&mut *dst, src)

@tbu-
Copy link
Collaborator

tbu- commented Apr 19, 2017

Have you tried compiling with --no-default-features --feature naive_ralloc?

@japaric
Copy link
Owner

japaric commented Apr 19, 2017

@aleksander what @tbu- said. We know that the ralloc crate, which is our default allocator, has some bugs so that could be the problem.

@aleksander
Copy link
Contributor Author

There is no segfault with naive_ralloc so the problem is ralloc specific.

@japaric
Copy link
Owner

japaric commented Apr 20, 2017

@aleksander, thanks for checking.

If someone figures out how to repro the bug (with a smaller test case), please send a bug report to the ralloc team.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants