This repository was archived by the owner on Jan 24, 2022. It is now read-only.
This repository was archived by the owner on Jan 24, 2022. It is now read-only.
Infinite backtrace, odd backtrace behavior and "corrupted stack?" in GDB #139
Closed
Description
STR
$ cargo generate --git ~/rust-embedded/cortex-m-quickstart --name app && cd app
$ cargo add panic-abort
$ # modify examples/panic.rs to use panic-abort
$ # change memory.x to match the memory layout of the STM32F3DISCOVERY
$ # uncomment thumbv7em-none-eabi target and gdb runner in .cargo/config
$ cargo run --example panic
(gdb) backtrace # "corrupt stack?"
#0 DefaultPreInit ()
at /home/japaric/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-rt-0.6.5/src/lib.rs:556
#1 0x08000412 in Reset ()
at /home/japaric/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-rt-0.6.5/src/lib.rs:496
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) continue
Breakpoint 4, main () at examples/panic.rs:29
29 panic!("Oops")
(gdb) backtrace # where did Reset go?
#0 main () at examples/panic.rs:29
(gdb) continue
Breakpoint 3, rust_begin_unwind (_info=0x10001fb4) at (..)
31 unsafe { intrinsics::abort() }
(gdb) backtrace # infinite backtrace
#0 rust_begin_unwind (_info=0x10001fb4) at (..)
#1 0x080006b0 in core::panicking::panic_fmt () at libcore/panicking.rs:77
#2 0x080006b0 in core::panicking::panic_fmt () at libcore/panicking.rs:77
#3 0x080006b0 in core::panicking::panic_fmt () at libcore/panicking.rs:77
(..)
Metadata
$ rustc -V
rustc 1.31.0-nightly (f99911a4a 2018-10-23)
$ grep cortex-m-rt Cargo.lock
"cortex-m-rt 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)"
$ arm-none-eabi-gdb --version
GNU gdb (GDB) 8.2
Has anyone experienced these issues? I've seen them with previous releases of cortex-m-rt so I don't think they are related to the recent changes to HardFault. Also, in the above logs all backtrace
invocations are before reaching HardFault
.