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 vstinner
Recipients amaury.forgeotdarc, vstinner
Date 2008-09-30.09:02:51
SpamBayes Score 2.4611673e-09
Marked as misclassified No
Message-id <1222765373.64.0.170534331375.issue3999@psf.upfronthosting.co.za>
In-reply-to
Content
@amaury.forgeotdarc: It looks like PyOS_CheckStack() is only 
implemented for Windows. It uses alloca() + __try/__except + 
_resetstkoflw(). The GNU libc nor Linux kernel don't check stack 
pointer on alloca(), it's just $esp += <alloca argument>. Using 
alloca() you may also be able to able outside the stack to move your 
stack pointer to the heap or another memory mapping. PyOS_CheckStack() 
doesn't really protect the stack: if a function use alloca() or a 
similar construction like « void test(int size) { char 
allocated_on_the_stack[size]; ... } », you will not catch this error.

PyOS_CheckStack() only checks one type of error: stack overflow. It 
doesn't check invalid memory read / write (see my first example, 
read.py).
History
Date User Action Args
2008-09-30 09:02:53vstinnersetrecipients: + vstinner, amaury.forgeotdarc
2008-09-30 09:02:53vstinnersetmessageid: <1222765373.64.0.170534331375.issue3999@psf.upfronthosting.co.za>
2008-09-30 09:02:53vstinnerlinkissue3999 messages
2008-09-30 09:02:52vstinnercreate