[issue7332] python script segment fault at PyMarshal_ReadLastObjectFromFile in import_submodule

STINNER Victor report at bugs.python.org
Thu Apr 22 01:59:38 CEST 2010


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

I tried to limit memory allocated on the stack while importing modules. Number of bytes allocated on the stack:
 - without my patch: 13792 bytes per import
 - with my patch: 1632 bytes per import
(using import_stackoverflow.sh, import a short Python module)

I guess that it will not fix the issue, only report the crash to another function.

I'm attaching the patch to this issue only to keep a copy of it. The patch is complex and there is no good reason to commit it since the problem doesn't come from Python.

The patch allocates filename buffers on the heap in import.c, zipimport.c and marshal.c.

----------
Added file: http://bugs.python.org/file17037/import_nostack_alloc.patch

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


More information about the Python-bugs-list mailing list