Skip to content

Commit

Permalink
btl/usnic: move btl_usnic_lock initialization
Browse files Browse the repository at this point in the history
Previously it was in component_init, but after
open-mpi#12057 I noticed MPI finalize
would find an uninitialized object and segfault.  This change moves
the initialization to component_open, so that component_close() can
rely on the opal object initialization having been completed.

Signed-off-by: Luke Robison <[email protected]>
  • Loading branch information
lrbison committed Feb 20, 2024
1 parent 3e82472 commit 5ff314c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions opal/mca/btl/usnic/btl_usnic_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ static int usnic_component_open(void)

/* initialize objects */
OBJ_CONSTRUCT(&mca_btl_usnic_component.usnic_procs, opal_list_t);
OBJ_CONSTRUCT(&btl_usnic_lock, opal_recursive_mutex_t);


/* Sanity check: if_include and if_exclude need to be mutually
exclusive */
Expand Down Expand Up @@ -587,8 +589,6 @@ usnic_component_init(int *num_btl_modules, bool want_progress_threads, bool want
}
}

OBJ_CONSTRUCT(&btl_usnic_lock, opal_recursive_mutex_t);

/* There are multiple dimensions to consider when requesting an
API version number from libfabric:
Expand Down

0 comments on commit 5ff314c

Please sign in to comment.