Author vstinner
Recipients amaury.forgeotdarc, vstinner
Date 2008-09-30.09:02:51
SpamBayes Score 2.46117e-09
Marked as misclassified No
Message-id <>
@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,
Date User Action Args
2008-09-30 09:02:53vstinnersetrecipients: + vstinner, amaury.forgeotdarc
2008-09-30 09:02:53vstinnersetmessageid: <>
2008-09-30 09:02:53vstinnerlinkissue3999 messages
2008-09-30 09:02:52vstinnercreate