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

Patch a case where nodes with very close to zero values created an infinite alloc loop. #8388

Merged
merged 2 commits into from
Mar 4, 2024

Conversation

joa-quim
Copy link
Member

@joa-quim joa-quim commented Mar 2, 2024

The situation arose when the condition

if ((dz = z[this_side] - z[this_side+1]) == 0.0f) continue;

was never met by a tiny bit. Comparing to 0.0 is never a good idea. So I made it

if (fabs((dz = z[this_side] - z[this_side+1])) < 1e-10) continue;

I get 6 grdcontour test failures but they don't seem related to this change (more due to the endless headache of slight different grids).

Fixes #8387

Fixes #6738

…finite alloc loop.

The situation arose when the condition

if ((dz = z[this_side] - z[this_side+1]) == 0.0f) continue;

was never met by a tiny bit. Comparing to 0.0 is never a good idea. So I made it

if (fabs((dz = z[this_side] - z[this_side+1])) < 1e-10) continue;

I get 6 grdcontour test failures but they don't seem related to this change (more due to the endless headache of slight different grids).

Fixes #8387
@joa-quim joa-quim merged commit 2bec117 into master Mar 4, 2024
6 checks passed
@joa-quim joa-quim deleted the grdcontour-close-zeros branch March 4, 2024 00:01
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.

grdcontour hanging grdcontour having trouble with tiny mignitudes
2 participants