|
From: Tom H. <th...@cy...> - 2004-01-18 13:19:20
|
In message <200...@we...>
Steve G <lin...@ya...> wrote:
> Which brings up a point...couldn't valgrind find these, too? If
> there is a write to the return address on the stack, this could
> be emitted as a warning. It is rare to find trampoline code in
> applications. It is more common to find this as a programming
> error.
The problem is that valgrind doesn't have a concept of write protected
memory. It has the idea of unadressable memory that you can't read from
or write to, and undefined memory that you can write to but not read
from but it has no concept of memory that can be read from but not
written to which is what is needed here.
One of my colleages did modify valgrind to mark the return address
on the stack as unadressable but the problem with that is that you
also have to make it spot valid reads so that it doesn't complain
about them - the ret instruction is easy, but things like alloca do
all sorts of wierd stunts with the stack that sometimes involves
moving the return address.
Tom
--
Tom Hughes (th...@cy...)
Software Engineer, Cyberscience Corporation
http://www.cyberscience.com/
|