Closed
Description
While playing around with rustc 1.69.0-nightly (bd39bbb 2023-02-07) on MacOS, I ran into the following:
//const N: usize = 2_088_032; // largest size that works without abort
const N: usize = 2_092_349; // first segfault
fn main () {
let _ = Box::new([0; N]);
}
With N <= 2088032 this program works fine; above that the binary that rustc
makes produces a runtime abort. Both are acceptable outcomes.
But with N >= 2092349 running the program results in a segmentation fault instead. It sounds like something has destroyed something that the stack unwinder relies on?
Meta
rustc --version --verbose
:
rustc 1.69.0-nightly (bd39bbb4b 2023-02-07)
binary: rustc
commit-hash: bd39bbb4bb92df439bf6d85470e296cc6a47ffbd
commit-date: 2023-02-07
host: aarch64-apple-darwin
release: 1.69.0-nightly
LLVM version: 15.0.7
Backtrace
n/a (the compiled program segfaults)