Currently it seems that urcu would already call pthread_join when calling call_rcu_data_free since a couple of years ago (since version v0.14.0)[0] so calling pthread_join on the just released one is problematic under musl systems. It seems like under glibc this has several checks in place before trying to dereference the thread but under musl it has nothing in place to validate so this causes a coredump on program shutdown.
This is currently present in all version when compiled under musl, running multipathd -d and sending a SIGTERM to it, you can see the coredump happening at this point in the code. The patch just removes this uneeded extra call [0] https://github.com/urcu/userspace-rcu/commit/1cf55ba47342156cdf25335264b9774a16e0bb2d Signed-off-by: Itxaka <[email protected]> --- multipathd/main.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/multipathd/main.c b/multipathd/main.c index d11a8576..0573d8f2 100644 --- a/multipathd/main.c +++ b/multipathd/main.c @@ -3739,18 +3739,14 @@ static struct call_rcu_data *mp_rcu_data; static void cleanup_rcu(void) { - pthread_t rcu_thread; - /* Wait for any pending RCU calls */ rcu_barrier(); if (mp_rcu_data != NULL) { - rcu_thread = get_call_rcu_thread(mp_rcu_data); /* detach this thread from the RCU thread */ set_thread_call_rcu_data(NULL); synchronize_rcu(); /* tell RCU thread to exit */ call_rcu_data_free(mp_rcu_data); - pthread_join(rcu_thread, NULL); } rcu_unregister_thread(); } -- 2.52.0
