s3-lib: Remove support for libexc for IRIX backtraces
authorAndrew Bartlett <abartlet@samba.org>
Tue, 10 Apr 2018 03:54:10 +0000 (15:54 +1200)
committerJeremy Allison <jra@samba.org>
Tue, 10 Apr 2018 23:06:39 +0000 (01:06 +0200)
IRIX is long dead, and this code needs become_root() which is not in
the top level code.

Additionally, the check for libexc never made it into waf, so this
has been dead code since Samba 4.1.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/lib/util.c
source3/wscript

index ae9fe71c97495be65e1d45b02ff74392c1b30ab8..98c47b3df9f8e9a59932d76c045f23f715556fa4 100644 (file)
@@ -852,10 +852,6 @@ void smb_panic_s3(const char *why)
 #include <execinfo.h>
 #endif
 
-#ifdef HAVE_LIBEXC_H
-#include <libexc.h>
-#endif
-
 void log_stack_trace(void)
 {
 #ifdef HAVE_LIBUNWIND
@@ -934,44 +930,6 @@ libunwind_failed:
                /* Leak the backtrace_strings, rather than risk what free() might do */
        }
 
-#elif HAVE_LIBEXC
-
-       /* The IRIX libexc library provides an API for unwinding the stack. See
-        * libexc(3) for details. Apparantly trace_back_stack leaks memory, but
-        * since we are about to abort anyway, it hardly matters.
-        */
-
-#define NAMESIZE 32 /* Arbitrary */
-
-       __uint64_t      addrs[BACKTRACE_STACK_SIZE];
-       char *          names[BACKTRACE_STACK_SIZE];
-       char            namebuf[BACKTRACE_STACK_SIZE * NAMESIZE];
-
-       int             i;
-       int             levels;
-
-       ZERO_ARRAY(addrs);
-       ZERO_ARRAY(names);
-       ZERO_ARRAY(namebuf);
-
-       /* We need to be root so we can open our /proc entry to walk
-        * our stack. It also helps when we want to dump core.
-        */
-       become_root();
-
-       for (i = 0; i < BACKTRACE_STACK_SIZE; i++) {
-               names[i] = namebuf + (i * NAMESIZE);
-       }
-
-       levels = trace_back_stack(0, addrs, names,
-                       BACKTRACE_STACK_SIZE, NAMESIZE - 1);
-
-       DEBUG(0, ("BACKTRACE: %d stack frames:\n", levels));
-       for (i = 0; i < levels; i++) {
-               DEBUGADD(0, (" #%d 0x%llx %s\n", i, addrs[i], names[i]));
-       }
-#undef NAMESIZE
-
 #else
        DEBUG(0, ("unable to produce a stack trace on this platform\n"));
 #endif
index 826877d3dfd0a1b73ce6925802dc9399df7324b2..8d658b2f53e20e7fba26afedd761511bf7fc66f1 100644 (file)
@@ -96,7 +96,7 @@ def configure(conf):
     # We crash without vfs_default
     required_static_modules.extend(TO_LIST('vfs_default'))
 
-    conf.CHECK_HEADERS('execinfo.h libexc.h libunwind.h netdb.h')
+    conf.CHECK_HEADERS('execinfo.h libunwind.h netdb.h')
     conf.CHECK_HEADERS('linux/falloc.h linux/ioctl.h')
 
     conf.CHECK_FUNCS('getcwd fchown chmod fchmod mknod')