Undefined behaviour in combination RelationTable and IndexView of CaloHypos
Undefined behaviour in combination RelationTable and IndexView of CaloHypos.
Reported / first seen in Moore!1279 (merged).
In rare cases a pointer to the parent container of an IndexView
of the clusterContainer
of CaloHypos changed and caused a segfault. Example (size
is of container; offset
is index in IndexView
, parent is clusterContainer associated to IndexView
):
DEBUG: size 148; offset 145
DEBUG: address of parent 0x7f066e936420
DEBUG: size 148; offset 146
DEBUG: address of parent 0x7f066e936420
DEBUG: size 148; offset 147
DEBUG: address of parent 0x7f066e936420
DEBUG: size 7905752448202291385; offset 140
DEBUG: address of parent 0x7f066e936410
*** Break *** segmentation violation
This happened when the clusters are obtained from a relations table (they are not directly an input (in the functional framework) to the algorithm), in the following way:
auto const& cluster_container = relations_table.to()->clusterContainer();
auto const hypoclusters = cluster_container.index();
A workaround is implemented in Moore!1279 (merged) by using the CaloHypos as direct input to the algorithm (as is done in other pre-existing algorithms).