开发者

DIY stack protection

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, woul开发者_开发百科d come in handy.


See the top-most answer to this question, on why stack-protecter is for hardening, and not debugging: When and how to use GCC's stack protection feature?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜