diff options
| author | Donald Sharp <donaldsharp72@gmail.com> | 2024-10-24 21:07:09 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-24 21:07:09 -0400 |
| commit | 274c98628f0537b1f52e828d87727729e9dc635b (patch) | |
| tree | f657ebf6ae2cb67a289d5323c4ebd87b3b5f7542 /lib/sigevent.c | |
| parent | be3b97d9ed770d2c40bfc3ab18c27154ee8e3f2a (diff) | |
| parent | b3e400719750b4b40851be6044315b48f07722cb (diff) | |
Merge pull request #17155 from opensourcerouting/memstats-zlog
lib: `debug memstats-at-exit` improvements
Diffstat (limited to 'lib/sigevent.c')
| -rw-r--r-- | lib/sigevent.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/sigevent.c b/lib/sigevent.c index 3e69f280da..7c465bfcec 100644 --- a/lib/sigevent.c +++ b/lib/sigevent.c @@ -237,8 +237,18 @@ core_handler(int signo, siginfo_t *siginfo, void *context) zlog_signal(signo, "aborting...", siginfo, pc); - /* dump memory stats on core */ - log_memstats(stderr, "core_handler"); + /* there used to be a log_memstats() call here, to dump MTYPE counters + * on a coredump. This is not possible since log_memstats is not + * AS-Safe, as it calls fopen(), fprintf(), and cousins. This can + * lead to a deadlock depending on where we crashed - very much not a + * good thing if the process just hangs there after a crash. + * + * The alarm(1) above tries to alleviate this, but that's really a + * last resort recovery. Stick with AS-safe calls here. + * + * If the fprintf() calls are removed from log_memstats(), this can be + * added back in, since writing to log with zlog_sigsafe() is AS-safe. + */ /* * This is a buffer flush because FRR is going down |
