Prevent over-extension of vector length #500
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
@RachelCoackley discovered this problem using the SBND CI. We were seeing non-reproducibility in the CAFs. @jzennamo traced this down to this tool using valgrind to find an invalid read. I have then investigated why it was happening.
Description copied from slack:
dtheta.cumLenFwdandcumLenBwdwhich are meant to be of the same length.dthetavector's size (after passing to other functions) that determines the domain of the loop on line 224 (by settingbeg&endat lines 211 & 212.else ifnot anifand I'm not willing to do anything more than the most simple!For the sake of the SBND CI there is a branch based on
v09_93_01_p02bugfix/hlay_mcs_invalid_read but this PR branch is rebased againstdevelop.I've added review requests from @gputnam and @wjdanswjddl as I see you have previous commits on this tool so may want to see this. The okay from Rachel or Joseph should be fine from the bugfix side of things though.