[issue7332] python script segment fault at PyMarshal_ReadLastObjectFromFile in import_submodule

STINNER Victor report at bugs.python.org
Wed Apr 21 23:17:10 CEST 2010


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

Here is a short shell script to reproduce the stack overflow:
 - create 100 Python modules: stack1 imports stack2, stack2 imports stack3, ...., and stack100 prints "hello"
 - each module calls os.system("cat /proc/%s/maps|grep stack" % os.getpid()) to display the stack map
 - set the max stack size to 128 KB

The stack starts with 86016 bytes and it crashs at import depth 6.

I don't know if my script is realistic (128 KB stack), but at least it shows a crash.

I think that most programs crash with small stack.

----------
Added file: http://bugs.python.org/file17030/import_stackoverflow.sh

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


More information about the Python-bugs-list mailing list