Skip to content

ch4: fix use of builtin_element_size in pack/unpack - #5743

Merged
hzhou merged 2 commits into
pmodels:mainfrom
hzhou:2112_pack
Jan 5, 2022
Merged

hzhou merged 2 commits into
pmodels:mainfrom
hzhou:2112_pack

Conversation

@hzhou

@hzhou hzhou commented Dec 27, 2021 •

Copy link
Copy Markdown
Collaborator

Pull Request Description

If the datatype is from a flatted type, builtin_element_size can be
garbage because the field is not copied in struct flatten_hdr.

Obtain the builtin_element_size from the basic type instead.

Background:
This bug was not detected in our testsuite because the current (get_acc) tests do not cover the case when a flattened datatype object reuses the previously freed handle memory with non-zero conflicting values of builtin_element_size. It was caught in #5725 when we test multiple tests within a single MPI_Init/Finalize window.

[skip warnings]

Author Checklist

  • Provide Description
    Particularly focus on why, not what. Reference background, issues, test failures, xfail entries, etc.
  • Commits Follow Good Practice
    Commits are self-contained and do not do two things at once.
    Commit message is of the form: module: short description
    Commit message explains what's in the commit.
  • Passes All Tests
    Whitespace checker. Warnings test. Additional tests via comments.
  • Contribution Agreement
    For non-Argonne authors, check contribution agreement.
    If necessary, request an explicit comment from your companies PR approval manager.

@hzhou

hzhou commented Dec 27, 2021

Copy link
Copy Markdown
Collaborator Author

test:mpich/ch4/ofi

hzhou added 2 commits January 5, 2022 15:17
If the datatype is from a flatted type, builtin_element_size can be
garbage because the field is not copied in struct flatten_hdr.

Obtain the builtin_element_size from basic_type instead.
Add an assertion to check actual_pack_bytes from MPIR_Typerep_pack to
catch potential errors.
@hzhou
hzhou merged commit eecd044 into pmodels:main Jan 5, 2022
@hzhou
hzhou deleted the 2112_pack branch January 5, 2022 21:24
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

Successfully merging this pull request may close these issues.

2 participants