Re: Stack Overflow Detection
- From: Robert Adsett <sub2@xxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 30 May 2008 21:11:16 -0400
In article <dba53bb3-4682-425b-8bc1-
7c034d2187aa@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>, Tomás Ó hÉilidhe says...
On May 30, 3:51 pm, "Richard Phillips" <raphill...@xxxxxxxxxxxx>
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?
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?
Obviously if the stack overflows then that's a sign of flaw in the
programming,
Or in some systems, HW failures, EMI or radiation events.
so really you're trying to implement a system that
accommodates buggy programming and just peforms a "salvage operation"
by killing the program before it can do any damage... do I understand
correctly?
That's one option. Sometimes runtime stacks are set much larger than
expected need and instrumented like this to verify/determine (to some
statistical significance) the actual stack usage.
Assuming that I'm right in saying that you'll just kill the program if
the stack overflows, what will be the benefit of this? Will it stop
the Green Laser of Death from being turned on, or will it stop
permanent storage from being corrupted or something like that?
Quite possibly all of the above. Or maybe it just irritates the user.
Sometimes resetting is not really an option.
Robert
** Posted from http://www.teranews.com **
.
- References:
- Stack Overflow Detection
- From: Richard Phillips
- Re: Stack Overflow Detection
- From: Tomás Ó hÉilidhe
- Stack Overflow Detection
- Prev by Date: Re: Driving tri-state LED matrix
- Next by Date: Any recommendations for audio player microcontrollers?
- Previous by thread: Re: Stack Overflow Detection
- Next by thread: Re: Stack Overflow Detection
- Index(es):
Relevant Pages
|