Stack filling.

Joel Sherrill <joel@OARcorp.com> joel.sherrill at OARcorp.com
Fri May 27 13:17:14 UTC 2005


Peter Dufault wrote:
> 
> On May 27, 2005, at 2:34 AM, Chris Johns wrote:
> 
>> The capture engine uses a value of 0xdeaddead and the stack checker  
>> uses a different more complex pattern. I do not mind what is used  so 
>> if you have a preference for any reason please say.
>>
>>
> I usually derive guard patterns from what I'm doing and force them  odd 
> by adding one to the last value if needed so they tend to be  unique 
> without resorting to a "central authority".  I think it's  still obvious 
> from the "all alpha" that it's a guard pattern.
> 
> enum guard_pattern {
>     capture_engine = 0xcaeecaef,  // CApturE EnginE CApturF...
>     stack_checker = 0xaccecead  // stACk ChECkEr stADk...
> };

Not a bad idea, but what if you want to run both?

If you want to do stack usage in the capture engine, then I would
suggest splitting the stack checker code into two pieces.  Stack
filling and usage helpers and the checking extension itself.
The stack checking code is fairly complicated and the amouunt of
guard checked varies based upon the CPU's stack frame and caching.
For example, the SPARC and i960 have relatively large call frame
caches before they write to memory.


Shouldn't really require much more than some mechanical code'
and file splitting.

--joel



More information about the users mailing list