From d10e6455a0cdf6dc26979c8d1a101e3011c2e7d6 Mon Sep 17 00:00:00 2001 From: Nathan Hjelm Date: Thu, 1 Jun 2017 12:32:30 -0600 Subject: [PATCH] osc/sm: fix SEGV in new info usage This commit moves the info subscribe for the blocking_fence to after the global_state is allocated and moves setting win->w_osc_module to before the info subscribe for alloc_shared_contig. This fixes a SEGV caught by MTT. Signed-off-by: Nathan Hjelm --- ompi/mca/osc/sm/osc_sm_component.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/ompi/mca/osc/sm/osc_sm_component.c b/ompi/mca/osc/sm/osc_sm_component.c index ea732ab249..09e861e591 100644 --- a/ompi/mca/osc/sm/osc_sm_component.c +++ b/ompi/mca/osc/sm/osc_sm_component.c @@ -180,15 +180,10 @@ component_select(struct ompi_win_t *win, void **base, size_t size, int disp_unit calloc(1, sizeof(ompi_osc_sm_module_t)); if (NULL == module) return OMPI_ERR_TEMP_OUT_OF_RESOURCE; + win->w_osc_module = &module->super; + OBJ_CONSTRUCT(&module->lock, opal_mutex_t); - ret = opal_infosubscribe_subscribe(&(win->super), "blocking_fence", "false", - component_set_blocking_fence_info); - - module->global_state->use_barrier_for_fence = 1; - - if (OPAL_SUCCESS != ret) goto error; - ret = opal_infosubscribe_subscribe(&(win->super), "alloc_shared_contig", "false", component_set_alloc_shared_noncontig_info); if (OPAL_SUCCESS != ret) goto error; @@ -390,18 +385,20 @@ component_select(struct ompi_win_t *win, void **base, size_t size, int disp_unit #endif } + ret = opal_infosubscribe_subscribe(&(win->super), "blocking_fence", "false", + component_set_blocking_fence_info); + + if (OPAL_SUCCESS != ret) goto error; + ret = module->comm->c_coll->coll_barrier(module->comm, module->comm->c_coll->coll_barrier_module); if (OMPI_SUCCESS != ret) goto error; *model = MPI_WIN_UNIFIED; - win->w_osc_module = &module->super; - return OMPI_SUCCESS; error: - win->w_osc_module = &module->super; ompi_osc_sm_free (win); return ret;