Skip to content

Fixed stack allocations based on VECGEOM_MAX_DAUGHTERS

Andrei Gheata requested to merge agheata/fix_static_allocations into master

I've discovered that in the GeantV master the test CMSApp is failing due to a commit of base/Global.h that changed VECGEOM_MAX_DAUGHTERS from 2000 to 200000 to accommodate tessellated solids with large number of facets. Since the arrays using this setting are allocated on the stack, in CMSApp they are exhausting the stack space and generate a crash. This revives the old memory management issue discussed also in this JIRA #415. I've made a fix allocating these arrays using static __thread which fixes (at least temporarily) the issue. I also introduced VECGEOM_MAX_FACETS used only in the HybridNavigator (and safety calculator) to accommodate the request of Mihaela.

Merge request reports