Message 306568 - Python tracker

Message306568

Author vstinner
Recipients eric.smith, jbakker, shamon51, terry.reedy, vstinner
Date 2017-11-20.17:18:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1511198311.32.0.213398074469.issue32022@psf.upfronthosting.co.za>
In-reply-to
Content
I don't think that we can fix this issue. I suggest to close it as WONTFIX.


> sys.setrecursionlimit(3000)

While Python does its best to catch stack overflow, the C implementation of CPython can exhaust the stack memory (8 MB in Linux?) and then crash with a "stack overflow".

I suggest to rewrite your algorithm to reduce the maximum stack depth.

Or maybe try to find a way to extend the maximum size of the stack (is it possible without rebuilding Python?). See for example RLIMIT_STACK of the resource module on Unix.


> On linux x86-64 with python 3.6.3 and python 3.7.0a2+ I get a RecursionError: maximum recursion depth exceeded.

The exact memory usage depends on the Python version and maybe compiler flags. We reduce the stack usage in Python 3.7, search for "Stack consumption" in:

https://vstinner.github.io/contrib-cpython-2017q1.html
History
Date User Action Args
2017-11-20 17:18:31vstinnersetrecipients: + vstinner, terry.reedy, eric.smith, shamon51, jbakker
2017-11-20 17:18:31vstinnersetmessageid: <1511198311.32.0.213398074469.issue32022@psf.upfronthosting.co.za>
2017-11-20 17:18:31vstinnerlinkissue32022 messages
2017-11-20 17:18:31vstinnercreate