kaliveda-dev team mailing list archive
-
kaliveda-dev team
-
Mailing list archive
-
Message #01571
[Bug 1399661] [NEW] A bit of a misunderstanding between KVSeqCollection::SetCleanups() and gRoot->GetListOfCleanups()
Public bug reported:
First, some command lines in root to illustrate this report:
----------------------------------------------------
root [0] KVList *l2 = new KVList
Warning in <TClass::TClass>: no dictionary for class KVSeqCollection is available
root [1] l2->GetName()
(const char* 0x913db40)"KVSeqCollection_2"
root [2] l2->SetCleanup()
root [3] KVList *l3 = (KVList *)l2->Clone()
root [4] l3->GetName()
(const char* 0x916b518)"KVSeqCollection_2"
root [5] l3->IsCleanup()
(const Bool_t)1
root [6] gROOT->GetListOfCleanups()->Print()
Collection name='Cleanups', class='THashList', size=8
Collection name='TObjArray', class='TObjArray', size=10
Collection name='Canvases', class='TList', size=0
Collection name='Browsers', class='TList', size=0
Collection name='Tasks', class='TList', size=0
Collection name='Files', class='TList', size=0
Collection name='ClosedFiles', class='TList', size=0
OBJ: TCint C/C++ CINT C/C++ Interpreter
Collection name='KVSeqCollection_2', embedded list class='TList', size=0
root [7] gROOT->GetListOfCleanups()->Last()
(const class TObject*)0x913dab8
root [8] l2
(class KVList*)0x913dab8
root [9] l3
(class KVList*)0x916b730
root [10] l2->SetCleanup()
root [11] l2->SetCleanup()
root [12] gROOT->GetListOfCleanups()->Print()
Collection name='Cleanups', class='THashList', size=10
Collection name='TObjArray', class='TObjArray', size=10
Collection name='Canvases', class='TList', size=0
Collection name='Browsers', class='TList', size=0
Collection name='Tasks', class='TList', size=0
Collection name='Files', class='TList', size=0
Collection name='ClosedFiles', class='TList', size=0
OBJ: TCint C/C++ CINT C/C++ Interpreter
Collection name='KVSeqCollection_2', embedded list class='TList', size=0
Collection name='KVSeqCollection_2', embedded list class='TList', size=0
Collection name='KVSeqCollection_2', embedded list class='TList', size=0
----------------------------------------------------
1) we see that the list l3 (line [4]) has the same name as the list l2 (line [1]). This may be a problem
for the looking-up in gROOT->GetListOfCleanups() which is a THashList.
So in the methods Streamer(...) (called by Clone()) and Copy(...) the object should keep its first name (individual name).
2) since l3 is a clone of l2 and l2 has IsCleanup() status then l3 has
the same one, I am agree. Nevertheless it does not appear in the list of
Cleanups as shown in line [6]. indeed, according to line [7,8,9] only l2
is present in gROOT->GetListOfCleanups().
3) we can see lines [10,11,12] that the list l2 appears in the
gROOT->GetListOfCleanups() as often as we call l2->Cleanup().
These 3 problems seems to be the origin of a segmentation violation that I obtain when I play with the KVIDZAGrid::SetEditable() toggle method. It is difficult to reproduce this bug.
SetEditable() calls UpdateLastSavedVersion() method.
In this method a new KVIDGraph (grid_copy) is built. grid_copy has two Cleanup lists (fCuts and fIdentifiers), and both are added to the THashList gROOT->GetListOfCleanups().
When a copy of the initial grid (grid_init) is made in grid_copy then the name of its lists (fCuts and fIdentifiers) is changed. Now, if program tries to find these lists in gROOT->GetListOfCleanups(), a segmentation violation may be produced since the hash value of their new name may be different. Indeed, it is their initial name that was used to add them in gROOT->GetListOfCleanups().
KaliVeda version: 1.9 and IV
** Affects: kaliveda
Importance: Low
Status: New
** Affects: kaliveda/1.9
Importance: Low
Status: New
** Tags: cleanup cleanups kvseqcollection
** Also affects: kaliveda/1.9
Importance: Low
Status: New
** Branch linked: lp:~indra-vamos/kaliveda/IV
** Branch linked: lp:kaliveda
--
You received this bug notification because you are a member of KaliVeda
Development Team, which is subscribed to KaliVeda.
https://bugs.launchpad.net/bugs/1399661
Title:
A bit of a misunderstanding between KVSeqCollection::SetCleanups() and
gRoot->GetListOfCleanups()
Status in KaliVeda data analysis framework:
New
Status in KaliVeda 1.9 series:
New
Bug description:
First, some command lines in root to illustrate this report:
----------------------------------------------------
root [0] KVList *l2 = new KVList
Warning in <TClass::TClass>: no dictionary for class KVSeqCollection is available
root [1] l2->GetName()
(const char* 0x913db40)"KVSeqCollection_2"
root [2] l2->SetCleanup()
root [3] KVList *l3 = (KVList *)l2->Clone()
root [4] l3->GetName()
(const char* 0x916b518)"KVSeqCollection_2"
root [5] l3->IsCleanup()
(const Bool_t)1
root [6] gROOT->GetListOfCleanups()->Print()
Collection name='Cleanups', class='THashList', size=8
Collection name='TObjArray', class='TObjArray', size=10
Collection name='Canvases', class='TList', size=0
Collection name='Browsers', class='TList', size=0
Collection name='Tasks', class='TList', size=0
Collection name='Files', class='TList', size=0
Collection name='ClosedFiles', class='TList', size=0
OBJ: TCint C/C++ CINT C/C++ Interpreter
Collection name='KVSeqCollection_2', embedded list class='TList', size=0
root [7] gROOT->GetListOfCleanups()->Last()
(const class TObject*)0x913dab8
root [8] l2
(class KVList*)0x913dab8
root [9] l3
(class KVList*)0x916b730
root [10] l2->SetCleanup()
root [11] l2->SetCleanup()
root [12] gROOT->GetListOfCleanups()->Print()
Collection name='Cleanups', class='THashList', size=10
Collection name='TObjArray', class='TObjArray', size=10
Collection name='Canvases', class='TList', size=0
Collection name='Browsers', class='TList', size=0
Collection name='Tasks', class='TList', size=0
Collection name='Files', class='TList', size=0
Collection name='ClosedFiles', class='TList', size=0
OBJ: TCint C/C++ CINT C/C++ Interpreter
Collection name='KVSeqCollection_2', embedded list class='TList', size=0
Collection name='KVSeqCollection_2', embedded list class='TList', size=0
Collection name='KVSeqCollection_2', embedded list class='TList', size=0
----------------------------------------------------
1) we see that the list l3 (line [4]) has the same name as the list l2 (line [1]). This may be a problem
for the looking-up in gROOT->GetListOfCleanups() which is a THashList.
So in the methods Streamer(...) (called by Clone()) and Copy(...) the object should keep its first name (individual name).
2) since l3 is a clone of l2 and l2 has IsCleanup() status then l3 has
the same one, I am agree. Nevertheless it does not appear in the list
of Cleanups as shown in line [6]. indeed, according to line [7,8,9]
only l2 is present in gROOT->GetListOfCleanups().
3) we can see lines [10,11,12] that the list l2 appears in the
gROOT->GetListOfCleanups() as often as we call l2->Cleanup().
These 3 problems seems to be the origin of a segmentation violation that I obtain when I play with the KVIDZAGrid::SetEditable() toggle method. It is difficult to reproduce this bug.
SetEditable() calls UpdateLastSavedVersion() method.
In this method a new KVIDGraph (grid_copy) is built. grid_copy has two Cleanup lists (fCuts and fIdentifiers), and both are added to the THashList gROOT->GetListOfCleanups().
When a copy of the initial grid (grid_init) is made in grid_copy then the name of its lists (fCuts and fIdentifiers) is changed. Now, if program tries to find these lists in gROOT->GetListOfCleanups(), a segmentation violation may be produced since the hash value of their new name may be different. Indeed, it is their initial name that was used to add them in gROOT->GetListOfCleanups().
KaliVeda version: 1.9 and IV
To manage notifications about this bug go to:
https://bugs.launchpad.net/kaliveda/+bug/1399661/+subscriptions
Follow ups
References