From 3fbb5023c221ab297f39cf31ccaf2d70a76f0623 Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Tue, 15 Mar 2011 23:36:28 +0100 Subject: [PATCH] Add some more debugging to the session destroyer; -> backtrace. --- citadel/context.c | 7 ++++++- citadel/debian/rules | 7 +++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/citadel/context.c b/citadel/context.c index cfe30334e..0b545139b 100644 --- a/citadel/context.c +++ b/citadel/context.c @@ -332,12 +332,17 @@ void terminate_stuck_sessions(void) */ void RemoveContext (CitContext *con) { + const char *c; if (con==NULL) { syslog(LOG_ERR, "WARNING: RemoveContext() called with NULL!\n"); return; } - syslog(LOG_DEBUG, "RemoveContext() session %d\n", con->cs_pid); + c = con->ServiceName; + if (c == NULL) + c = "WTF?"; + syslog(LOG_DEBUG, "RemoveContext(%s) session %d\n", c, con->cs_pid); + cit_backtrace (); /* Run any cleanup routines registered by loadable modules. * Note: We have to "become_session()" because the cleanup functions diff --git a/citadel/debian/rules b/citadel/debian/rules index a28907b67..85489575c 100755 --- a/citadel/debian/rules +++ b/citadel/debian/rules @@ -23,6 +23,7 @@ endif ifneq (,$(findstring profiling,$(DEB_BUILD_OPTIONS))) PROFILE_ARGS= --with-gprof endif + ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 -ggdb -rdynamic -D_GNU_SOURCE -MD -MP -D TECH_PREVIEW LDFLAGS+=-Wl,--no-undefined -Wl,--as-needed @@ -35,6 +36,12 @@ else CFLAGS += -O2 endif +ifneq (,$(findstring backtrace,$(DEB_BUILD_OPTIONS))) + CFLAGS+= -rdynamic -D_GNU_SOURCE -MD -MP + LDFLAGS+=-Wl,--no-undefined -Wl,--as-needed + EXTRA_ARGS += --with-backtrace +endif + ifneq (,$(findstring threadoff,$(DEB_BUILD_OPTIONS))) THREAD_ARGS=--without-threaded-client CFLAGS += -D WITH_THREADLOG -- 2.30.2