Non allocating / low memory usage backtrace printing interface #35
Description
Right now std
has proposed stabilizing a very minimal interface for capturing and printing Backtrace
s. However, internally it does not use this same interface in it's own panic hook. Internally, instead of capturing a Backtrace
object and then printing it std directly invokes a function that prints the backtrace without capturing or resolving frames in advance (source). This interface apparently uses much less memory (does it allocate heap memory at all?).
Other contributors to the project have expressed a desire for a lightweight backtrace printing interface they can use from signal handlers and the like (source). The above interface doesn't seem to work in this specific scenario, but we may want to look into what would be needed to print a backtrace from a signal handler, and in the future possibly expose alternate interfaces to printing backtraces that could work in these constrained environments.