From e65fdc78380761bc9b9531f92a8b78c42263286c Mon Sep 17 00:00:00 2001 From: antirez Date: Sun, 7 Jun 2009 15:47:59 +0200 Subject: [PATCH] enable backtrace capabilities only for Linux and MacOSX --- Changelog | 10 ++++++++++ redis.c | 7 +++++++ 2 files changed, 17 insertions(+) diff --git a/Changelog b/Changelog index 48f54e91c..b89a19899 100644 --- a/Changelog +++ b/Changelog @@ -1,8 +1,18 @@ +2009-06-07 Dump a backtrace on sigsegv/sigbus, original coded thanks to Diego Rosario Brogna, modified in order to work on different OSes and to enhance reliability +2009-06-06 Merge git://github.com/dierbro/redis +2009-06-06 add more output +2009-06-06 store static function pointer for a useful stack trace +2009-06-06 TODO updated 2009-06-06 Makefile dependencies updated 2009-06-05 Avoid a busy loop while sending very large replies against very fast links, this allows to be more responsive with other clients even under a KEY * against the loopback interface 2009-06-05 Kill the background saving process before performing SHUTDOWN to avoid races 2009-06-05 LREM now returns :0 for non existing keys +2009-06-05 - put some order in code - better output 2009-06-05 added config.h for #ifdef business isolation, added fstat64 for Mac OS X +2009-06-04 remove die() :-) +2009-06-04 add compile options to debug +2009-06-04 initial commit print stack trace +2009-06-04 initial commit print stack trace 2009-06-04 macosx specific zmalloc.c, uses malloc_size function in order to avoid to waste memory and time to put an additional header 2009-06-04 DEBUG OBJECT implemented 2009-06-04 backtrace support removed: unreliable stack trace :( diff --git a/redis.c b/redis.c index a44be7bf4..84e4be954 100644 --- a/redis.c +++ b/redis.c @@ -4108,6 +4108,7 @@ static void debugCommand(redisClient *c) { } } +#if defined(__APPLE__) || defined(__linux__) static struct redisFunctionSym symsTable[] = { {"freeStringObject", (unsigned long)freeStringObject}, {"freeListObject", (unsigned long)freeListObject}, @@ -4288,6 +4289,7 @@ static void segvHandler(int sig, siginfo_t *info, void *secret) { } static void setupSigSegvAction(void) { +#if defined(__APPLE__) || defined(__linux__) struct sigaction act; sigemptyset (&act.sa_mask); @@ -4297,8 +4299,13 @@ static void setupSigSegvAction(void) { act.sa_sigaction = segvHandler; sigaction (SIGSEGV, &act, NULL); sigaction (SIGBUS, &act, NULL); +#else + return; +#endif } +#endif /* if __APPLE__ or __linux__ */ + /* =================================== Main! ================================ */ #ifdef __linux__