Re: TMap->Write() bug...?

Fons Rademakers ((no email))
Wed, 9 Apr 1997 11:53:26 +0200 (METDST)


Hi Reid,

I'll track down and fix the bug asap. However, this week all developers
are attending a conference in Berlin so it might take a few days longer
than you are used too (hopefully fixed by the end of the weekend).

Cheers, Fons.

PS: thanks for the compliments. Also, you might be interested in the PROOF
developments. The current release only works for 1D histograms, but the
final 1.00 will work for all TTree and TChain operations. For more
details on PROOF check out conference talk (see chep slides in the
ROOT News web page).

>
> Hi there,
>
> First off, congratulations to the ROOT developers for getting v1.0
> beta out and addressing many of my concerns/confusions/bug reports.
>
> Now, well, I'm still having a few problems with the latest version...
> I'm trying to store a TMap as a single object in a TFile and running
> into a segmentation violation deep in the ROOT source code. Here's
> the gdb output, with the segv happening at the TMap->Write("Map", 1)
> call in main.cc:
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x3ffbfb7db50 in operator== () at BASE_String.cxx:5
> BASE_String.cxx:5: No such file or directory.
> (gdb) where
> #0 0x3ffbfb7db50 in operator== () at BASE_String.cxx:5
> #1 0x3ffbfb661c8 in TObjString::IsEqual () at BASE_G__Base.cxx:5
> #2 0x3ffbfc6d390 in TAssoc::IsEqual () at CONT_Map.cxx:5
> #3 0x3ffbfc30d60 in TCollection::FindObject () at CONT_Collection.cxx:5
> #4 0x3ffbfc690ac in THashTable::FindObject () at CONT_HashTable.cxx:5
> #5 0x3ffbfc6c72c in TMap::GetValue () at CONT_Map.cxx:5
> #6 0x3ffbfad2d30 in TBuffer::WriteObject () at BASE_Buffer.cxx:5
> #7 0x3ffbfc6e894 in TObjArray::Streamer () at CONT_ObjArray.cxx:5
> #8 0x3ffbfad2ecc in TBuffer::WriteObject () at BASE_Buffer.cxx:5
> #9 0x3ffbfc6cc74 in TMap::Streamer () at CONT_Map.cxx:5
> #10 0x3ffbfb67520 in TKey::TKey () at BASE_Key.cxx:5
> #11 0x3ffbfb71024 in TObject::Write () at BASE_Object.cxx:5
> #12 0x3ffbfc31ac4 in TCollection::Write () at CONT_Collection.cxx:5
> #13 0x1200120a8 in main (argc=5, argv=0x1a) at main.cc:181
> (gdb)
>
> Ouch. Some details:
>
> 1. The key in the TMap is a TObjString, and the value is a TObjArray.
> The TObjArray contains a class called "IntWrapper", which is just
> derived from TObject and contains an int. (It's a lot like the
> TObjNum class in tcollex.cxx; it's sort of a hack to get an array of
> integers stored as the value of the TMap.)
>
> 2. The program DOES work for a very small number of TMap entries (20
> or 30). Unfortunately, we'll be working with thousands to millions...
>
> 3. I can iterate through the TMap at any size, and its Print method
> works fine, so it seems like the TMap object itself is okay.
>
> I've been looking at the ROOT source code (which is new to me), but
> it's a lot to get a handle on and I can't find anything...
>
> Thanks in advance for suggestions or help. I can provide real source
> code, too, if anyone would like, or more details if I forgot
> something.
>
> Reid
>

-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland          Phone: +41 22 7679248
E-Mail: Fons.Rademakers@cern.ch              Fax:   +41 22 7677910