1

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.

Seva Alekseyev
  • 59,826
  • 25
  • 160
  • 281

1 Answers1

0

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?

Community
  • 1
  • 1
Andy Finkenstadt
  • 3,547
  • 1
  • 21
  • 25