From f37314234168d48ea2dddba3a3b4b8fefadab8b3 Mon Sep 17 00:00:00 2001 From: "trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b" Date: Sun, 28 Nov 2004 06:10:17 +0000 Subject: BUILD : 1.7.6 (463) BUGS : 192, 210, 222, 234 NOTES : 1. Removed +d references from the ptlink protocol code, since they do not timestamp the nicks 2. Memos sent as notification of receipt can not be cancelled. 3. Unreal3.2 supports SVSMODE -b on clearing bans 4. fixed do_kill() not remove the user from the user list 5. /os set sql [on|off] runtime sql toggle 6. Segfaults logged to the services log when DumpCore is disabled 7. fixed RUNGROUP not passed during build time 8. Exceptions now update if the limit is changed 9. Solid-IRCD support 10. Fixed TSMODE warnings when using FANTASY commands 11. Fixed read_int32 warnings (fixes compiling and running under cygwin) - Thats all.. git-svn-id: svn://svn.anope.org/anope/trunk@463 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@317 5417fbe8-f217-4b02-8779-1006273d7864 --- src/main.c | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 46d03a0ab..f7b4089b7 100644 --- a/src/main.c +++ b/src/main.c @@ -397,13 +397,20 @@ void sighandler(int signum) signum); #endif } + + if (signum == SIGSEGV) { + do_backtrace(); + } + if (started) { services_shutdown(); exit(0); } else { - alog("%s", quitmsg); - if (isatty(2)) + if (isatty(2)) { fprintf(stderr, "%s\n", quitmsg); + } else { + alog("%s", quitmsg); + } exit(1); } } @@ -554,3 +561,27 @@ int main(int ac, char **av, char **envp) } /*************************************************************************/ + +void do_backtrace(void) +{ +#ifdef HAVE_BACKTRACE + void *array[50]; + size_t size; + char **strings; + int i; + + alog("Backtrace: Segmentation fault detected"); + alog("Backtrace: report the following lines"); + alog("Backtrace: Anope version %s %s %s", version_number, + version_build, version_flags); + size = backtrace(array, 10); + strings = backtrace_symbols(array, size); + for (i = 1; i < size; i++) { + alog("Backtrace(%d): %s", i, strings[i]); + } + free(strings); + alog("Backtrace: complete"); +#else + alog("Backtrace: not available on this platform"); +#endif +} -- cgit