From: Andrew Bartlett Date: Tue, 10 Apr 2018 03:54:10 +0000 (+1200) Subject: s3-lib: Remove support for libexc for IRIX backtraces X-Git-Tag: ldb-1.4.0~658 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=85dc9ee14023a8fb84b5c74555d43008bb6bb0c0;p=thirdparty%2Fsamba.git s3-lib: Remove support for libexc for IRIX backtraces 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 Reviewed-by: Jeremy Allison --- diff --git a/source3/lib/util.c b/source3/lib/util.c index ae9fe71c974..98c47b3df9f 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -852,10 +852,6 @@ void smb_panic_s3(const char *why) #include #endif -#ifdef HAVE_LIBEXC_H -#include -#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 diff --git a/source3/wscript b/source3/wscript index 826877d3dfd..8d658b2f53e 100644 --- a/source3/wscript +++ b/source3/wscript @@ -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')