diff --git a/NEWS b/NEWS index fa06c2919781f311bfb56c189c67fe2e1f01f598..7a10ad2ee7ecd20ba8f34874cfb18349f96dee06 100644 --- a/NEWS +++ b/NEWS @@ -32,6 +32,7 @@ documents those changes that are of interest to users and administrators. -- Fix issue where steps weren't always getting the gres/tres involved. -- Fixed double read lock on getting job's gres/tres. -- Fix display for RoutePlugin parameter to display the correct value. + -- Fix route/topology plugin to prevent segfault in sbcast when in use. * Changes in Slurm 15.08.8 ========================== diff --git a/src/common/slurm_route.c b/src/common/slurm_route.c index f7d30297b8da18111643153e7a62fedcd287ad9e..309a6a79958484ab095abf69c44b12aa8560f0d1 100644 --- a/src/common/slurm_route.c +++ b/src/common/slurm_route.c @@ -302,7 +302,8 @@ extern int route_init(char *node_name) debug_flags = slurm_get_debug_flags(); init_run = true; - _set_collectors(node_name); + if (node_name) + _set_collectors(node_name); done: slurm_mutex_unlock(&g_context_lock); diff --git a/src/plugins/route/topology/route_topology.c b/src/plugins/route/topology/route_topology.c index afad694bb04c41568bdd1770481d22cd52ccf990..8350fd74b364ebf641b505062106f4f2000ba7db 100644 --- a/src/plugins/route/topology/route_topology.c +++ b/src/plugins/route/topology/route_topology.c @@ -96,6 +96,7 @@ const uint32_t plugin_version = SLURM_VERSION_NUMBER; /* Global data */ static uint64_t debug_flags = 0; +static pthread_mutex_t route_lock = PTHREAD_MUTEX_INITIALIZER; /*****************************************************************************\ * Functions required of all plugins @@ -152,6 +153,7 @@ extern int route_p_split_hostlist(hostlist_t hl, bitstr_t *fwd_bitmap = NULL; /* nodes in forward list */ msg_count = hostlist_count(hl); + slurm_mutex_lock(&route_lock); if (switch_record_cnt == 0) { /* configs have not already been processed */ slurm_conf_init(NULL); @@ -167,6 +169,7 @@ extern int route_p_split_hostlist(hostlist_t hl, fatal("ROUTE: Failed to build topology config"); } } + slurm_mutex_unlock(&route_lock); *sp_hl = (hostlist_t*) xmalloc(switch_record_cnt * sizeof(hostlist_t)); /* create bitmap of nodes to send message too */ if (hostlist2bitmap (hl, false, &nodes_bitmap) != SLURM_SUCCESS) { diff --git a/src/sbcast/sbcast.c b/src/sbcast/sbcast.c index fba1427819460525df6403bbf06c7c1ed4c309f1..cec1751dd0198fdfb998b2c0e78d52492bb37d52 100644 --- a/src/sbcast/sbcast.c +++ b/src/sbcast/sbcast.c @@ -60,6 +60,7 @@ #include "src/common/slurm_cred.h" #include "src/common/slurm_protocol_api.h" #include "src/common/slurm_protocol_interface.h" +#include "src/common/slurm_route.h" #include "src/common/slurm_time.h" #include "src/common/uid.h" #include "src/common/xmalloc.h" @@ -83,6 +84,7 @@ int main(int argc, char *argv[]) return 1; #endif slurm_conf_init(NULL); + route_init(NULL); parse_command_line(argc, argv); if (params.verbose) { opts.stderr_level += params.verbose;