Closed
Description
Running the following code with both stable (1.55.0) and nightly (2021-10-15) compiled for aarch64-apple-darwin on aarch64-apple-darwin segfaults instead of aborting:
fn main() {
let t = [0_u8; 128 * 1024 * 1024];
println!("{}", t[1000]);
}
Output:
~/dev/spikes/stacksizetest
$ cargo +nightly-aarch64-apple-darwin run
Finished dev [unoptimized + debuginfo] target(s) in 0.00s
Running `target/debug/stacksizetest`
Segmentation fault: 11
Debug/release does not matter.
On x86_64-apple-darwin the program aborts as expected:
cargo +stable-x86_64-apple-darwin run
Compiling stacksizetest v0.1.0 (/Users/hans/dev/spikes/stacksizetest)
Finished dev [unoptimized + debuginfo] target(s) in 1.02s
Running `target/debug/stacksizetest`
thread 'main' has overflowed its stack
fatal runtime error: stack overflow
Abort trap: 6
Same happens for aarch64-unknown-linux-gnu.