views:

78

answers:

3

I want to know how do we proceed to debug a STACKOVERFLOW issue on targets . I mean what are the steps we should follow to reach a conclusion.

+1  A: 

Put a memory write watchpoint for one word past the end of your stack space. Then the debugger will break in when that spot gets written to, and you can see what's at fault.

Carl Norum
This looks like an good option ,will try this one
dara
A: 

Run it through a debugger such as gdb. The backtrace at the time of the stack overflow will tell you exactly which function or functions are repeating indefinitely. From there, figure out which input(s) to those functions are not changing, and not moving the function (if it's recursive) towards a base-case that will end the recursion.

Thanatos
+1  A: 

All stacks can be filled at start up with certain hex value (for example 0xAAAAAAAA). And then using special routine you can monitor all stack's maximum usage periodically by calculating the quantity of known values (0xAA..) from end of stack until finds the first difference.

Pmod