From 0214b45a61cd7cfd59d729b23f497a687192cde6 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Wed, 4 Mar 2020 06:01:40 +0100 Subject: [PATCH] MINOR: debug: call backtrace() once upon startup Calling backtrace() will access libgcc at runtime. We don't want to do it after the chroot, so let's perform a first call to have it ready in memory for later use. --- src/debug.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/debug.c b/src/debug.c index 6b41fc3910..ec905377bd 100644 --- a/src/debug.c +++ b/src/debug.c @@ -764,6 +764,14 @@ static int init_debug() { struct sigaction sa; +#ifdef USE_BACKTRACE + /* calling backtrace() will access libgcc at runtime. We don't want to + * do it after the chroot, so let's perform a first call to have it + * ready in memory for later use. + */ + void *callers[1]; + backtrace(callers, sizeof(callers)/sizeof(*callers)); +#endif sa.sa_handler = NULL; sa.sa_sigaction = debug_handler; sigemptyset(&sa.sa_mask); -- 2.39.5