Skip to content

Commit

Permalink
Merge pull request #6765 from alinask/topic/topic/ucp-fix-access-null…
Browse files Browse the repository at this point in the history
…-cm-v1-10

UCP: handle a case of a null cm on the worker - v1.10.x
  • Loading branch information
yosefe authored May 9, 2021
2 parents b50b0af + 3a307d4 commit f633e85
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* Fixes in ABI backward compatibility for active message protocol
* Add support for DC full-handshake mode (off by default).
* Fixes in Active Messages short reply protocol.
* Fixes for segmentation fault while listening for connections.

## 1.10.0 (March 9, 2021)
### Features:
Expand Down
4 changes: 4 additions & 0 deletions src/ucp/core/ucp_listener.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@ ucp_listen_on_cm(ucp_listener_h listener, const ucp_listener_params_t *params)

for (i = 0; i < num_cms; ++i) {
ucp_cm = &worker->cms[i];
if (ucp_cm->cm == NULL) {
continue;
}

status = uct_listener_create(ucp_cm->cm, addr,
params->sockaddr.addrlen, &uct_params,
&uct_listeners[listener->num_rscs]);
Expand Down
3 changes: 2 additions & 1 deletion src/ucp/wireup/wireup_cm.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ static int ucp_cm_client_try_fallback_cms(ucp_ep_h ep)
ucp_rsc_index_t next_cm_idx = cm_wireup_ep->cm_idx + 1;
uct_worker_cb_id_t prog_id = UCS_CALLBACKQ_ID_NULL;

if (next_cm_idx >= ucp_worker_num_cm_cmpts(worker)) {
if ((next_cm_idx >= ucp_worker_num_cm_cmpts(worker)) ||
(worker->cms[next_cm_idx].cm == NULL)) {
ucs_debug("reached the end of the cms priority list, no cms left to"
" check (sockaddr_cm=%s, cm_idx=%d).",
ucp_context_cm_name(worker->context, cm_wireup_ep->cm_idx),
Expand Down

0 comments on commit f633e85

Please sign in to comment.