[Python-bugs-list] [ python-Bugs-494668 ] PUSH() should assert-fail on overflow

noreply@sourceforge.net noreply@sourceforge.net
Tue, 18 Dec 2001 20:11:33 -0800


Bugs item #494668, was opened at 2001-12-18 09:23
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=494668&group_id=5470

Category: Python Interpreter Core
Group: Python 2.2
>Status: Closed
>Resolution: Fixed
Priority: 7
Submitted By: Tim Peters (tim_one)
Assigned to: Tim Peters (tim_one)
Summary: PUSH() should assert-fail on overflow

Initial Comment:
ceval's PUSH macro happily writes beyond the end of 
the eval stack if not enough space has been reserved 
for it.  While there are no known instances of stack 
overflow under normal operation (it "should be" 
impossible), code objects produced by the Python 
compiler package have failed to reserve enough stack 
space, leading to the usual range of corrupted-memory 
problems.  In a debug build the PUSH macro should 
verify that stack overflow doesn't occur.

----------------------------------------------------------------------

>Comment By: Tim Peters (tim_one)
Date: 2001-12-18 20:11

Message:
Logged In: YES 
user_id=31435

Stack limit asserts were added to

Python/ceval.c; new revision: 2.301

----------------------------------------------------------------------

Comment By: Tim Peters (tim_one)
Date: 2001-12-18 15:24

Message:
Logged In: YES 
user_id=31435

Assigned to me and boosted priority.  Rather than fiddle 
the PUSH macro, I intend to add some stack-limit asserts at 
the top of the eval loop (less potential for disruption 
because much less generated code, and should also catch 
stack underflows).

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=494668&group_id=5470