I run the code on windows xp. By default code on stack cannot be executed. Is there a compiler option to disable this trampoline trick?
-- Regis Cridlig cridlig@gmail.com
Le 4 avr. 08 à 17:29, Waldek Hebisch hebisch@math.uni.wroc.pl a écrit :
Regis Cridlig wrote:
I have attached the assembly code generated by the command: gpc crashes.p -S It is only two pages :-)
Thanks, the code looks OK. But the program uses a special feature called "trampolines": it writes instructions (a small routine) on the stack and executes that code on the stack.
Trampolines are used to support nested functions as procedure parameters. However, various security measures sometimes disallow executing code on the stack. In particular on reasonably new processors Windows can make stack non-executable. So, I suspect that your Windows detected that program tries to execute code on the stack and signaled error. In such case you need to enable executiong code on the stack.
BTW: What is your Windows version? You seem to be the first to have problem with non-executable stack on Windows.
-- Waldek Hebisch hebisch@math.uni.wroc.pl