Message74067
@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). |
|
Date |
User |
Action |
Args |
2008-09-30 09:02:53 | vstinner | set | recipients:
+ vstinner, amaury.forgeotdarc |
2008-09-30 09:02:53 | vstinner | set | messageid: <1222765373.64.0.170534331375.issue3999@psf.upfronthosting.co.za> |
2008-09-30 09:02:53 | vstinner | link | issue3999 messages |
2008-09-30 09:02:52 | vstinner | create | |
|