RE: [CINT] Re: [ROOT] Proble with TSPHE ctor

From: Philippe Canal (pcanal@fnal.gov)
Date: Fri Mar 05 2004 - 19:08:22 MET


Hi Nick,

Note that with valgrind 2.1.0 all the false report of errors coming
from the compression algorithm should be gone.

Cheers,
Philippe.

-----Original Message-----
From: owner-cint@pcroot.cern.ch [mailto:owner-cint@pcroot.cern.ch]On
Behalf Of Rene Brun
Sent: Friday, March 05, 2004 11:56 AM
To: Nick West
Cc: roottalk; cint@pcroot.cern.ch
Subject: [CINT] Re: [ROOT] Proble with TSPHE ctor


Hi Nick,

Thanks for reporting the special case of fNdiv when calling the TSPHE
constructor with floats. Now fixed in CVS.

Yes, we use valgrind to run systematic tests. Combinations like the one you are
reporting are difficult to find ::)
 -TSPHE obsoleted by the new TGeo classes
 -call to constructor with floats (it was OK in the constructor
  with doubles.

I run regularly valgrind on the Root tutorials and stress test suite.
I am aware of several problems in CINT (already reported to Masa).
Masa may want to comment on the status.

Rene Brun


Nick West wrote:
> 
> Dear Roottalk,
> 
> I want to report what is technically a bug, but won't do it via rootdev
> as I just want to
> say a big public THANK YOU, mostly to Masa, for fixing things a short
> while back
> 
>     http://root.cern.ch/root/cinttalk/cint03/0511.html
> 
>  so that Valgrind:-
> 
>     http://valgrind.kde.org/
> 
> doesn't choke with cosmetic errors anymore.  Valgrind really is a great
> tool.
> 
> The bug is in TSPHE.cxx.(cvs version)  In the method:-
> 
>   TSPHE::TSPHE(const char *name, const char *title,
>                const char *material,
>                Float_t rmin,
>                Float_t rmax,
>                Float_t themin,
>                Float_t themax,
>                Float_t phimin,
>                Float_t phimax)
> 
> the member variable fNdiv is initialised by the call:-
> 
>   SetNumberOfDivisions (20);
> 
> but that code is:-
> 
> void TSPHE::SetNumberOfDivisions (Int_t p)
> {
> 
>     if (GetNumberOfDivisions () == p) return;
>     fNdiv=p;
>     fNz = Int_t(fAspectRatio*fNdiv*(fThemax - fThemin )/(fPhimax -
> fPhimin )) + 1;
>     MakeTableOfCoSin();
> }
> 
> and GetNumberOfDivisions is simply:-
> 
>   irtual Int_t   GetNumberOfDivisions () const {return fNdiv;}
> 
> so fNdiv is tested before being set.  If you were really unlucky
> (randomly initialised to 20) the rest of the code in
> SetNumberOfDivisions would be skipped.
> 
> When I run Valgrind I still get some errors deep down in CINT and the
> data compression code although I am still running 3.10/01 so maybe it
> isn't an issue but it raises the question: is Valgrind routinely run on
> ROOT and if not would it be a good idea to do so?  If there are benign
> problems that cannot easily be fixed it would be great if there were
> some official Valgrind suppression file that people could use.
> 
> Cheers,
> 
> Nick West



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:06 MET