I have a Android NDK project in C++. Customers are complaining of intermittent, irreproducible glitches. I suspect a memory corruption bug somewhere. I already have a malloc barrier; now I want to check for stack corruption.
GCC's -fstack-protector sounds too extreme to me; when it detects a bug, it just kills the program; I want something more user-friendly (a message, THEN kill :)). Question - is there a way to implement, under GCC, a stack consistency checker under programmer's control? I don't mind inline assembly.
Some predefined macros that expose the stack frame structure, for example, would come in handy.