Skip to content

Conversation

@hoopoepg
Copy link
Contributor

  • forced use sizeof(void*) instead of sizeof(char**) due to non-standard
    behaviour
  • fixed resorce leak in proc_add

Copy link
Member

@dmitrygx dmitrygx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

git commit -s

opal_progress_register(spml_ucx_default_progress);

mca_spml_ucx.remote_addrs_tbl = (char ***)calloc(mca_spml_ucx.ucp_workers, sizeof(char ***));
mca_spml_ucx.remote_addrs_tbl = (char ***)calloc(mca_spml_ucx.ucp_workers, sizeof(void*));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe sizeof(*mca_spml_ucx.remote_addrs_tbl)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, good idea

for (w = 0; w < ucp_workers; w++) {
mca_spml_ucx.remote_addrs_tbl[w] = (char **)calloc(nprocs, sizeof(char **));
memset(mca_spml_ucx.remote_addrs_tbl[w], 0, nprocs * sizeof(char **));
mca_spml_ucx.remote_addrs_tbl[w] = (char **)calloc(nprocs, sizeof(void*));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe sizeof(*mca_spml_ucx.remote_addrs_tbl[w])?

mca_spml_ucx.remote_addrs_tbl[w] = (char **)calloc(nprocs, sizeof(char **));
memset(mca_spml_ucx.remote_addrs_tbl[w], 0, nprocs * sizeof(char **));
mca_spml_ucx.remote_addrs_tbl[w] = (char **)calloc(nprocs, sizeof(void*));
memset(mca_spml_ucx.remote_addrs_tbl[w], 0, nprocs * sizeof(void*));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

memset() isn't needed here, since we use calloc() for memory allocation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

@hoopoepg hoopoepg force-pushed the topic/fixed-coverity-issues branch from 5f15c1b to 9b16cac Compare January 23, 2020 11:55
Copy link
Contributor Author

@hoopoepg hoopoepg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

git commit -s

forgot about this... fixed

- fixed sizeof(char***) by variable datatype
- fixed resorce leak in proc_add

Signed-off-by: Sergey Oblomov <[email protected]>
@hoopoepg hoopoepg force-pushed the topic/fixed-coverity-issues branch from 9b16cac to 8543860 Compare January 23, 2020 12:02
@artpol84
Copy link
Contributor

Thanks, @hoopoepg !

@artpol84 artpol84 merged commit 548ed56 into open-mpi:master Jan 23, 2020
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.

3 participants