We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5380875 + cace924 commit 4113f74Copy full SHA for 4113f74
src/broker/module.c
@@ -379,6 +379,15 @@ static void module_destroy (module_t *p)
379
if (p->t) {
380
if ((e = pthread_join (p->t, &res)) != 0)
381
log_errn_exit (e, "pthread_cancel");
382
+ if (p->status != FLUX_MODSTATE_EXITED) {
383
+ /* Calls broker.c module_status_cb() => service_remove_byuuid()
384
+ * and releases a reference on 'p'. Without this, disconnect
385
+ * requests sent when other modules are destroyed can still find
386
+ * this service name and trigger a use-after-free segfault.
387
+ * See also: flux-framework/flux-core#4564.
388
+ */
389
+ module_set_status (p, FLUX_MODSTATE_EXITED);
390
+ }
391
}
392
393
/* Send disconnect messages to services used by this module.
0 commit comments