#145559 proposes a signal-safe mechanism to print backtraces. This is useful for human debugging, but not ideal for tools because it requires parsing human-readable text. For example, a crash-tracker may wish to export and analyze structured backtraces. Similarly, a profiler can benefit from the ability to generate structure stack-traces in pure C, without needing to reason about the safety of reentering the python interpreter.
Has this already been discussed elsewhere?
I have already discussed this feature proposal on Discourse
changed the title [-]Expose signal-safe way to get a structured stacktrace[/-][+]Add unstable C APIs for allocation-free raw-frame stack inspection[/+]on Jun 16, 2026
Activity
pythongh-148925: Add PyUnstable_CollectCallStack and PyUnstable_Print…
pythongh-148925: Add PyUnstable_CollectCallStack and PyUnstable_Print…
pythongh-148925: Add PyUnstable_CollectCallStack and PyUnstable_Print…
pythongh-148925: Add PyUnstable_CollectCallStack and PyUnstable_Print…
pythongh-148925: Add PyUnstable_CollectCallStack and PyUnstable_Print…
pythongh-148925: Add PyUnstable_* API for signal-safe stack iteration
pythongh-148925: Add PyUnstable_* API for signal-safe stack iteration
pythongh-148925: Add signal-safe PyUnstable_* APIs for call-stack ite…