STINNER Victor <victor.stin...@gmail.com> added the comment:

faulthandler has to be as simple as possible because Python internal state may 
be completly corrupted. faulthandler was written to display the traceback on 
bugs like invalid memory read or write. I chose to print the traceback as it is 
stored in memory (from the current frame to the bottom of the stack using 
f_back).

If the traceback is corrupted in the middle of the frame stack, faulthandler 
displays the first half of the traceback, whereas it would not display anything 
with your patch.

The number of frames is also limited to avoid unlimited loops. The internal 
state may be corrupted and I don't want to track already seen frames or 
something like that. With your patch, you may miss where the bug occurred if 
the stack contains more than 100 frames. The limit is hardcoded and cannot be 
changed at runtime yet.

I already seen a segfault while faulthandler was trying to display the 
traceback of a segfault, more than once :-)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue14665>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to