Re: seg fault on Read() objects from file

Rene Brun (Rene.Brun@cern.ch)
Fri, 23 Apr 1999 10:20:56 +0000


Hi Ulrich,
Could you send me your header file for the classes MeasurementData,
& object pointed by "annotation" (I suppose it is a TPaveText)
and the corresponding implementation files.

Rene Brun

Ulrich Jost wrote:
>
> Hello,
>
> in a program I write some root objects to a file with TObject::Write() and
> try to read them back with TObject::Read(), but get segmentation faults on
> the Read statement. Any ideas welcome.
> Ulrich
>
> TFile rfile("test.root" , "new");
> rfile.SetCompressionLevel(1);
> md->annotation->Write("annotation");
> ...
>
> TFile rfile("test.root", "read");
> if (rfile.IsOpen()){
> md = new MeasurementData(); // contains default constructors for root obj
> md->annotation->Read("annotation"); // segfault, trace back:
>
> #0 0x4037f5c7 in G__ClassInfo::IsValid ()
> #1 0x403801c5 in G__ClassInfo::New ()
> #2 0x407523ad in TClass::New ()
> #3 0x402c5a8d in TBuffer::ReadObject ()
> #4 0x4031e6c0 in operator>> ()
> #5 0x404eea2a in TCollection::Streamer ()
> #6 0x4050dd99 in TSeqCollection::Streamer ()
> #7 0x4050d749 in TList::Streamer ()
> #8 0x402c5ae9 in TBuffer::ReadObject ()
> #9 0x4050d71c in operator>> ()
> #10 0x405ab74d in TPaveText::Streamer ()
> #11 0x403229e4 in TKey::Read ()
> #12 0x40328095 in TObject::Read ()
> #13 0x806a7bf in MainWindow::treatList (this=0xbffff7e4, id=2) at
> src/probe_mainwindow.cpp:533