Page 1 of 1

Implications of "Procedure stack has been corrupted" error

Posted: Fri Nov 06, 2015 9:55 pm
by bbanelli
Greetings to all,

I have enabled Purifier for one of my ("complex" in terms of WinAPI usage) projects and reached multiple "Procedure stack has been corrupted" errors.

Application works "fine" (well, at least as tested in production), though.

I get these errors on AllocateMemory functions, CallFunctionFast (which should be rewritten with prototypes, I know!) and PeekX functions.

Is there any general approach I should use to see why this happens?

Thank you in advance,

Bruno

Re: Implications of "Procedure stack has been corrupted" err

Posted: Fri Nov 06, 2015 10:04 pm
by netmaestro
You're going to be misunderstanding the memory usage of one or more api's, causing you to write past the end of allocated memory. You can get away with that as long as the memory isn't spoken for but even one time when it is - crash. Take a 'pressed down and running over' approach to allocating memory, making sure you are allocating every last byte your api will need. There is no penalty of any kind for allocating a few extra bytes, it's just good practice.