Skip to content

valgrind conditional jump on uninitialized value #73

@ecoon

Description

@ecoon

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions