GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » General » How to write Macros with newest trunk code
How to write Macros with newest trunk code [message #21440] Thu, 14 September 2017 18:11 Go to next message
Stefan Pflueger is currently offline  Stefan Pflueger
Messages: 99
Registered: February 2012
continuous participant
From: *specf.him.uni-mainz.de
Hello,

I updated to the newest FairRoot (17.03) and pandaroot code (trunk), and cannot get the lmd macros to work (or also the macros in macro/run). Our lmd macros seem not to be compatible with the current development trunk as the all create double free corruption errors. Is there any macros that should work and have been tested with this development setup? Then I have some guideline on how to steer the whole simulation and reconstruction chain and adapt our macros to the new FairRoot. Thanks in advance

Stefan
Re: How to write Macros with newest trunk code [message #21445 is a reply to message #21440] Fri, 15 September 2017 09:23 Go to previous messageGo to next message
Ralf Kliemt is currently offline  Ralf Kliemt
Messages: 507
Registered: May 2007
Location: GSI, Darmstadt
first-grade participant

From: *dyn.telefonica.de
Hallo Stefan,

Just to be clear on your setup: Did you install
FairSoft may16p1
FairRoot v-17.03
PandaRoot trunk
ROOT version 6
?

The macros in macro/run are phasing out. Please go on in macro/master for the default configuration.
I know there is a double free message upon quitting root 6, which should not harm the calculations.
Other than that, some error message log would be helpful.

Cheers!
Ralf
Re: How to write Macros with newest trunk code [message #21448 is a reply to message #21445] Fri, 15 September 2017 09:54 Go to previous messageGo to next message
Stefan Pflueger is currently offline  Stefan Pflueger
Messages: 99
Registered: February 2012
continuous participant
From: *dip0.t-ipconnect.de
Hi Ralf,

yes exactly that's my configuration. I should add that i used gcc 6.4.0. So everyone gets the double free error messages at the end of the macro runtime? I almost assume so... Because it crashes at the end of the runtime, the macros should still deliver valid output like you said. Strangely most of the output files for the lmd reconstruction chain are empty. I will investigate further today and compare our lmd macros with the master ones. Maybe some change in fairroot etc is not implemented correctly in our lmd macro code up to now.
Nevertheless if everyone using root6 and the trunk code of pandaroot gets these double free issues, its quite embarrassing to me... Because it is a double free at the end of the runtime done by the root "garbage collector", it is also a bit hard to debug that. But I checked some of the code yesterday and there are a lot of delete statements in the code, which could be responsible for this kind of thing. I will post the output later, however I don't think it will be of much help.

Stefan
Re: How to write Macros with newest trunk code [message #21452 is a reply to message #21448] Fri, 15 September 2017 10:11 Go to previous messageGo to next message
Tobias Stockmanns is currently offline  Tobias Stockmanns
Messages: 489
Registered: May 2007
first-grade participant
From: *netcologne.de
Dear Stefan,

the reason for the double free error is well known. It is a problem inside root. We can bypass it but it should be fixed inside root which has not happened up to now.

If this is causing a problem I can fix it in PandaRoot.

Cheers,

Tobias
Re: How to write Macros with newest trunk code [message #21453 is a reply to message #21445] Fri, 15 September 2017 10:22 Go to previous messageGo to next message
Stefan Pflueger is currently offline  Stefan Pflueger
Messages: 99
Registered: February 2012
continuous participant
From: *specf.him.uni-mainz.de
Hi Ralf,

here is the stacktrace as promised

#5 0x00002af63f04f7ec in TObjArray::Delete(char const*) () from /software/fairsoft/fairsoft_may16p1_root6/lib/root/libCore.so.6.08
#6 0x00002af64405d01e in TGeoManager::~TGeoManager() () from /software/fairsoft/fairsoft_may16p1_root6/lib/root/libGeom.so.6.08
#7 0x00002af64405d239 in TGeoManager::~TGeoManager() () from /software/fairsoft/fairsoft_may16p1_root6/lib/root/libGeom.so.6.08
#8 0x00002af63f048445 in TList::Delete(char const*) () from /software/fairsoft/fairsoft_may16p1_root6/lib/root/libCore.so.6.08
#9 0x00002af63ef497b2 in TROOT::~TROOT() () from /software/fairsoft/fairsoft_may16p1_root6/lib/root/libCore.so.6.08
#10 0x0000003aeda35b22 in __run_exit_handlers (status=0) at exit.c:78
#11 exit (status=0) at exit.c:100
#12 0x0000003aeda1ed64 in __libc_start_main (main=0x402814 <main>, argc=1, ubp_av=0x7fffe4463698, init=<value optimized out>, fini=<value optimized out>,
rtld_fini=<value optimized out>, stack_end=0x7fffe4463688) at libc-start.c:258
#13 0x0000000000402059 in _start ()
Re: How to write Macros with newest trunk code [message #21456 is a reply to message #21452] Fri, 15 September 2017 10:38 Go to previous messageGo to next message
Stefan Pflueger is currently offline  Stefan Pflueger
Messages: 99
Registered: February 2012
continuous participant
From: *specf.him.uni-mainz.de
Hi Tobias,

hmm I'm not sure I understand correctly. So the root6 team knows there is a bug in their code and their working on it? In my opinion our code does a "non root conform" delete in some destructor that causes this problem. I will ignore the double free for now and try to get the lmd macros running again. Thanks for the information.

Stefan
Re: How to write Macros with newest trunk code [message #21460 is a reply to message #21452] Fri, 15 September 2017 12:59 Go to previous messageGo to next message
Florian Uhlig is currently offline  Florian Uhlig
Messages: 424
Registered: May 2007
first-grade participant
From: *unity-media.net
Hi Tobias,

I think your statement is not 100% correct. We had a discussion with the ROOT developers since we think that the problem is due to ROOT. Their opinion is that the problem is inside our geometries. Up to now we have not been able to prove that the problem is not our geometry.

To overcome the problem on can do the following steps at the end of the macro

gGeoManager->GetListOfVolumes()->Delete();
gGeoManager->GetListOfShapes()->Delete();
delete gGeoManager;

Ciao

Florian
Re: How to write Macros with newest trunk code [message #21463 is a reply to message #21460] Fri, 15 September 2017 13:09 Go to previous messageGo to next message
Stefan Pflueger is currently offline  Stefan Pflueger
Messages: 99
Registered: February 2012
continuous participant
From: *specf.him.uni-mainz.de
Hi Florian,

ok thx for the tip. I saw that reason that the lmd macros did not deliver any results was that the simulation macro did not generate geant hits in the lumi detector geometry. As if the lumi geometry is not seen by it.

Below is the output log of the macro until geant start propagating particles. I stumbled across the line

Error in <TGeoVoxelFinder::SortAll>: Volume lmd_vol_ref_sys: Cannot make slices on any axis

Is that normal? Does anyone know if this is an error that can be ignored?

Quote:

[INFO ] Media file used: /home/pflueger/pandaroot/geometry/media_pnd.geo
Info in (PndGeoHandling::Instance): Making a new instance using the framework.
- I - PndLmdDetector: fListOfSensitives contains:
LumActive
Info in <TGeoManager::TGeoManager>: Geometry FAIRGeom, FAIR geometry created

*************************************************************
initialisation for run id 1505472465
*************************************************************
-I- FairRunTimeDB::InitContainer() PndSensorNamePar
[ERROR ] init() PndSensorNamePar not initialized
Error in <FairRuntimeDb::initContainers()>: Error occured during initialization
Loading Geant4 libraries (using geant4-config) ...
31
Loading VGM libraries ...
Loading g4root library ...
Loading geant4vmc library ...
Loading mtroot library ...

=============================================================
Geant4 Virtual Monte Carlo
Version 3.3 ( 15 January 2016 )
WWW : http://root.cern.ch/drupal/content/geant4-vmc
=============================================================

Info in <TGeoManager::SetTopVolume>: Top volume is cave. Master volume is cave
Info in <TGeoNavigator::BuildCache>: --- Maximum geometry depth set to 100
<I> PndPipe - Using geometry /home/pflueger/pandaroot/geometry/beampipe_201309.root
Info in <TGeoManager::CheckGeometry>: Fixing runtime shapes...
Info in <TGeoManager::CheckGeometry>: ...Nothing to fix
Info in <TGeoManager::CloseGeometry>: Counting nodes...
Info in <TGeoManager::Voxelize>: Voxelizing...
Error in <TGeoVoxelFinder::SortAll>: Volume lmd_vol_ref_sys: Cannot make slices on any axis
Info in <TGeoManager::CloseGeometry>: Building cache...
Info in <TGeoManager::CountLevels>: max level = 8, max placements = 36
Info in <TGeoManager::CloseGeometry>: 1347 nodes/ 81 volume UID's in FAIR geometry
Info in <TGeoManager::CloseGeometry>: ----------------modeler ready----------------
Info in <TObject::SetNavigator>: TG4RootNavigator created and registered to G4TransportationManager
isMaster=1
Running TVirtualMCApplication::ConstructGeometry
*************************************************************
Geant4 version Name: geant4-10-02-patch-01 (26-February-2016)
Copyright : Geant4 Collaboration
Reference : NIM A 506 (2003), 250-303
WWW : http://cern.ch/geant4
*************************************************************

Info in <TObject::Initialize>: Creating G4 hierarchy ...
Info in <TGeoManager::ConvertReflections>: Converting reflections in: FAIRGeom - FAIR geometry ...
Info in <TGeoManager::ConvertReflections>: Done
===> GEANT4 materials created and mapped to TGeo ones...
===> GEANT4 physical volumes created and mapped to TGeo hierarchy...
### INFO: TG4RootDetectorConstruction::Construct() finished
TG4PostDetConstruction::Initialize
G4 Stat: instantiated 404 logical volumes
1346 physical volumes
Info in <TObject::ConnectToG4>: ROOT detector construction class connected to G4RunManager
Adding HadronPhysicsList QGSP_BERT_EMV
G4PhysListFactory::GetReferencePhysList <QGSP_BERT_EMV> EMoption= 1
<<< Geant4 Physics List simulation engine: QGSP_BERT 4.0

<<< Reference Physics List QGSP_BERT_EMV is built

Adding SpecialPhysicsList stepLimiter+specialCuts+
### TG4SpecialControlsV2 constructed
Visualization Manager instantiating with verbosity "warnings (3)"...
Geant4 has been created.
-I g4Config() using g4conf macro: /home/pflueger/pandaroot/gconfig/g4config.in
SetCuts Macro: Setting Processes..
SetCuts Macro: Setting cuts..
TG4RootDetectorConstruction::ConstructSDandField
TG4PostDetConstruction::InitializeSDandField
-I- Initializing PndSdsDetector()
-W- PndSdsDetector: New branch LMDPoint created!
Global magnetic field created with stepper ClassicalRK4
### INFO: TG4RootDetectorConstruction::ConstructSDandField finished
### Adding tracking cuts for neutron TimeCut(ns)= 10000 KinEnergyCut(MeV)= 0
### Hadron physics constructed.
### Processes mapped to VMC controls ok.
### Step limiter physics constructed.
### Special Cuts constructed.
### User particles physics constructed.
### Processes mapped to VMC codes ok.
TGEmModelPhysics::ConstructProcess
No EM models are defined.
Available UI session types: [ GAG, tcsh, csh ]
Converting VMC cuts in regions
Number of added regions: 9

**********************************************
GEANT4 Geometry statistics:
404 logical volumes
1346 physical volumes
15 materials
14 user limits
81 sensitive detectors
**********************************************


Stefan
Re: How to write Macros with newest trunk code [message #21465 is a reply to message #21460] Fri, 15 September 2017 15:37 Go to previous message
Stefan Pflueger is currently offline  Stefan Pflueger
Messages: 99
Registered: February 2012
continuous participant
From: *specf.him.uni-mainz.de
Hi Florian,

your code snippet indeed fixes the double free crash at the end of the macro. However the lmd uses a special backtracking task, more precisely FairGeane & FairGeaneApplication. I still get the same double free crash report in the geant3 initialization phase (see log below). It crashes in the Geant3 vmc InitMC() function. From the stack trace it looks like that the problem is the same as before, something inside the TGeoManager getting deleted again that was deleted before.

Quote:

*** glibc detected *** /software/fairsoft/fairsoft_may16p1_root6/bin/root.exe: double free or corruption (!prev): 0x00000000096bb140 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x75f4e)[0x2b0192deff4e]
/lib64/libc.so.6(+0x78cf0)[0x2b0192df2cf0]
/software/fairsoft/fairsoft_may16p1_root6/lib/root/libCore.so.6.08(_ZN9T ObjArray6DeleteEPKc+0x10c)[0x2b0191f5c7ec]
/software/fairsoft/fairsoft_may16p1_root6/lib/root/libGeom.so.6.08(_ZN11 TGeoManagerD1Ev+0x29e)[0x2b019fc6501e]
/software/fairsoft/fairsoft_may16p1_root6/lib/root/libGeom.so.6.08(_ZN11 TGeoManagerD0Ev+0x9)[0x2b019fc65239]
/software/fairsoft/fairsoft_may16p1_root6/lib/root/libCore.so.6.08(_ZN5T List6DeleteEPKc+0x205)[0x2b0191f55445]
/software/fairsoft/fairsoft_may16p1_root6/lib/root/libCore.so.6.08(_ZN5T ROOT20EndOfProcessCleanupsEv+0x4c)[0x2b0191e57c8c]
/lib64/libc.so.6(exit+0xe2)[0x2b0192dafb22]
/software/fairsoft/fairsoft_may16p1_root6/lib/libgeant321.so(+0x2719de)[ 0x2b01b43639de]
/software/fairsoft/fairsoft_may16p1_root6/lib/libgeant321.so(zabend_+0x3 f)[0x2b01b42eecaf]
/software/fairsoft/fairsoft_may16p1_root6/lib/libgeant321.so(zfatal_+0x7 92)[0x2b01b42f3b42]
/software/fairsoft/fairsoft_may16p1_root6/lib/libgeant321.so(mztabc_+0x2 1a)[0x2b01b42e4b7a]
/software/fairsoft/fairsoft_may16p1_root6/lib/libgeant321.so(mztabr_+0x1 55)[0x2b01b42e1645]
/software/fairsoft/fairsoft_may16p1_root6/lib/libgeant321.so(mzgar1_+0x2 10)[0x2b01b42f2480]
/software/fairsoft/fairsoft_may16p1_root6/lib/libgeant321.so(mzlift_+0x3 df)[0x2b01b42f459f]
/software/fairsoft/fairsoft_may16p1_root6/lib/libgeant321.so(mzbook_+0xf b)[0x2b01b42f07db]
/software/fairsoft/fairsoft_may16p1_root6/lib/libgeant321.so(g3physi_+0x 1f7d)[0x2b01b42058dd]
/home/pflueger/FairRoot_install/lib/libBase.so.17.03.00(_ZN20FairGeaneAp plication6InitMCEPKcS1_+0x26)[0x2b019e9feff6]
/home/pflueger/FairRoot_install/lib/libGeane.so.17.03.00(_ZN9FairGeane4I nitEv+0x502)[0x2b01a52e0d12]
/home/pflueger/FairRoot_install/lib/libBase.so.17.03.00(_ZN8FairTask8Ini tTaskEv+0x55)[0x2b019e9f66a5]
/home/pflueger/FairRoot_install/lib/libBase.so.17.03.00(_ZN8FairTask9Ini tTasksEv+0x5b)[0x2b019e9f660b]
/home/pflueger/FairRoot_install/lib/libBase.so.17.03.00(_ZN10FairRunAna4 InitEv+0x3be)[0x2b019e9ea77e]
[0x2b01a98bd5f5]
[0x2b01a98ba0b2]
/software/fairsoft/fairsoft_may16p1_root6/lib/root/libCling.so(_ZN5cling 11Interpreter11RunFunctionEPKN5clang12FunctionDeclEPNS_5ValueE+0x24a)[0x 2b01940cd3ea]


I managed to overcome this problem, by adding the first two lines of your code snipped in the FairGeaneApplication. However I need to verify that the physics results are meaningful once i have the simulation macro running...

void FairGeaneApplication::ConstructGeometry()
{
  TVirtualMC::GetMC()->SetRootGeometry();  // notify VMC about Root geometry
  gGeoManager->GetListOfVolumes()->Delete();
  gGeoManager->GetListOfShapes()->Delete();
}


Thx for the help.

Stefan

[Updated on: Fri, 15 September 2017 15:46]

Report message to a moderator

Previous Topic: Dirc geometry - current version?
Next Topic: DAY1 tracking (2017)
Goto Forum:
  


Current Time: Fri Nov 22 21:22:38 CET 2024

Total time taken to generate the page: 0.00758 seconds