]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
hno squid-2.4.DEVEL3-hno.devel.automatic_stacktraces.patch
authorhno <>
Tue, 30 May 2000 15:30:10 +0000 (15:30 +0000)
committerhno <>
Tue, 30 May 2000 15:30:10 +0000 (15:30 +0000)
Added --enable-stacktraces configure option to set PRINT_STACK_TRACE,
and extended support for this to Linux/GNU libc.

ChangeLog
configure.in
src/tools.cc

index 6079e7ebc9a4097eaf342795e20faba9b408784d..123d54983c41a809d75ad9367c8f44ab85eae257 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -60,6 +60,8 @@ Changes to Squid ():
          manager.
        - Fixed a bogous MD5 mismatch warning sometimes seen when using
          aufs or diskd stores
+       - Added --enable-stacktraces configure option to set PRINT_STACK_TRACE,
+         and extended support for this to Linux/GNU libc.
 
 Changes to Squid-2.4.DEVEL3 ():
 
index 5ec9a453b36ea23767ac95c21ebc6adfe91bdd16..599a7000bc485cfa77c055cd19147dd9c57fe2d4 100644 (file)
@@ -3,13 +3,13 @@ dnl  Configuration input file for Squid
 dnl
 dnl  Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9)
 dnl
-dnl  $Id: configure.in,v 1.189 2000/05/29 01:13:47 wessels Exp $
+dnl  $Id: configure.in,v 1.190 2000/05/30 09:30:10 hno Exp $
 dnl
 dnl
 dnl
 AC_INIT(src/main.c)
 AC_CONFIG_HEADER(include/autoconf.h)
-AC_REVISION($Revision: 1.189 $)dnl
+AC_REVISION($Revision: 1.190 $)dnl
 AC_PREFIX_DEFAULT(/usr/local/squid)
 AC_CONFIG_AUX_DIR(cfgaux)
 
@@ -635,6 +635,15 @@ if test -n "$AUTH_MODULES"; then
 fi
 AC_SUBST(AUTH_MODULES)
 
+dnl Enable backtraces on fatal errors
+AC_ARG_ENABLE(stacktraces,
+[  --enable-stacktraces    Enable automatic call backtrace on fatal errors],
+[ if test "$enableval" = "yes" ; then
+    echo "Enabling automatic stack backtraces on fatal errors"
+    AC_DEFINE(PRINT_STACK_TRACE, 1)
+  fi
+])
+
 # Force some compilers to use ANSI features
 #
 case "$host" in
@@ -699,6 +708,7 @@ AC_CHECK_HEADERS( \
        crypt.h \
        ctype.h \
        errno.h \
+       execinfo.h \
        fcntl.h \
        getopt.h \
        gnumalloc.h \
@@ -1069,6 +1079,7 @@ fi
 dnl Check for library functions
 AC_CHECK_FUNCS(\
        bcopy \
+       backtrace_symbols_fd \
        crypt \
        fchmod \
        getdtablesize \
index f0c45b8309fc34968ecd42a169a22ecba18c7e1f..855c898ba8ca212d02ad0e6ca720776d8ee01847 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: tools.cc,v 1.191 2000/05/16 07:06:07 wessels Exp $
+ * $Id: tools.cc,v 1.192 2000/05/30 09:30:10 hno Exp $
  *
  * DEBUG: section 21    Misc Functions
  * AUTHOR: Harvest Derived
@@ -254,6 +254,14 @@ death(int sig)
        fflush(stdout);
     }
 #endif /* _SQUID_SOLARIS_ */
+#if HAVE_BACKTRACE_SYMBOLS_FD
+    {
+       static void *(callarray[8192]);
+       int n;
+       n = backtrace(callarray, 8192);
+       backtrace_symbols_fd(callarray, n, fileno(debug_log));
+    }
+#endif
 #endif /* PRINT_STACK_TRACE */
 
 #if SA_RESETHAND == 0