japaric/steed

Segfault on ButReader::new

aleksander opened this issue · 4 comments

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- commented

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

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

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

@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.