1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-30 17:45:41 +02:00

Automatically rename log file when crashing, added backtrace to log file

This commit is contained in:
Sebastien Helleu
2006-05-20 13:42:08 +00:00
parent 0eea93bba3
commit 2322eb0625
10 changed files with 294 additions and 82 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ WeeChat - Wee Enhanced Environment for Chat
ChangeLog - 2006-05-20
Version 0.1.9 (under dev!):
* added backtrace when WeeChat crashes
* added backtrace when WeeChat crashes, log file automatically renamed
* added lock for log file (~/.weechat/weechat.log), only one WeeChat
process can use this file (bug #16382)
* fixed crash with malformed UTF-8 strings
+41 -14
View File
File diff suppressed because it is too large Load Diff
+99 -20
View File
File diff suppressed because it is too large Load Diff
+2 -1
View File
@@ -21,11 +21,12 @@
#ifndef __WEECHAT_LOG_H
#define __WEECHAT_LOG_H 1
extern char *weechat_log_filename;
extern FILE *weechat_log_file;
extern void weechat_log_init ();
extern void weechat_log_close ();
extern void weechat_log_printf (char *, ...);
extern void weechat_log_crash_rename ();
extern int weechat_log_crash_rename ();
#endif /* log.h */
+4 -5
View File
@@ -1003,20 +1003,19 @@ weechat_sigsegv ()
fprintf (stderr, "*** Very bad! WeeChat is crashing (SIGSEGV received)\n");
fprintf (stderr, "*** (%s, compiled on %s %s)\n",
PACKAGE_STRING, __DATE__, __TIME__);
fprintf (stderr, "*** Full crash dump was saved to %s/weechat.log file.\n",
weechat_home);
if (!weechat_log_crash_rename ())
fprintf (stderr, "*** Full crash dump was saved to %s/weechat.log file.\n",
weechat_home);
fprintf (stderr, "***\n");
fprintf (stderr, "*** Please help WeeChat developers to fix this bug:\n");
fprintf (stderr, "*** 1. If you have a core file, please run: gdb weechat-curses core\n");
fprintf (stderr, "*** then issue \"bt\" command and send result to developers\n");
fprintf (stderr, "*** To enable core files with bash shell: ulimit -c 10000\n");
fprintf (stderr, "*** 2. Otherwise send backtrace displayed below and weechat.log\n");
fprintf (stderr, "*** 2. Otherwise send backtrace (below) and weechat.log\n");
fprintf (stderr, "*** (be careful, private info may be in this file since\n");
fprintf (stderr, "*** part of chats are displayed, so remove lines if needed)\n\n");
fprintf (stderr, "======= WeeChat backtrace =======\n");
weechat_backtrace ();
fprintf (stderr, "======= End of backtrace =======\n");
/* shutdown with error code */
weechat_shutdown (EXIT_FAILURE, 1);
+1 -1
View File
@@ -4,7 +4,7 @@ WeeChat - Wee Enhanced Environment for Chat
ChangeLog - 2006-05-20
Version 0.1.9 (under dev!):
* added backtrace when WeeChat crashes
* added backtrace when WeeChat crashes, log file automatically renamed
* added lock for log file (~/.weechat/weechat.log), only one WeeChat
process can use this file (bug #16382)
* fixed crash with malformed UTF-8 strings
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+2 -1
View File
@@ -21,11 +21,12 @@
#ifndef __WEECHAT_LOG_H
#define __WEECHAT_LOG_H 1
extern char *weechat_log_filename;
extern FILE *weechat_log_file;
extern void weechat_log_init ();
extern void weechat_log_close ();
extern void weechat_log_printf (char *, ...);
extern void weechat_log_crash_rename ();
extern int weechat_log_crash_rename ();
#endif /* log.h */
+4 -5
View File
@@ -1003,20 +1003,19 @@ weechat_sigsegv ()
fprintf (stderr, "*** Very bad! WeeChat is crashing (SIGSEGV received)\n");
fprintf (stderr, "*** (%s, compiled on %s %s)\n",
PACKAGE_STRING, __DATE__, __TIME__);
fprintf (stderr, "*** Full crash dump was saved to %s/weechat.log file.\n",
weechat_home);
if (!weechat_log_crash_rename ())
fprintf (stderr, "*** Full crash dump was saved to %s/weechat.log file.\n",
weechat_home);
fprintf (stderr, "***\n");
fprintf (stderr, "*** Please help WeeChat developers to fix this bug:\n");
fprintf (stderr, "*** 1. If you have a core file, please run: gdb weechat-curses core\n");
fprintf (stderr, "*** then issue \"bt\" command and send result to developers\n");
fprintf (stderr, "*** To enable core files with bash shell: ulimit -c 10000\n");
fprintf (stderr, "*** 2. Otherwise send backtrace displayed below and weechat.log\n");
fprintf (stderr, "*** 2. Otherwise send backtrace (below) and weechat.log\n");
fprintf (stderr, "*** (be careful, private info may be in this file since\n");
fprintf (stderr, "*** part of chats are displayed, so remove lines if needed)\n\n");
fprintf (stderr, "======= WeeChat backtrace =======\n");
weechat_backtrace ();
fprintf (stderr, "======= End of backtrace =======\n");
/* shutdown with error code */
weechat_shutdown (EXIT_FAILURE, 1);