Skip to content

common/ucx: fix variable registration memory leak and cleanup #10105

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

Merged
merged 1 commit into from
Mar 11, 2022

Conversation

hjelmn
Copy link
Member

@hjelmn hjelmn commented Mar 10, 2022

The registration code in common/ucx was overly complex. It assumed
that re-registration is not desireable when it essentially does the
same as the find before the registration. The only thing that needs
protection is resetting the char * variables before they are
registered.

The primary purpose of this commit to fix two memory leaks caused
by the extra allocations to hold the strings. These allocations
are unnecessary.

Signed-off-by: Nathan Hjelm [email protected]

@hjelmn
Copy link
Member Author

hjelmn commented Mar 10, 2022

I think it may have been working because I am pretty sure we re-use the index even if we register, deregister, then register again. This, IIRC, is to ensure MPI_T does not break. Howard's fix worked fine but the leak introduced by the original code was still there. This can be considered a leak fix more than anything.

@hjelmn hjelmn force-pushed the the_words_fail_me_at_the_moment branch from e3b0210 to beb69e2 Compare March 10, 2022 19:28
@hjelmn
Copy link
Member Author

hjelmn commented Mar 10, 2022

Something is odd with my checkout. I still saw the registered static variable in my version. I need to change the commit message.

@hjelmn hjelmn force-pushed the the_words_fail_me_at_the_moment branch from beb69e2 to 15fadb6 Compare March 10, 2022 19:40
@hjelmn hjelmn changed the title common/ucx: fix fundamentally broken variable registration common/ucx: fix variable registration memory leak and cleanup Mar 10, 2022
@hjelmn hjelmn force-pushed the the_words_fail_me_at_the_moment branch from 15fadb6 to e193d30 Compare March 10, 2022 19:50
@hjelmn
Copy link
Member Author

hjelmn commented Mar 10, 2022

Ok, should be good to go. Not sure why my checkout was so old but @hoopoepg can verify.

@hjelmn hjelmn requested a review from hoopoepg March 10, 2022 19:52
@hjelmn hjelmn force-pushed the the_words_fail_me_at_the_moment branch from e193d30 to 276e250 Compare March 10, 2022 19:55
The registration code in common/ucx was overly complex. It assumed
that re-registration is not desireable when it essentially does the
same as the find before the registration. The only thing that needs
protection is resetting the char * variables before they are
registered.

The primary purpose of this commit to fix two memory leaks caused
by the extra allocations to hold the strings. These allocations
are unnecessary.

Signed-off-by: Nathan Hjelm <[email protected]>
@hjelmn hjelmn force-pushed the the_words_fail_me_at_the_moment branch from 276e250 to 5ad772c Compare March 10, 2022 21:41
@hjelmn hjelmn merged commit 45a26f7 into open-mpi:master Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants