Skip to content

MPICH Fortran test greqf uses extrastate wrong #7922

Description

@eschnett

The greqf.f test in MPICH 5.0.1 (directory test/mpi/f77/pt2pt/) contains the line

      extrastate = extrastate - 1

I think this is wrong. extrastate is conceptually a pointer (it's a void* in C, and MPI_Aint in Fortran), and the free_fn callback must not modify it.

greqf90 and greqf08 contain equivalent code which is also wrong.

The Fortran 2008 MPI standard shows this argument as

INTEGER(KIND=MPI_ADDRESS_KIND), INTENT(IN) :: extra_state

which implies that the callee must not modify it. Instead, MPICH captures this argument by reference and modifies it in free_fn. I think that the Fortran subroutine is a transcription of the C function, and that extrastate would usually be a pointer in both cases.

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