[issue30998] faulthandler: Show C stacktrace
Ammar Askar
report at bugs.python.org
Sun Jul 23 17:20:26 EDT 2017
Ammar Askar added the comment:
As the faulthandler documentation notes:
> The fault handler is called on catastrophic cases and therefore can only use signal-safe functions (e.g. it cannot allocate memory on the heap). Because of this limitation traceback dumping is minimal compared to normal Python tracebacks:
This immediately disqualifies glibc's backtrace function as it is explicitly marked as AS-Unsafe.
The Windows code you linked also has a heap allocation, it isn't open source like backtrace but I'd imagine its implementation is fairly complex underneath.
Overall, adding more complexity especially to a handler dealing with a catastrophic failure is generally not a very good idea and it's really not a trivial problem to have easy cross platform stack traces. As much as I like this idea I don't think implementing is going to be possible and this is one of the points where you just have to attach a debugger like gdb for good information.
----------
nosy: +ammar2
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30998>
_______________________________________
More information about the Python-bugs-list
mailing list