Skip to content

[illumos] stack exhaustion doesn't print "thread has overflowed its stack" messages #128568

Closed
@sunshowers

Description

I tried this code:

fn recurse(remaining: usize) {
    if remaining > 0 {
        recurse(remaining - 1);
    }
}

recurse(1048576);

Also reproducible with this example program: https://github.com/sunshowers/stack-exhaust-test, by running cargo run.

I expected to see this happen: Similar to Linux:

thread 'main' has overflowed its stack
fatal runtime error: stack overflow

Instead, this happened:

zsh: segmentation fault (core dumped)  cargo run

Meta

rustc --version --verbose:

rustc 1.80.0 (051478957 2024-07-21)
binary: rustc
commit-hash: 051478957371ee0084a7c0913941d2a8c4757bb9
commit-date: 2024-07-21
host: x86_64-unknown-illumos
release: 1.80.0
LLVM version: 18.1.7

Also reproduces with:

rustc 1.82.0-nightly (7120fdac7 2024-07-25)
binary: rustc
commit-hash: 7120fdac7a6e55a5e4b606256042890b36067052
commit-date: 2024-07-25
host: x86_64-unknown-illumos
release: 1.82.0-nightly
LLVM version: 18.1.7
Backtrace

(there's no backtrace, which I believe is expected in this situation)

% RUST_BACKTRACE=1 cargo +nightly run
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.04s
     Running `target/debug/stack-exhaust-test`
running with use_stacker = No, new_thread = false, make_large_local = false
zsh: segmentation fault (core dumped)  RUST_BACKTRACE=1 cargo +nightly run

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.O-illumosthe other shiny OST-libsRelevant to the library team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions