Re: Stack Overflow Detection
- From: Lanarcam <lanarcam1@xxxxxxxx>
- Date: Fri, 30 May 2008 20:44:45 +0200
Richard Phillips wrote:
Hello all,
I'm thinking about implementing the above in a system I'm working on, does anyone have a good strategy for doing this?
One possibility is having an area of RAM (beyond the stack "area") filled with known data, if any of that data gets trashed then assume the stack has overflowed. What are the pros and cons of this?
It is commonly used. You can fill the stack area with a known
value and check the highest level actually reached. You can
then double the amount of space for good measure. This is not
a guarantee, of course.
Another idea is to actually watch the SP, but one drawback is if I check this at a predefined point in the code, then it's possible the worst case scenario will occur between checks?
Any better ideas?
Perform blackbox and whitebox testing, make sure all
paths are taken, you will have a better idea, but
still no guarantee.
.
- References:
- Stack Overflow Detection
- From: Richard Phillips
- Stack Overflow Detection
- Prev by Date: Re: Driving tri-state LED matrix
- Next by Date: Re: Stack Overflow Detection
- Previous by thread: Re: Stack Overflow Detection
- Next by thread: Re: Stack Overflow Detection
- Index(es):
Relevant Pages
|