Skip to content

Commit

Permalink
UCT/ROCM: use base_iface_internal_ops in constructor
Browse files Browse the repository at this point in the history
in the class constructor passing NULL instead of a valid internal_ops
can lead to a segfault. Use &uct_base_iface_internal_ops to avoid this
problem in rocm/ipc and rocm/gdr.

Signed-off-by: Edgar <edgar.gabriel@amd.com>
  • Loading branch information
edgargabriel committed Feb 14, 2022
1 parent d0f4b1a commit 7afce31
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/uct/rocm/gdr/rocm_gdr_iface.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ static UCS_CLASS_INIT_FUNC(uct_rocm_gdr_iface_t, uct_md_h md, uct_worker_h worke
const uct_iface_params_t *params,
const uct_iface_config_t *tl_config)
{
UCS_CLASS_CALL_SUPER_INIT(uct_base_iface_t, &uct_rocm_gdr_iface_ops, NULL,
UCS_CLASS_CALL_SUPER_INIT(uct_base_iface_t, &uct_rocm_gdr_iface_ops,
&uct_base_iface_internal_ops,
md, worker, params,
tl_config UCS_STATS_ARG(params->stats_root)
UCS_STATS_ARG(UCT_ROCM_GDR_TL_NAME));
Expand Down
5 changes: 3 additions & 2 deletions src/uct/rocm/ipc/rocm_ipc_iface.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,9 @@ static UCS_CLASS_INIT_FUNC(uct_rocm_ipc_iface_t, uct_md_h md, uct_worker_h worke
{
ucs_status_t status;

UCS_CLASS_CALL_SUPER_INIT(uct_base_iface_t, &uct_rocm_ipc_iface_ops, NULL,
md, worker, params,
UCS_CLASS_CALL_SUPER_INIT(uct_base_iface_t, &uct_rocm_ipc_iface_ops,
&uct_base_iface_internal_ops,
md, worker, params,
tl_config UCS_STATS_ARG(params->stats_root)
UCS_STATS_ARG(UCT_ROCM_IPC_TL_NAME));

Expand Down

0 comments on commit 7afce31

Please sign in to comment.