Skip to content

Invalid memory access in Zoltan_PartDist_MPIOp #588

Description

@manodeep

I have tracked down for out-of-range memory access in this MPI operation. In these lines, 6 memory addresses are unconditionally updated without checking the len parameter. I have verified that with OpenMPI v5.0.8, the default collective han algorithm results in a call to the function with len=3, and that causes an invalid memory write (because the 6 values are written unconditionally). The crash always occurs on the first rank on the node.

A potential fix is to not do anything when len<6 and always perform the (current) operation in units of 6 integers. I have tested this patch and fixes the crash with OpenMPI v5.0.8. Please let me know if the patch seems reasonable - happy to put through a PR with the patch

Note: The issue was debugged and patched with Claude Opus 5 (at Max effort). I have looked through the patch and seems sensible (fusing the 6 integers into a single custom MPI datatype) and the patch itself works for our simulations and produces bitwise identical results.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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