Skip to content

Commit 63878c2

Browse files
committed
osc/pt2pt: Grab the accumulate lock, not the module lock, when appending.
* Otherwise one thread could be in `opal_list_append` while the second is in `opal_list_remove_first` in `ompi_osc_pt2pt_progress_pending_acc` - The former was holding the `module` lock, while the latter was holding the `accumulate` lock so neither was properly protected. - This resulted in a segv when there was concurrent access.
1 parent 6d4b6a9 commit 63878c2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ompi/mca/osc/pt2pt/osc_pt2pt_data_move.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,9 @@ static int ompi_osc_pt2pt_acc_op_queue (ompi_osc_pt2pt_module_t *module, ompi_os
747747
}
748748

749749
/* add to the pending acc queue */
750-
OPAL_THREAD_SCOPED_LOCK(&module->lock, opal_list_append (&module->pending_acc, &pending_acc->super));
750+
ompi_osc_pt2pt_accumulate_lock(module);
751+
opal_list_append (&module->pending_acc, &pending_acc->super);
752+
ompi_osc_pt2pt_accumulate_unlock(module);
751753

752754
return OMPI_SUCCESS;
753755
}

0 commit comments

Comments
 (0)