TMap->Write() bug...?

From: Reid D Rivenburgh (reid@lanl.gov)
Date: Wed Apr 09 1997 - 10:03:35 MEST


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



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:26:18 MET