Of course it could be a case of stack corruption. Then there is no easy way to get the stack at all.
The stack contains your local vars, and then also the return address, and internal info (I think, but need to check, the previous "basepointer" which might eventually become stackpointer.
If you have a local var "Foo: array [1..4] of integer" and you do "Foo[-1] := 1;" then you may destroy those internal values.
I am not 100% sure that such an "overwrite" could cause a stack overflow. But it probably can...
Make sure to have all range checks and stuff turned on.
What version of fpc... Arg, got it. Mind, while I am replying, I can only see your message text, but not your signature. Please put info like this in the actual message.
Try it, hit reply, then look for my message below the reply edit field. You will see my msg, but no signature.
Fpc 3.2.2.
Are you compiling with/without optimizations?
If "with", does it happen without too?