This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gregory.p.smith
Recipients brett.cannon, gregory.p.smith, ncoghlan, twouters
Date 2012-03-16.00:42:28
SpamBayes Score 2.7816126e-05
Marked as misclassified No
Message-id <1331858549.21.0.813321528381.issue14331@psf.upfronthosting.co.za>
In-reply-to
Content
Python/import.c in 2.7 and 3.2 consume a lot of stack space when importing modules.  In stack constrained environments (think: 64k stack) this can cause a crash when you have a large chain of imports.

The bulk of this likely comes from places where a char buf[MAXPATHLEN+1] or similar is declared on the stack in the call chain.  MAXPATHLEN is commonly defined to be in the 256..1024 range depending on the OS.

Changing the code to not put the large buffer on the stack but to malloc and free it instead is a pretty straightforward re-factor.

import is being significantly reworked in 3.3 so I won't consider this issue there until after that settles as it may no longer apply.
History
Date User Action Args
2012-03-16 00:42:29gregory.p.smithsetrecipients: + gregory.p.smith, twouters, brett.cannon, ncoghlan
2012-03-16 00:42:29gregory.p.smithsetmessageid: <1331858549.21.0.813321528381.issue14331@psf.upfronthosting.co.za>
2012-03-16 00:42:28gregory.p.smithlinkissue14331 messages
2012-03-16 00:42:28gregory.p.smithcreate