Skip to content

segfault on 'index out of bounds' OS X Yosemite #51794

Closed
@felipenoris

Description

@felipenoris

I get Segmentation Fault on this code when running the debug binary.

Only happens on OS X Yosemite 10.10.5 .

fn main() {
    let x = [1];
    println!("{}", x[1]);
}
$ cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.02s
     Running `target/debug/segfault`
Segmentation fault: 11

$ cargo run --release
    Finished release [optimized] target(s) in 0.02s
     Running `target/release/segfault`
thread 'main' panicked at 'index out of bounds: the len is 1 but the index is 1', src/main.rs:3:20
note: Run with `RUST_BACKTRACE=1` for a backtrace.

Meta

rustc 1.27.0 (3eda71b 2018-06-19)
binary: rustc
commit-hash: 3eda71b
commit-date: 2018-06-19
host: x86_64-apple-darwin
release: 1.27.0
LLVM version: 6.0

Metadata

Metadata

Assignees

Labels

O-macosOperating system: macOSP-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions