You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to use esp_backtrace::arch::backtrace() to obtain a backtrace in my watchdog interrupt handler, so that I can print a backtrace of where the watchdog occurred. To my surprise the backtrace was empty (even though I have force-frame-pointers enabled).
Apparently the issue was that some stack-frames around the interrupt handling code where not 16-byte aligned, which would cause the printing to be aborted (due to esp_backtrace::is_valid_ram_addr returning false).
When I removed the 16-byte alignment check, I got a correct backtrace back until main.
I'm not sure if there are also other situations where the stackframes are not 16-byte aligned, or whether that's just because I'm inside an interrupt handler. I just wanted to share my discovery, not sure if its of any help to you.
Thank you
The text was updated successfully, but these errors were encountered:
I wanted to use
esp_backtrace::arch::backtrace()
to obtain a backtrace in my watchdog interrupt handler, so that I can print a backtrace of where the watchdog occurred. To my surprise the backtrace was empty (even though I have force-frame-pointers enabled).Apparently the issue was that some stack-frames around the interrupt handling code where not 16-byte aligned, which would cause the printing to be aborted (due to
esp_backtrace::is_valid_ram_addr
returning false).https://github.com/esp-rs/esp-hal/blob/e033162ffd1994c46c478de2de5ec1eed3869762/esp-backtrace/src/lib.rs#L214C1-L217C6
When I removed the 16-byte alignment check, I got a correct backtrace back until main.
I'm not sure if there are also other situations where the stackframes are not 16-byte aligned, or whether that's just because I'm inside an interrupt handler. I just wanted to share my discovery, not sure if its of any help to you.
Thank you
The text was updated successfully, but these errors were encountered: