-
-
Notifications
You must be signed in to change notification settings - Fork 339
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
r.watershed: Handle large datasets greater than INT32_MAX in cells #2884
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whenever we multiply rows and columns, they should be size_t before multiplication, so the reasoning here fits that.
Can you provide documentation for size_array while at it?
Unfortunately, it still cannot handle larger inputs. Some arrays and variables need to be converted to |
@HuidaeCho Are you planning to merge this PR? |
Do you know how to re-run expired failed tests without making a small commit just to revive them? |
You can always rebase. |
92c9936
to
ea7c943
Compare
@HuidaeCho would you like to do a rebase for a fresh CI (101 PRs behind), then merge? If I do it I would appear as co-author. This PR looks ready to go |
ea7c943
to
a3a9bbb
Compare
@echoix Just rebased it. |
But the co-author is determined (only) by the text in the commit message, no? I think in these cases, the auto-generated co-author should be deleted by whoever is merging it. |
Ya, that's what I would have done if it wasn't him, that was still active. The PR already had some rebases done, so I assumed the cleanliness of the commits was important for the author. And it also indirectly asked for a little review to know if everything was still alright with the PR. |
This PR fixes an unintended integer overflow by the
int size_array(..., int, int)
function. The new return type of this function issize_t
, and takessize_t
nrows and ncols. Before this PR,r.watershed
was not able to allocate4 * 43994 * 49529
(about 8.1 GB) because of this integer overflow.Failed line:
grass/raster/r.watershed/ram/init_vars.c
Line 149 in 35123df
Error:
Test code:
Output: