diff options
author | trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b <trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2004-11-28 06:10:17 +0000 |
---|---|---|
committer | trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b <trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2004-11-28 06:10:17 +0000 |
commit | f37314234168d48ea2dddba3a3b4b8fefadab8b3 (patch) | |
tree | d2a0f3dab7647c7b4b99ae7004002b242d20deff /src/main.c | |
parent | c55942927eccc7b3bf3e5aa742acdb737b4a8989 (diff) |
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
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 35 |
1 files changed, 33 insertions, 2 deletions
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 +} |