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

valgrind conditional jump on uninitialized value #73

Open
ecoon opened this issue May 11, 2021 · 0 comments
Open

valgrind conditional jump on uninitialized value #73

ecoon opened this issue May 11, 2021 · 0 comments

Comments

@ecoon
Copy link
Contributor

ecoon commented May 11, 2021

PFloTran seems to only set the ierror flag on error, and if all things work, does not set the flag to 0. Effectively PFloTran seems to think of the flag as intent = inout.

Here, RReact is called with an uninitialized ierror:
https://github.com/LBL-EESA/alquimia-dev/blob/master/alquimia/pflotran_alquimia_interface.F90#L541

and later it is used in a conditional. So if ierror is not initialized by the compiler, that later if statement depends upon uninitialized data.

The fix is simply to initialize ierror to 0 prior to calling RReact().

I wasn't sure if this is an issue more broadly, but this silences some valgrind errors for me.

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

No branches or pull requests

1 participant