mirror of
https://github.com/haproxy/haproxy.git
synced 2026-03-23 10:53:04 -04:00
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.
This commit is contained in:
parent
f5b4e064dc
commit
0214b45a61
1 changed files with 8 additions and 0 deletions
|
|
@ -764,6 +764,14 @@ static int init_debug()
|
||||||
{
|
{
|
||||||
struct sigaction sa;
|
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_handler = NULL;
|
||||||
sa.sa_sigaction = debug_handler;
|
sa.sa_sigaction = debug_handler;
|
||||||
sigemptyset(&sa.sa_mask);
|
sigemptyset(&sa.sa_mask);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue