-
Notifications
You must be signed in to change notification settings - Fork 15
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 memory corruption in nitrate component #27
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.
It would be nice to have a more complete description of the bug that was fixed. I stared a bit at the code, but did not see what was actually wrong with the additional version. E.g., did the changes juts "move the symptoms" of some issue somewhere else?
But I don't want the explanation to get in the way of the merge.
Some text was missing from my early description. I've added it back along with further details. |
@rmontuoro Thanks. I'm a bit surprised that this issue was not diagnosed by the compiler. Might be time to ask Elliot to include occasional builds with the backup compiler which should find more of these. I the fix might have been simpler. There is no reason for the dummy arguments in the process library to be pointers. That is an artifact of a poor translation from the original F77 interfaces. We have fixed some of those but a more pervasive change is called for. |
This has a lot of file changes... should it? |
@mathomp4 - As @WilliamJamieson pointed out, this PR also includes #24, which brings in a large number of changes. Hope this is OK, but I can resubmit a new PR with more focused changes. |
I think we can take this PR as is, but going forward please try to isolate bug fixes as much as possible. We're a bit sloppy but we tend to take a closer look at understanding bug fixes. Reviews for non-fixes are quite variable in terms of thoroughness and tend to be more about style and extensibility. |
Almost. @rmontuoro would need to add his "if not Baselibs" update from #24 I think. |
…o/fix-mem-corruption
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.
I have verified that these changes are zero-diff with the feature/esherman/gocart2g_develop_WilliamUpdate build
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.
My and Elliot's tests show that this is zero-diff.
Using super powers again. |
This PR introduces changes to prevent memory corruption occurring in GOCART's nitrate component when diagnostic variables for settling (
NISD
) and wet removal (NH3WT
,NH4WT
) are enabled.The memory corruption was traced back to allocated arrays being passed to subroutines expecting a pointer array argument (see example below):
Additionally, a minor change is included to set the correct intent for a dummy argument.
This PR is contingent on approval of PR #24.