GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » Fairroot » General Discussion » error pointer being freed was not allocated
Re: error pointer being freed was not allocated [message #19874 is a reply to message #19872] Tue, 15 November 2016 11:45 Go to previous message
Florian Uhlig is currently offline  Florian Uhlig
Messages: 419
Registered: May 2007
first-grade participant
From: *cern.ch
Hi Tobias,

somehow this is related to the geometry or maybe the way how we construct our geometries from different ROOT files.
We see the same also in CbmRoot but weren't able to find the reason for the strange behavior. Different people also including ROOT developers looked into the issue but couldn't find out what is the problem. By the way we get the error always.

For ROOT5 we created a patch to avoid the problem which is automatically applied when installing FairSoft. This is the reason why you never see the problem when using ROOT5.

A workaround which I found is to delete part of the geomanger before deleting the geomanager at the end of the macro. To simplfy I create a function which I call at the end of the macros.

If you have an idea what could be the problem please let me know.

Ciao

Florian

/**
 * \ function RemoveGeoManager
 * There are some problems when deleting our geometries. In some cases
 * or combinations of geometries there is a double free of some memory 
 * which results in a crash of ROOT. To avoid this we have patched one
 * ROOT class. With the newest ROOT6 version this isn't done any longer.
 * As a workaround to avoid the crash we delete two TObjArrays ourself 
 * and then call the destructor of the TGeoManager at the end of the 
 * macro. To simplify this one also can use this function.
 */
void RemoveGeoManager()
{
  if (gROOT->GetVersionInt() >= 60602) {
    gGeoManager->GetListOfVolumes()->Delete();
    gGeoManager->GetListOfShapes()->Delete();
    delete gGeoManager;
  }
}


 
Read Message
Read Message
Previous Topic: TVector3 and boost::serialization
Next Topic: Problems installing FairSoft
Goto Forum:
  


Current Time: Thu Apr 25 18:37:36 CEST 2019

Total time taken to generate the page: 0.02862 seconds