-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsC-bugCategory: This is a bug.Category: This is a bug.
Description
If I'm not mistaken, writing an infinite recursing function, is guaranteed to produce this message:
thread '' has overflowed its stack
fatal runtime error: stack overflow
I recently accidentally wrote an infinite recursing function (src/ir/item.rs:982) and I got this message instead:
process didn't exit successfully: `/home/volker/rust-bindgen/target/debug/deps/tests-ec5d637d33ad84bf stack_overflow` (signal: 11, SIGSEGV: invalid memory reference)
To be fair, rust_bindgen does contain unsafe code, but I still suspect that this SIGSEGV is a bug in rust's handling with segmentation fault, because the call stack of the crash looks like this:
Standard library
Functions that do not contain unsafe code
A few thousand times the `is_constified_enum_module` function
Functions that contain unsafe code
start
How to reproduce:
$ git clone https://github.com/Volker-Weissmann/rust-bindgen --branch stack_overflow --depth 1
$ cd rust-bindgen
$ cargo test stack_overflow
I'm using rustc 1.50.0-nightly (d32c320 2020-12-10)
Note: There is also a forum post about this:
https://users.rust-lang.org/t/is-rust-guaranteed-to-detect-stack-overflows/52593/12
Metadata
Metadata
Assignees
Labels
A-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsC-bugCategory: This is a bug.Category: This is a bug.