1
1

Merge pull request #6538 from bosilca/topic/issue6522

Prevent a segfault when accessing a rank outside a communicator.
Этот коммит содержится в:
bosilca 2019-04-09 18:08:49 -04:00 коммит произвёл GitHub
родитель 9bb8fd509b 6ea0c4eab9
Коммит 8cf7a7e87d
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23

Просмотреть файл

@ -82,6 +82,16 @@ static inline mca_pml_ob1_comm_proc_t *mca_pml_ob1_peer_lookup (struct ompi_comm
{
mca_pml_ob1_comm_t *pml_comm = (mca_pml_ob1_comm_t *)comm->c_pml_comm;
/**
* We have very few ways to validate the correct, and collective, creation of
* the communicator, and ensure all processes have the same cid. The least we
* can do is to check that we are not using a rank that is outside the scope
* of the communicator.
*/
if( OPAL_UNLIKELY(rank >= (int)pml_comm->num_procs) ) {
ompi_rte_abort(-1, "PML OB1 received a message from a rank outside the"
" valid range of the communicator. Please submit a bug request!");
}
if (OPAL_UNLIKELY(NULL == pml_comm->procs[rank])) {
OPAL_THREAD_LOCK(&pml_comm->proc_lock);
if (NULL == pml_comm->procs[rank]) {