Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack overflow segfaults instead of aborting on aarch64 for simple program #89949

Closed
hkratz opened this issue Oct 16, 2021 · 3 comments
Closed
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows C-bug Category: This is a bug. O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state

Comments

@hkratz
Copy link
Contributor

hkratz commented Oct 16, 2021

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.

@hkratz hkratz added the C-bug Category: This is a bug. label Oct 16, 2021
@hkratz
Copy link
Contributor Author

hkratz commented Oct 16, 2021

Not macos-specific.

@rustbot label -O-macos

@rustbot rustbot added A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state O-macos Operating system: macOS labels Oct 16, 2021
@hkratz hkratz changed the title Stack overflow segfaults instead of aborting on aarch64-apple-darwin for simple program Stack overflow segfaults instead of aborting on aarch64 for simple program Oct 16, 2021
@rustbot rustbot removed the O-macos Operating system: macOS label Oct 16, 2021
@hkratz
Copy link
Contributor Author

hkratz commented Oct 16, 2021

@rustbot claim

@hkratz
Copy link
Contributor Author

hkratz commented Oct 16, 2021

Duplicate of #77071.

@hkratz hkratz closed this as completed Oct 16, 2021
@hkratz hkratz removed their assignment Oct 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows C-bug Category: This is a bug. O-Arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state
Projects
None yet
Development

No branches or pull requests

2 participants