diff options
| author | Donald Sharp <donaldsharp72@gmail.com> | 2025-02-12 08:18:58 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-12 08:18:58 -0500 |
| commit | 8edcdf014938ef5edd42f620d7efe2928d6a7572 (patch) | |
| tree | 1eb0b85eec9734fcb05ebaaac9835efac07776e1 /lib/frrcu.c | |
| parent | 57c152832b190c8ae0f01e09b3f79fcaa1693a36 (diff) | |
| parent | cbcc66c5d6c05414d3123f85eed0b4a38e628fa2 (diff) | |
Merge pull request #18101 from FRRouting/mergify/bp/dev/10.3/pr-18060
lib: crash handlers must be allowed on threads (backport #18060)
Diffstat (limited to 'lib/frrcu.c')
| -rw-r--r-- | lib/frrcu.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/frrcu.c b/lib/frrcu.c index b85c525c58..1e7ed99eff 100644 --- a/lib/frrcu.c +++ b/lib/frrcu.c @@ -42,6 +42,7 @@ #include "frrcu.h" #include "seqlock.h" #include "atomlist.h" +#include "sigevent.h" DEFINE_MTYPE_STATIC(LIB, RCU_THREAD, "RCU thread"); DEFINE_MTYPE_STATIC(LIB, RCU_NEXT, "RCU sequence barrier"); @@ -346,7 +347,19 @@ static void rcu_start(void) */ sigset_t oldsigs, blocksigs; - sigfillset(&blocksigs); + /* technically, the RCU thread is very poorly suited to run even just a + * crashlog handler, since zlog_sigsafe() could deadlock on transiently + * invalid (due to RCU) logging data structures + * + * but given that when we try to write a crashlog, we're already in + * b0rked territory anyway - give the crashlog handler a chance. + * + * (also cf. the SIGALRM usage in writing crashlogs to avoid hung + * processes on any kind of deadlock in crash handlers) + */ + sigemptyset(&blocksigs); + frr_sigset_add_mainonly(&blocksigs); + /* new thread inherits mask */ pthread_sigmask(SIG_BLOCK, &blocksigs, &oldsigs); rcu_active = true; |
