From: Amaury Forgeot d'Arc Date: Sat, 22 Nov 2008 20:06:51 +0000 (+0000) Subject: Merged revisions 67343 via svnmerge from X-Git-Tag: v2.6.1~19 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=74b458ceb2de45d70d47b9e40dd262ca86e33769;p=thirdparty%2FPython%2Fcpython.git Merged revisions 67343 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r67343 | amaury.forgeotdarc | 2008-11-22 21:01:18 +0100 (sam., 22 nov. 2008) | 5 lines #3996: On Windows, PyOS_CheckStack is supposed to protect the interpreter from stack overflow. But doing this, it always crashes when the stack is nearly full. Reviewed by Martin von Loewis. Will backport to 2.6. ........ --- diff --git a/Misc/NEWS b/Misc/NEWS index c7312baf15f3..1c8857691a7c 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -12,6 +12,10 @@ What's New in Python 2.6.1 alpha 1 Core and Builtins ----------------- +- Issue #3996: On Windows, the PyOS_CheckStack function would cause the + interpreter to abort ("Fatal Python error: Could not reset the stack!") + instead of throwing a MemoryError. + - Issue #4367: Python would segfault during compiling when the unicodedata module couldn't be imported and \N escapes were present. diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 4ff70d854302..54f3c5784bd8 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -1755,7 +1755,7 @@ PyOS_CheckStack(void) EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) { int errcode = _resetstkoflw(); - if (errcode) + if (errcode == 0) { Py_FatalError("Could not reset the stack!"); }