Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lsan error from the ORCA grid iterator #5

Merged
merged 3 commits into from
Jan 18, 2023

Conversation

twsearle
Copy link
Contributor

Setting up the iterator .end() was causing out-of-bounds memory access. This was showing up under the address sanitizer.

This change prevents the iterator actually updating when it moves to the sentinal address off the end of the container, and so stops the memory access. I think something similar to this has been done already for the other atlas iterators.

I have tested this and the lsan message goes away. I don't believe there are tests in atlas-orca that test this iterator directly, but I think it is used by the polygon locator.

@wdeconinck
Copy link
Member

Hi Toby I have modified your branch with an alternative suggestion. Please let me know if you're also happy with it.

@twsearle
Copy link
Contributor Author

Hi Toby I have modified your branch with an alternative suggestion. Please let me know if you're also happy with it.

Looks good to me, thanks very much for fixing this up

@wdeconinck wdeconinck merged commit 2175eb2 into ecmwf:develop Jan 18, 2023
wdeconinck referenced this pull request in twsearle/atlas-orca Feb 14, 2023
* develop:
  Improve test_orca_polygon_locator
  Add test for the polygon locator
  Fix lsan error from the ORCA grid iterator (#5)
wdeconinck added a commit that referenced this pull request Aug 28, 2023
* release/0.2.0: (21 commits)
  Update comments
  Version 0.2.0
  Forward compatibility with atlas 0.35.0
  Install headers
  Avoid nvhpc compiler warnings
  Fixup previous commit 5cb5143
  Robustness when eckit is not compiled with CURL
  Update known urls to new names.
  Fix URLs after migration of nexus to Bologna
  Update README
  Add ORCA grid download feature to build system.
  Improve test_orca_polygon_locator
  Add test for the polygon locator
  Fix lsan error from the ORCA grid iterator (#5)
  Don't use atlas::io::FileStream
  Fix downloading of orca data files with caching with multiple MPI ranks
  ATLAS-356 Fix definition of periodic flags
  Fix OpenMP race conditions in OrcaMeshGenerator (#1)
  Fix use of idx_t where required
  Orca meshes have their parallel setup completed in case of a single partition, so that halo exchanges for periodic boundaries can be performed
  ...
wdeconinck pushed a commit that referenced this pull request Sep 4, 2024
* Updated logic.

* Add comment.

* Add testing of halo = 1 to test_orca_mesh_boundaries.cc.

* Update for mesh boundary test with halos.

* Deal with edge case at bottom of grid.

* Fix test logic.

* Rename function to make its purpose clearer.

* Update function name in test.
wdeconinck added a commit that referenced this pull request Sep 18, 2024
* release/0.4.0:
  Version 0.4.0
  Disable tests for high res grids (ORCA025 and ORCA12)
  Disable debugging output
  ij indexing counts further into halo
  Fix normalisation
  no unsigned integers
  fix warning
  remove diagnostics from surroundingRectangle test
  remove diagnostics from test_orca_local_grid.cc
  remove diagnostics from OrcaMeshGenerator.cc
  remove comments LocalOrcaGrid.cc
  Additional halo fixes
  Updated logic (#5)
  tidy up white space
  Fixup errors in merge
  Update to handle halos (#4)
  parent d9ff4d3 author twsearle <14909402+twsearle@users.noreply.github.com> 1706276681 +0000 committer twsearle <14909402+twsearle@users.noreply.github.com> 1716902914 +0100 gpgsig -----BEGIN PGP SIGNATURE-----  Version: GnuPG v2.0.22 (GNU/Linux)
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.

2 participants