ComputationalRadiationPhysics / picongpu

Performance-Portable Particle-in-Cell Simulations for the Exascale Era :sparkles:
https://picongpu.readthedocs.io
Other
710 stars 218 forks source link

fix out of bounds memory access in RollForOverSubscription #5122

Closed BrianMarre closed 2 months ago

BrianMarre commented 2 months ago

Fixes an out of bound memory access in the RollForOversubscription caused by the change of the default value of the binIndex particle attribute introduced in PR #5079.

Previously it was safe to do a lockup in the RejectionProbabilityCache independent of the processClass since, the ion binIndex attribute was guaranteed to always be a valid value, independent of the previously selected process class. If the processClass did not belong to a histogram using process this value was simply ignored.

Now only ions with a histogram using processClass are guaranteed to have a valid binIndex since we do not set a binIndex unless required for performance reasons. With the new invalid default values this causes an illegal memory access error.