japaric / steed

[INACTIVE] Rust's standard library, free of C dependencies, for Linux systems
519 stars 22 forks source link

Segfault on ButReader::new #137

Open aleksander opened 7 years ago

aleksander commented 7 years ago

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 7 years ago

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

japaric commented 7 years ago

@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 commented 7 years ago

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

japaric commented 7 years ago

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