Skip to content

Draft: Fix segfault at exit of unpacking macros

Florian Uhlig requested to merge f.uhlig/cbmroot:exit_segfault_fix into master
  • Prevent FairrootManager from touching the source object trhogh its pointer after the run is over
  • Explicitely delete the dynamically allocated Run and Source objects in the macro (give up share ownership of config objects)
  • Give up ownership of the config objects, which triggers their destruction before reaching end of the macro (last owner of shared pointer)

Problem was that the FairrootManager was never going out of scope and was not calling the Source destructor. So all shared pointers and the source objects were destroyed only when going out of scope in the ROOT session, at which time ROOT already deleted some TF1's, THx's and Canvases without asking anybody (global Lists). The source and config destructors were then calling destructors for their members and member's members, where we tried to cleanup the memory we assigned but which ROOT already deleted.

Merge request reports