[ROOT] Re: [CINT] Problems with CINT when running valgrind,

From: Masaharu Goto (MXJ02154@niftyserve.or.jp)
Date: Thu Sep 18 2003 - 13:48:33 MEST


Hello Rene,

Thank you for the information.  Now, I understand cause of the
uninitialized memory access.  Although valgrind reports it only for
float, it is the same for all other types.  I fixed this. However,
this access is harmless  and besides that the fix may cause side
effect. So, I'll make the change optional when compiling Cint.
The fix is activated only if G__AVOID_PTR_UNINITACCESS.

I also eliminated cause of compiler warnings.  For unused parameter
warning, I'll make it optional with G__SUPPRESS_UNUSEDPARA
macro defined.   I recommend to take out -Wunused-parameter. This
warning leads more problem than a benefit.

Thank you
Masa Goto


----- Original Message -----
From: "Rene Brun" <Rene.Brun@cern.ch>
To: "Masaharu Goto" <MXJ02154@niftyserve.or.jp>
Cc: <cint@pcroot.cern.ch>
Sent: Thursday, September 18, 2003 12:19 AM
Subject: Re: [CINT] Problems with CINT when running valgrind,


> Hi Masa,
>
> I have investigated when the errors like below appear
>
> > ==4409==    at 0x408E111A: G__getvariable (var.c:4329)
> > ==4409==    by 0x4081A49A: G__getitem (expr.c:2115)
> > ==4409==    by 0x40818259: G__getexpr (expr.c:1503)
> > ==4409==    by 0x408253F2: G__getfunction (func.c:1877)
> > 2  0x408e111a in G__getvariable (item=0xbffc6c90 "E33",
known2=0xbffc654c,
> >     varglobal=0x40994320, varlocal=0xbffd7800) at cint/src/var.c:4329
> > 4329            G__GET_VAR(G__FLOATALLOC,float ,G__letdouble,'f','F')
>
> A user has a class "h1analysis" with members like
>    TTree          *fChain;
>    Int_t           nrun;
>    Int_t           nevent;
>    Int_t           nentry;
>    UInt_t          trelem[192];
>    UInt_t          subtr[128];
>    UInt_t          rawtr[128];
>    UInt_t          L4subtr[128];
>    UInt_t          L5class[32];
>    Float_t         E33;
>    Float_t         de33;
>    Float_t         x33;
>
> The class constructor is called
>   h1analysis a;
> then a function is called
>   a.Init();
> with statements like:
>
>    fChain->SetBranchAddress("nrun",&nrun);
>    fChain->SetBranchAddress("nevent",&nevent);
>    fChain->SetBranchAddress("nentry",&nentry);
>    fChain->SetBranchAddress("trelem",trelem);
>    fChain->SetBranchAddress("subtr",subtr);
>    fChain->SetBranchAddress("rawtr",rawtr);
>    fChain->SetBranchAddress("L4subtr",L4subtr);
>    fChain->SetBranchAddress("L5class",L5class);
>    fChain->SetBranchAddress("E33",&E33);    //<=====where it complains
>    fChain->SetBranchAddress("de33",&de33);
>    fChain->SetBranchAddress("x33",&x33);
>
> I have indicated above the line being executed by CINT when
> valgring complains that an unitialized variable is used.
> In this particular example, the address of member E33 is passed
> to the function SetBranchAddress. CINT seems to use the content
> of this address and it should not.
> Note that this problem does not happen for Int_t variables,
> only for Float_t!
>
> Rene
>



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:15 MET