Implications of "Procedure stack has been corrupted" error

Everything else that doesn't fall into one of the other PB categories.
User avatar
bbanelli
Enthusiast
Enthusiast
Posts: 544
Joined: Tue May 28, 2013 10:51 pm
Location: Europe
Contact:

Implications of "Procedure stack has been corrupted" error

Post 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
"If you lie to the compiler, it will get its revenge."
Henry Spencer
https://www.pci-z.com/
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

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

Post 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.
BERESHEIT
Post Reply