|
From: Paul H. <pa...@ha...> - 2003-11-18 18:06:34
|
On Tue, 18 Nov 2003, Lee Kindness wrote: > Hi, > The attached test case results in different output when run under > Valgrind (version 2.0 & 1.9.6) compared to when it is run > stand-alone. This source makes use of nested functions. Most importantly, it makes use of 2 functions named "sel". And it is confusing them. Hmm, further experiments show that the bug persists if one of the sel()s is renamed. > The following is output when run normally: > % ./hmmlk 1 2 > bob is odd > bob is NOT even I added fprintf(stdout,"sel1\n"); to the first sel, and fprintf(stdout,"sel2\n"); to the second sel. Here is my output: sel1 bob is odd sel2 bob is NOT even > and when run under Valgrind (I've also attached verbose output): > > % valgrind ./hmmlk 1 2 > bob is odd > bob is even sel1 bob is odd sel1 bob is even > This source was compiled with GGC 3.2: > > gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5) > > without optimisation. > Has anyone else encountered this problem, or have any ideas on how to > get Valgrind to report the same results? Or is this a GCC bug? Don't nest the functions and it just works. > Thanks in advance, Lee Kindness. -- Paulh |