|
From: Tom H. <th...@cy...> - 2004-08-25 21:35:14
|
In message <207...@we...>
"Jeroen N. Witmond" <jn...@xs...> wrote:
> It looks as if I have stumbled across a bug in the way valgrind (CVS)
> handles signal SIGFPE. To demonstrate this problem, I have created and
> attached file SIGFPEc.c.
>
> The problem: When I run this program stand-alone [output in attached file
> SIGFPEc.check.txt], it shows that that siginfo->si_addr points somewhere
> in my executable. But when I run the very same executable under valgrind
> --tool=memcheck [output in attached file SIGFPEc.valgrind.txt],
> siginfo->si_addr points somewhere in valgrind's stage2.
With SIGFPE si_addr is the address of the faulting instruction. When
running under valgrind all instructions in your program are simulated
by valgrind which does a just in time translation of your code.
As a result the faulting instruction will always be in a different
place when running under valgrind. In particular in this case the
fault is probably occurring in one of the helper routines which is
used to handle division operations, hence the reason why the address
is inside stage2 as that is where the helper routines are.
Tom
--
Tom Hughes (th...@cy...)
Software Engineer, Cyberscience Corporation
http://www.cyberscience.com/
|