Skip to content

Commit af04d3f

Browse files
author
amaury.forgeotdarc
committed
#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. git-svn-id: http://svn.python.org/projects/python/trunk@67343 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent 1a9ab74 commit af04d3f

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

Misc/NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ What's New in Python 2.7 alpha 1
1212
Core and Builtins
1313
-----------------
1414

15+
- Issue #3996: On Windows, the PyOS_CheckStack function would cause the
16+
interpreter to abort ("Fatal Python error: Could not reset the stack!")
17+
instead of throwing a MemoryError.
18+
1519
- Issue #4367: Python would segfault during compiling when the unicodedata
1620
module couldn't be imported and \N escapes were present.
1721

Python/pythonrun.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1755,7 +1755,7 @@ PyOS_CheckStack(void)
17551755
EXCEPTION_EXECUTE_HANDLER :
17561756
EXCEPTION_CONTINUE_SEARCH) {
17571757
int errcode = _resetstkoflw();
1758-
if (errcode)
1758+
if (errcode == 0)
17591759
{
17601760
Py_FatalError("Could not reset the stack!");
17611761
}

0 commit comments

Comments
 (0)