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

Fix: Report malloc failures in target_description of cortexm, cortexar #1902

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ALTracer
Copy link
Contributor

Detailed description

  • No new features, it's more of a fix.
  • The existing problem is unchecked malloc in regs_description.
  • This PR adds the check and logs on heap exhaustion.

Discovered during testing around July 14. Triggerable by PR1830 (stack front) plus no PR1529 (traceswoasync on heap) on stlink/swlink. (hits even harder with ENABLE_RTT=1). Otherwise the symptom on attach is rather cryptic, GDB gets no (or malformed) register description and defaults to wrong architecture and register numbers (use RSP logging).
May also be beneficial not just to ENABLE_DEBUG=1 builds, but also out-of-tree projects which have RTOS and log channels but a small heap for userspace tasks.

Your checklist for this pull request

Closing issues

@ALTracer ALTracer force-pushed the fix/cortex-desc-allocfail-report branch from 3886a7f to 00ae965 Compare August 18, 2024 11:38
@ALTracer ALTracer force-pushed the fix/cortex-desc-allocfail-report branch from 00ae965 to 30762f4 Compare September 1, 2024 14:36
@ALTracer ALTracer force-pushed the fix/cortex-desc-allocfail-report branch from 30762f4 to fc9fa7e Compare September 29, 2024 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant