summaryrefslogtreecommitdiffstats
path: root/src/Hooks
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-02-12 17:52:11 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2010-02-12 17:52:11 +0100
commit78b940643724e2ea9dc32cadfc2750ea3af571a5 (patch)
tree83dfa54512a83f6d9d4f95fd6f33c02e83efd63f /src/Hooks
parentec617bd344e75baa0c436d253bc3dc6323536cd7 (diff)
downloadabrt-78b940643724e2ea9dc32cadfc2750ea3af571a5.tar.gz
abrt-78b940643724e2ea9dc32cadfc2750ea3af571a5.tar.xz
abrt-78b940643724e2ea9dc32cadfc2750ea3af571a5.zip
abrt-hook-ccpp: do not consider SIGQUIT to be a crash
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'src/Hooks')
-rw-r--r--src/Hooks/abrt-hook-ccpp.cpp60
-rw-r--r--src/Hooks/abrt-hook-python.cpp15
2 files changed, 33 insertions, 42 deletions
diff --git a/src/Hooks/abrt-hook-ccpp.cpp b/src/Hooks/abrt-hook-ccpp.cpp
index 9d1dc19c..d21b8e6b 100644
--- a/src/Hooks/abrt-hook-ccpp.cpp
+++ b/src/Hooks/abrt-hook-ccpp.cpp
@@ -82,31 +82,52 @@ int main(int argc, char** argv)
/* set to max possible >0 value */
ulimit_c = ~((off_t)1 << (sizeof(off_t)*8-1));
}
- off_t core_size = 0;
-
if (errno || pid <= 0)
{
error_msg_and_die("pid '%s' or limit '%s' is bogus", argv[2], argv[5]);
}
+ char* executable = get_executable(pid);
+ if (executable == NULL)
+ {
+ error_msg_and_die("can't read /proc/%lu/exe link", (long)pid);
+ }
+ if (strstr(executable, "/abrt-hook-ccpp"))
+ {
+ error_msg_and_die("pid %lu is '%s', not dumping it to avoid recursion",
+ (long)pid, executable);
+ }
+
+ char *user_pwd = get_cwd(pid); /* may be NULL on error */
+
+ /* Parse abrt.conf and plugins/CCpp.conf */
+ unsigned setting_MaxCrashReportsSize = 0;
+ bool setting_MakeCompatCore = false;
+ parse_conf(CONF_DIR"/plugins/CCpp.conf", &setting_MaxCrashReportsSize, &setting_MakeCompatCore);
+
+ int core_fd = STDIN_FILENO;
+ off_t core_size = 0;
+
const char *signame = NULL;
/* Tried to use array for this but C++ does not support v[] = { [IDX] = "str" } */
switch (signal_no)
{
- case SIGQUIT: signame = "QUIT"; break;
case SIGILL : signame = "ILL" ; break;
- case SIGABRT: signame = "ABRT"; break;
case SIGFPE : signame = "FPE" ; break;
case SIGSEGV: signame = "SEGV"; break;
+ case SIGBUS : signame = "BUS" ; break; //Bus error (bad memory access)
+ case SIGABRT: signame = "ABRT"; break; //usually when abort() was called
+ //case SIGQUIT: signame = "QUIT"; break; //Quit from keyboard
+ //case SIGSYS : signame = "SYS" ; break; //Bad argument to routine (SVr4)
+ //case SIGTRAP: signame = "TRAP"; break; //Trace/breakpoint trap
+ //case SIGXCPU: signame = "XCPU"; break; //CPU time limit exceeded (4.2BSD)
+ //case SIGXFSZ: signame = "XFSZ"; break; //File size limit exceeded (4.2BSD)
}
if (signame == NULL) {
- /* not a signal we care about, exit silently */
- return 0;
+ /* not a signal we care about */
+ goto create_user_core;
}
- char *user_pwd = get_cwd(pid); /* may be NULL on error */
- int core_fd = STDIN_FILENO;
-
if (!daemon_is_ok())
{
/* not an error, exit with exitcode 0 */
@@ -119,22 +140,6 @@ int main(int argc, char** argv)
try
{
- char* executable = get_executable(pid);
- if (executable == NULL)
- {
- error_msg_and_die("can't read /proc/%lu/exe link", (long)pid);
- }
- if (strstr(executable, "/abrt-hook-ccpp"))
- {
- error_msg_and_die("pid %lu is '%s', not dumping it to avoid recursion",
- (long)pid, executable);
- }
-
- /* Parse abrt.conf and plugins/CCpp.conf */
- unsigned setting_MaxCrashReportsSize = 0;
- bool setting_MakeCompatCore = false;
- parse_conf(CONF_DIR"/plugins/CCpp.conf", &setting_MaxCrashReportsSize, &setting_MakeCompatCore);
-
if (setting_MaxCrashReportsSize > 0)
{
check_free_space(setting_MaxCrashReportsSize);
@@ -267,8 +272,6 @@ int main(int argc, char** argv)
trim_debug_dumps(setting_MaxCrashReportsSize, path);
}
- if (!setting_MakeCompatCore)
- return 0;
/* fall through to creating user core */
}
catch (CABRTException& e)
@@ -282,6 +285,9 @@ int main(int argc, char** argv)
create_user_core:
+ if (!setting_MakeCompatCore)
+ return 0;
+
/* note: core_size may be == 0 ("unknown") */
if (core_size > ulimit_c || ulimit_c == 0)
return 0;
diff --git a/src/Hooks/abrt-hook-python.cpp b/src/Hooks/abrt-hook-python.cpp
index 356174f8..34459540 100644
--- a/src/Hooks/abrt-hook-python.cpp
+++ b/src/Hooks/abrt-hook-python.cpp
@@ -37,21 +37,6 @@
static char *pid;
static char *executable;
-// Note: "" will return false
-static bool isxdigit_str(const char *str)
-{
- do {
- if ((*str < '0' || *str > '9') // not a digit
- && ((*str | 0x20) < 'a' || (*str | 0x20) > 'f') // not A-F or a-f
- )
- {
- return false;
- }
- str++;
- } while (*str);
- return true;
-}
-
static bool printable_str(const char *str)
{
do {