|
From: Henrik N. <hn...@ma...> - 2004-05-04 10:36:18
|
On Tue, 4 May 2004, Nicholas Nethercote wrote: > As for the redzone suggestion, I think Memcheck/Addrcheck already put > redzones at the end of thread stacks, so any overruns of that sort should > be caught... I could be wrong about that, though. Still it would be nice to have answered if it is OK to manually place redzones in stacks. I assume one must/should reset the memory area before returning from the function where the zone is defined (before stack frame freed), but is there any other gotchas wrt how Valgrind tracks stack usage to think of when doing this kind of things? Manually adding stack redzones could be quite useful for detecting stack based buffer overflows and similar things, but with the stack managed slightly differently than the heap I am a little scared about upsetting valgrind if playing around with this, but maybe there is nothing to worry about? (assuming one properly cleans up after oneself, not leaving redzones in freed stack frames, messing up later reuse of the same stack space in another call) Regards Henrik |