[issue15463] test_faulthandler can fail if install path is too long

STINNER Victor report at bugs.python.org
Fri Jul 27 09:51:56 CEST 2012


STINNER Victor <victor.stinner at gmail.com> added the comment:

faulthandler has arbitrary limits to avoid an unlimited loop if some
data are corrupted.

#define MAX_STRING_LENGTH 100
#define MAX_FRAME_DEPTH 100
#define MAX_NTHREADS 100

The string limit is maybe too short. MAX_STRING_LENGTH can be set to
500 characters, what do you think?

We may also add a function to change these limits at runtime.

> Without investigating further, my instinct would be to prefer to truncate in the middle,
> if possible, otherwise truncate the head of the path, rather than truncate the tail.

faulthandler does not trust anything, including the length of the
string. Change the limit to 500 characters should be safer.

Remember that faulthandler is called when something really bad
happens, like a segfault or an illegal instruction.

faulthandler may be less strict when it is called explicitly, ex:
faulthandler.dump_traceback().

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15463>
_______________________________________


More information about the Python-bugs-list mailing list