Skip to content

Stack overflow should abort the process normally, not segfault and dump core #31273

Closed

Description

Today, when you overflow the stack, Rust traps the SIGSEGV and prints an error message, then the program exits with a segfault, exit code 135 on linux, and dumps core.

When we used segstacks for stack overflow the runtime just abort!ed, exiting with an illegal instruction.

That stack overflow protection is implemented by handling a segfault is an implementation detail. Rust should not be exposing it. Instead, when it detects a segfault because of stack overflow it should abort like any other fatal error.

cc https://users.rust-lang.org/t/rust-guarantees-no-segfaults-with-only-safe-code-but-it-segfaults-stack-overflow/4305/20

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions