Skip to content

Fix bugs: CellMemAligned and Independent buffer overrun, var_view bad access - #1448

Open
lroberts36 wants to merge 7 commits into
developfrom
lroberts36/fix-cellmemaligned-independent
Open

Fix bugs: CellMemAligned and Independent buffer overrun, var_view bad access#1448
lroberts36 wants to merge 7 commits into
developfrom
lroberts36/fix-cellmemaligned-independent

Conversation

@lroberts36

@lroberts36 lroberts36 commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

PR Summary

This PR fixes two bugs (with help from @chadmeyer):

  1. Prolongation during remesh in non-cell centered fields that have both Metadata::CellMemAligned and Metadata::Independent ended up with index ranges that reached outside of the allocated memory for a field. This restricts the index range to prevent this. After looking at fixing this bug, I think that there is a general bug for variables with Metadata::Independent for fill ghost (see issue Possible issue with Metadata::Independent when Metadata::FillGhost is not set #1447) that I do not fix here.
  2. Fix the array bound check for building var_views to prevent UB

PR Checklist

  • Code passes cpplint
  • New features are documented.
  • Adds a test for any bugs fixed. Adds tests for new features.
  • Code is formatted
  • Changes are summarized in CHANGELOG.md
  • Change is breaking (API, behavior, ...)
    • Change is additionally added to CHANGELOG.md in the breaking section
    • PR is marked as breaking
    • Short summary API changes at the top of the PR (plus optionally with an automated update/fix script)
  • CI has been triggered on Darwin for performance regression tests.
  • Docs build
  • Any contribution that was created or modified with the assistance of generative AI is disclosed here and in code following the guidelines
  • (@lanl.gov employees) Update copyright on changed files

@lroberts36

Copy link
Copy Markdown
Collaborator Author

@par-hermes format

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor
USAGE:
    @par-hermes format [--amend]

FLAGS:
    --amend Amends the previous commit with formatting

@lroberts36

Copy link
Copy Markdown
Collaborator Author

@par-hermes format

@Yurlungur Yurlungur left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this

@lroberts36
lroberts36 requested a review from jdolence September 2, 2026 19:44
@lroberts36
lroberts36 enabled auto-merge September 3, 2026 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants