RE: [ROOT] Problem in TStreamerInfo for old class version

From: Philippe Canal (pcanal@fnal.gov)
Date: Sat Jul 03 2004 - 00:39:27 MEST


Hi Ruben,

> I have tried to reproduce the old class version, now the fCluster seems to 
> get correct offset, but it still crashes:

So my guess is that it does not crash because of the change regarding fClusters.

In addition:
  ReadBuffer, class:NaDigit1D, name=fTracks, fType[3]=62, 
  TStreamerObjectAny, bufpos=411, arr=0x9e3c4b0, offset=20
seems to indicate that the crash happens while reading the fTracks pointer.

I think you problem is linked to the fact that you have a class NaStripDigit
which inherits from NaDigit1D.  

I fixed a related problem in ROOT 4.00/04.

If you are not already using ROOT 4.00/04 or a more recent version, try upgrading.

If you already use a recent version, please send me a complete 
example (i.e. old ROOT files and new header files library) and I 
will fix this problem.

Also you can probably work-around the problem by increasing the version number
of NaStripDigit (yes NaStripDigit) and recompiling.

Cheers,
Philippe.

-----Original Message-----
From: owner-roottalk@pcroot.cern.ch
[mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Ruben Shahoyan
Sent: Tuesday, June 29, 2004 11:34 AM
To: roottalk@cern.ch
Subject: [ROOT] Problem in TStreamerInfo for old class version


Dear Rene,
we have the problem to read an old root tree (created in v_3.05).
The tree contains the TObjArray of TClonesArrays of the objects
derived from NaDigit1D class.
At the moment of the creation of the tree the class had following members
{
protected
  Int_t fI;             // Value of the digit
  Int_t fCluster;       // Number of the Cluster to which it is attached
  TArrayI* fTracks;     // Optional array of references on track
  Float_t fXYZE[4];
  ClassDef(NaDigit1D,2) // Base class for 1Dim digits with FULL TRACKING INFO
}

while now it was converted to (fCluster become non-persistent)

{
protected
  Int_t fI;             // Value of the digit
  Int_t fCluster;       //! Number of the Cluster to which it is attached
  TArrayI* fTracks;     // Optional array of references on track
  Float_t fXYZE[4];
  ClassDef(NaDigit1D,4) // Base class for 1Dim digits with FULL TRACKING INFO
}

When we read an old tree, we get the seg.viol (gDebug=2)

...
====>Rebuilding TStreamerInfo for class: NaStripDigit, version: 1

====>Rebuilding TStreamerInfo for class: NaDigit1D, version: 2
Creating StreamerInfo for class: NaDigit1D, version: 4
 
StreamerInfo for class: NaDigit1D, version=4
  TObject        BASE            offset=  0 type=66 Basic ROOT object
  Int_t          fI              offset= 12 type= 3 Value of the digit
  TArrayI*       fTracks         offset= 20 type=69 Optional array of references on track
  Float_t        fXYZE[4]        offset= 24 type=25
   i= 0, TObject         type= 66, offset=  0, len=1, method=0
   i= 1, fI              type=  3, offset= 12, len=1, method=0
   i= 2, fTracks         type= 69, offset= 20, len=1, method=0
   i= 3, fXYZE           type= 25, offset= 24, len=4, method=0
Warning in <TStreamerInfo::BuildOld>: element: NaDigit1D::Float_t fXYZE has new type: Float_t/25
 
StreamerInfo for class: NaDigit1D, version=2
  TObject        BASE            offset=  0 type=66 Basic ROOT object
  Int_t          fI              offset= 12 type= 3 Value of the digit
  Int_t          fCluster        offset=99999 type= 3 Number of the Cluster to which it is attached
  TArrayI*       fTracks         offset= 20 type=62 Optional array of references on track
  Float_t        fXYZE[4]        offset= 24 type=25
   i= 0, TObject         type= 66, offset=  0, len=1, method=0
   i= 1, fI              type=  3, offset= 12, len=1, method=0
   i= 2, fCluster        type=103, offset=99999, len=1, method=0
   i= 3, fTracks         type= 62, offset= 20, len=1, method=0
   i= 4, fXYZE           type= 25, offset= 24, len=4, method=0
StreamerInfo for class: NaStripDigit, version=1
  NaDigit1D      BASE            offset=  0 type= 0 Base class for 1Dim digits with FULL TRACKING INFO
  Float_t        fAmplitude      offset= 40 type= 5 Signal in the strip
   i= 0, NaDigit1D       type=  0, offset=  0, len=1, method=165954728
   i= 1, fAmplitude      type=  5, offset= 40, len=1, method=0
ReadBuffer, class:NaStripDigit, name=NaDigit1D, fType[0]=0, TStreamerBase, 
bufpos=177, arr=0x9e3c4b0, offset=0
ReadBuffer, class:NaDigit1D, name=TObject, fType[0]=66, TStreamerBase, 
bufpos=177, arr=0x9e3c4b0, offset=0
ReadBuffer, class:NaDigit1D, name=fI, fType[1]=3, TStreamerBasicType, 
bufpos=307, arr=0x9e3c4b0, offset=12
ReadBuffer, class:NaDigit1D, name=fCluster, fType[2]=103, 
TStreamerBasicType, bufpos=359, arr=0x9e3c4b0, offset=99999
ReadBuffer, class:NaDigit1D, name=fTracks, fType[3]=62, 
TStreamerObjectAny, bufpos=411, arr=0x9e3c4b0, offset=20
 
 *** Break *** segmentation violation
 Generating stack trace...
/usr/bin/addr2line: na60root: No such file or directory
/usr/bin/addr2line: na60root: No such file or directory
 0x478cd188 in <unknown> from /lib/i686/libc.so.6
 0x42274f71 in G__CallFunc::Exec(void *) + 0x71 from 
/home/offline/root_libc2.2/lib/libCint.so
 0x41c9fa47 in TClass::Streamer(void *, TBuffer &) + 0x29b from 
/home/offline/root_libc2.2/lib/libCore.so
 0x41cc8bbb in TStreamerInfo::ReadBuffer(TBuffer &, void *, int, int, int, 
int) + 0x2e47 from /home/offline/root_libc2.2/lib/libCore.so
 0x41cc8cc5 in TStreamerInfo::ReadBuffer(TBuffer &, void *, int, int, int, 
int) + 0x2f51 from /home/offline/root_libc2.2/lib/libCore.so
 0x41cc90df in TStreamerInfo::ReadBufferClones(TBuffer &, TClonesArray *, 
int, int, int) + 0x43 from /home/offline/root_libc2.2/lib/libCore.so
 0x41c7f750 in TClonesArray::Streamer(TBuffer &) + 0x2bc from 
/home/offline/root_libc2.2/lib/libCore.so
 0x41c9f8e5 in TClass::Streamer(void *, TBuffer &) + 0x139 from 
/home/offline/root_libc2.2/lib/libCore.so
 0x41c0ebaa in TBuffer::ReadObjectAny(TClass const *) + 0x382 from 
/home/offline/root_libc2.2/lib/libCore.so
 0x41c81c35 in TBuffer & operator>><TObject>(TBuffer &, TObject *&) + 0x39 
from /home/offline/root_libc2.2/lib/libCore.so
 0x41c8ad00 in TObjArray::Streamer(TBuffer &) + 0x10c from 
/home/offline/root_libc2.2/lib/libCore.so
 0x42984943 in TLeafObject::ReadBasket(TBuffer &) + 0x117 from 
/home/offline/root_libc2.2/lib/libTree.so
 0x42969a8d in TBranch::ReadLeaves(TBuffer &) + 0x39 from 
/home/offline/root_libc2.2/lib/libTree.so
 0x42968cd8 in TBranch::GetEntry(int, int) + 0x1bc from 
/home/offline/root_libc2.2/lib/libTree.so
 0x42974643 in TBranchObject::GetEntry(int, int) + 0x137 from 
/home/offline/root_libc2.2/lib/libTree.so
 0x4298ee80 in TTree::GetEntry(int, int) + 0x98 from 
/home/offline/root_libc2.2/lib/libTree.so

As one can notice, the fCluster gets type=103, offset=99999 !

I have tried to reproduce the old class version, now the fCluster seems to 
get correct offset, but it still crashes:

====>Rebuilding TStreamerInfo for class: NaStripDigit, version: 1
 
====>Rebuilding TStreamerInfo for class: NaDigit1D, version: 2
Warning in <TStreamerInfo::BuildOld>: element: NaDigit1D::Float_t fXYZE 
has new type: Float_t/25
 
StreamerInfo for class: NaDigit1D, version=2
  TObject        BASE            offset=  0 type=66 Basic ROOT object
  Int_t          fI              offset= 12 type= 3 Value of the digit
  Int_t          fCluster        offset= 16 type= 3 Number of the Cluster 
to which it is attached
  TArrayI*       fTracks         offset= 20 type=62 Optional array of 
references on track
  Float_t        fXYZE[4]        offset= 24 type=25
   i= 0, TObject         type= 66, offset=  0, len=1, method=0
   i= 1, fI              type=  3, offset= 12, len=1, method=0
   i= 2, fCluster        type=  3, offset= 16, len=1, method=0
   i= 3, fTracks         type= 62, offset= 20, len=1, method=0
   i= 4, fXYZE           type= 25, offset= 24, len=4, method=0
 
StreamerInfo for class: NaStripDigit, version=1
  NaDigit1D      BASE            offset=  0 type= 0 Base class for 1Dim 
digits with FULL TRACKING INFO
  Float_t        fAmplitude      offset= 40 type= 5 Signal in the strip
   i= 0, NaDigit1D       type=  0, offset=  0, len=1, method=166360240
   i= 1, fAmplitude      type=  5, offset= 40, len=1, method=0
ReadBuffer, class:NaStripDigit, name=NaDigit1D, fType[0]=0, TStreamerBase, 
bufpos=177, arr=0x9ce4e98, offset=0
ReadBuffer, class:NaDigit1D, name=TObject, fType[0]=66, TStreamerBase, 
bufpos=177, arr=0x9ce4e98, offset=0
ReadBuffer, class:NaDigit1D, name=fI, fType[1]=3, TStreamerBasicType, 
bufpos=307, arr=0x9ce4e98, offset=12
ReadBuffer, class:NaDigit1D, name=fCluster, fType[2]=3, 
TStreamerBasicType, bufpos=359, arr=0x9ce4e98, offset=16
ReadBuffer, class:NaDigit1D, name=fTracks, fType[3]=62, 
TStreamerObjectAny, bufpos=411, arr=0x9ce4e98, offset=20
 
 *** Break *** segmentation violation

Could you please suggest anything?

Best regards,
	Ruben
-- 



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