From aad3a68b7df890a8ede7cfc7ef7e3ff9e4ffe5a5 Mon Sep 17 00:00:00 2001 From: Maksym Sobolyev Date: Sat, 5 Oct 2024 11:20:11 -0700 Subject: [PATCH] Only generate backtraces if EXTRA_DEBUG is defined. --- io_wait.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/io_wait.h b/io_wait.h index 0d9eee44a99..5231d07fed2 100644 --- a/io_wait.h +++ b/io_wait.h @@ -94,7 +94,9 @@ #ifdef __OS_linux #include /* for GLIBC version testing */ #endif +#ifdef EXTRA_DEBUG #include "lib/dbg/backtrace.h" +#endif #ifndef FD_TYPE_DEFINED typedef int fd_type; @@ -732,13 +734,17 @@ inline static int io_watch_del(io_wait_h* h, int fd, int idx, if (!(idx>=0 && idxfd_no)) { LM_CRIT("[%s] FD index check failed, idx=%d, max=%d" " operating on %d\n",h->name, idx, h->fd_no, fd ); +#ifdef EXTRA_DEBUG log_backtrace(); +#endif rla_dump(); idx = -1; } else if (h->fd_array[idx].fd!=fd) { LM_CRIT("[%s] FD consistency check failed, idx=%d points to fd=%d," " but operating on %d\n",h->name, idx, h->fd_array[idx].fd, fd ); +#ifdef EXTRA_DEBUG log_backtrace(); +#endif rla_dump(); idx = -1; }