Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception Stack Frames are not correct in coredumps #78788

Closed
vbrzeski opened this issue Sep 20, 2024 · 2 comments · Fixed by #73189 or #79622
Closed

Exception Stack Frames are not correct in coredumps #78788

vbrzeski opened this issue Sep 20, 2024 · 2 comments · Fixed by #73189 or #79622
Assignees
Labels
area: Coredump bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug

Comments

@vbrzeski
Copy link

vbrzeski commented Sep 20, 2024

Exception Stack Frames are not correct in coredumps

The stack pointer in the Zephyr ARM Coredumps are imprecise due to an error in the stack offset calculation:

#ifdef CONFIG_DEBUG_COREDUMP
z_arm_coredump_fault_sp = POINTER_TO_UINT(esf);
#endif

The stackpointer can't be calculated without EXC_RETURN. We don't have a reliable way to calculate it outside of the coredump handler.

I see we have an existing PR that would resolve this issue: PR #73189.

To Reproduce
With an ARM M4 MCU with FPU extension (e.g. nRF52833):

  1. have one thread doing floating point math
  2. have one thread that doesn't do floating point math
  3. grab a few coredumps
  4. unwind and symbolicate the coredumps, one will fail to unwind properly

Expected behavior
I expect the SP to be accurate :)

Impact
This prevents us from using upstream Zephyr.

Interesting Docs

@vbrzeski vbrzeski added the bug The issue is a bug, or the PR is fixing a bug label Sep 20, 2024
Copy link

Hi @vbrzeski! We appreciate you submitting your first issue for our open-source project. 🌟

Even though I'm a bot, I can assure you that the whole community is genuinely grateful for your time and effort. 🤖💙

@mrkhldn mrkhldn linked a pull request Sep 21, 2024 that will close this issue
@dkalowsk dkalowsk added the priority: medium Medium impact/importance bug label Sep 24, 2024
@mrkhldn mrkhldn linked a pull request Oct 9, 2024 that will close this issue
@ycsin ycsin reopened this Nov 4, 2024
@ycsin
Copy link
Member

ycsin commented Nov 4, 2024

Reopen as #73189 has been reverted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Coredump bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug
Projects
None yet
5 participants