Skip to content
Snippets Groups Projects
Verified Commit b0329519 authored by Stephen Nicholas Swatman's avatar Stephen Nicholas Swatman
Browse files

Fix ATLASRECTS-5607 in GlobalChi2Fitter

Issue ATLASRECTS-5607 describes a segmentation violation that can occur
in relatively rare cases due to an error on my part in merge request
!35388. The specific error was due to a lack of knowledge on my part
about the memory ownership properties of the IMaterialEffectsUpdator
interface. The way this interface works is a little counter-intuitive
and can break on smart pointer-based call sites if the developer does
not take special care to handle pointer aliasing.

What happened here is that the updator returned a raw pointer aliasing a
smart pointer at the call site, and in some specific cases this would
result in segmentation faults as memory would be accesed that was freed
by the RAII mechanisms of those smart pointers. There was also a risk of
double frees, but this bug never seemed to naterialize because the code
would segfault earlier trying to dereference the now-freed pointer.

I opened another issue, ATLASRECTS-5609, to suggest changes to said
interface that makes it harder (or rather, near impossible) for
developers working with smart pointers to make this same mistake. In
addition, I have left comments in the code warning future developers of
the GlobalChi2Fitter of this issue.
parent 7e7fea0e
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment