We have adopted Valgrind as a periodic QA measure: every six months, 
we run all our tests through it. This takes a couple of months for 
everything to run, so we don't feel we can do it more often. What 
it finds for us is uninitialized variable errors; our internal memory
management takes big chunks from malloc/free, and splits them up 
in lots of ways, and we haven't seriously attacked the problem of 
teaching Valgrind about it yet. 

The first pass, a year ago, found lots of stuff, since the code has
been under development for more than 20 years. The second found less,
and the third, recently completed, less still; developers seem to be 
getting used to the idea and being more conscious of the kinds of 
errors that Valgrind finds, which is good. 

So far, we'd done all of the work on AMD64 Linux, since we consider 
that the main variant of the platform, and the x86 to be something 
we want to phase out, when we get the chance. But we tried Valgrind
on it, and found that there's a definite style of uninitialized
variable errors that show up on 32-bit but not 64-bit. 

These are C "auto" variables, of integer and logical types, in 
functions that have a reasonable number of such. I suspect that 
in 64-bit code, with more registers available, these go into 
registers, and that Valgrind can't tell when a register stops 
being used for one variable by the compiler and gets allocated
to another. 

If I'm possibly right about that, it begs the question of "could
we find more errors if we had no variables in registers at all?"
I'm currently working with optimised production builds for the 
initial scan, and de-optimising files in which that shows 
uninitialized variable errors while investigating them. I'm not 
getting extra ones showing up when I do that, but the number of 
errors we've found and fixed so far, about 200, is much less 
than the number of source files (about 4000), we could be missing 
them. 

Does GCC 4.1 still allocate variables to registers with optimisation
turned off? 

thanks,

-- 
John Dallman
Parasolid Porting Engineer


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to