Skip to content

subspace-farmer has rare stack overflow crashes in rayon #3698

@teor2345

Description

@teor2345

Rarely, subspace-farmer will crash with logs like:

2025-09-11T08:42:08.025567Z  INFO subspace_networking::node_runner: dsn: actively using 3/73 known peers                                       
                                                                                                                                               
thread '<unknown>' has overflowed its stack                                                                                                    
fatal runtime error: stack overflow, aborting  

Unfortunately, Rust does not print backtraces on stack overflow, because it requires an alternate stack:
rust-lang/rust#51405

The recommended workaround is to dump a core dump, and use lldb or gdb with debug symbols:
https://users.rust-lang.org/t/how-to-diagnose-a-stack-overflow-issues-cause/17320/12
https://stackoverflow.com/questions/36041974/is-there-any-standard-methodology-for-debugging-a-stack-overflow-in-rust/36042050#36042050

To generate a build with separate backtrace debug file, use:

RUSTFLAGS="-C debuginfo=line-tables-only -C split-debuginfo=packed" cargo build --locked --profile production --bin subspace-farmer

Then copy the debug info .dwp, .dSYM, or .pdb file along with the binary.

https://doc.rust-lang.org/rustc/codegen-options/index.html#debuginfo
https://doc.rust-lang.org/rustc/codegen-options/index.html#split-debuginfo

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfarmerFarming library/appupstreamBlocked by upstream

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions