TEveCompount segfault

Dear ROOTers,
I’m trying to develop event display with drawable object with TEveTrack ant TEvePointSet.
Let’s say that my class looks like this:

class A: public TEveCompound{
A(){
B = new MyEveTrack(...)
C = new MyEvePointSet(...)
AddElement(B):
AddElement(C);
}
}

Code properly display everything, however when I click on “this tree with hierarchy” on Rootino/TEvePointSet - then code crash, the line that cause error is:

Bool_t TEveSelection::AcceptElement(TEveElement* el)
{
   return el != this && fImpliedSelected.find(el) == fImpliedSelected.end() &&
          el->IsA()->InheritsFrom(TEveSelection::Class()) == kFALSE;
}

What is more strange in the same window is check button for visibility and it works without problems.
Any clue what might be a reason?


Please read tips for efficient and successful posting and posting code

ROOT Version: 6
Platform: Linux Mint
Compiler: Not Provided


Hmmh, looking at this line, the only thing that could happen is that you don’t have ClassDef for class A and so there is something wrong with the IsA().

What is the actual crash? Can you put the code somewhere so I can give it a try?

Cheers,
Maevz

Hi,
the code is quite long, I tried to modify alice_vsd but I cannot add compound object to list of coumpound object (I overwrote the AddElement but it doesn’t help).
BUT
When I add IncDenyDestroy() it works. Do you know what actually this method do?

Small update - the bug is still present but its harder to reproduce it. It seems that something wrong happens with “child” objects. However I don’t know why it happens almost randomly.

#11 0x00007f16cde2d76d in CbmEDFullTrack::HighlightElement (this=0x56373bf88dd0, state=false) at /opt/cbmroot/cbm_nov/eventdisplay/CbmEDTrack.cxx:94 //here I call method on "child" element
#12 0x00007f16fd26869d in TEveSelection::DoElementUnselect (this=0x56372aa38a60, entry={first = 0x56373bf88dd0, second = std::set with 0 elements}) at /opt/FairGroup/FairSoft_19/tools/root/graf3d/eve/src/TEveSelection.cxx:85
#13 0x00007f16fd268ae8 in TEveSelection::RemoveElementsLocal (this=0x56372aa38a60) at /opt/FairGroup/FairSoft_19/tools/root/graf3d/eve/src/TEveSelection.cxx:162
#14 0x00007f16fd20e67d in TEveElement::RemoveElementsInternal (this=0x56372aa38a60) at /opt/FairGroup/FairSoft_19/tools/root/graf3d/eve/src/TEveElement.cxx:1376
#15 0x00007f16fd20e75f in TEveElement::RemoveElements (this=0x56372aa38a60) at /opt/FairGroup/FairSoft_19/tools/root/graf3d/eve/src/TEveElement.cxx:1393
#16 0x00007f16fd268a58 in TEveSelection::RemoveElements (this=0x56372aa38a60) at /opt/FairGroup/FairSoft_19/tools/root/graf3d/eve/src/TEveSelection.cxx:150
#17 0x00007f16fd269496 in TEveSelection::UserPickedElement (this=0x56372aa38a60, el=0x0, multi=false) at /opt/FairGroup/FairSoft_19/tools/root/graf3d/eve/src/TEveSelection.cxx:353
#18 0x00007f16fd1cea0b in TEveGListTreeEditorFrame::ItemBelowMouse (this=0x56372ac39f60, entry=0x0) at /opt/FairGroup/FairSoft_19/tools/root/graf3d/eve/src/TEveBrowser.cxx:333

Another update - I found some pattern. I think I also managed to reproduce similar error (try to clik ESDTrack editor and then Rootino editor eve.tar.gz (5,6 KB) . It seems that issue is cause by those “Highlight” methods.

Hi,

I tried it but couldn’t get it to crash by clicking around, going to next event etc.

I have edited your example to do what I think you want it to do:

  • comment out all highlight functions;
  • call TEveCompound constructor in your base class and call Open/CloseCompound before/after adding of the elements;
  • setup upward selection propagtion mode so that clicking on an compound element causes selection to go upwards to compound.

Take a look at the diff of what I’ve done. eve-2.tar.gz (5.8 KB)

Cheers,
Matevz

Thank you,
It seems to work now, but there is one (other problem) this “highlighting” working only from from parent to child. Is there option of having this also from child to parent? This was a main reason why I overwrote this highlight methods.

Have you also applied the change from alie_vsd2.C? This should take care of that.

   TEveManager::Create();
  // Next two lines to add:
   gEve->GetSelection()->SetPickToSelect(TEveSelection::kPS_PableCompound);
   gEve->GetHighlight()->SetPickToSelect(TEveSelection::kPS_PableCompound);

Cheers,
Matevz

1 Like

Thank you, now it works.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.