new version 2.0.7

This commit is contained in:
Jiri 2011-12-07 10:38:57 +01:00
commit 9b168d3bcb
18 changed files with 49 additions and 1677 deletions

View file

@ -1,40 +0,0 @@
From 1f52667a18026dba4050368e5d2501ec6145e071 Mon Sep 17 00:00:00 2001
From: Denys Vlasenko <dvlasenk@redhat.com>
Date: Thu, 21 Jul 2011 09:50:56 +0200
Subject: [PATCH 1/4] abrt-gui: launch reporter children with LIBREPORT_GETPID
By using LIBREPORT_NOWAIT | LIBREPORT_GETPID in abt-gui,
we make it so that reporter's SIGCHLD reaches abrt-gui
and lets it refresh the list.
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
---
src/gui-gtk/main.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/gui-gtk/main.c b/src/gui-gtk/main.c
index b62e8c0..1409191 100644
--- a/src/gui-gtk/main.c
+++ b/src/gui-gtk/main.c
@@ -204,7 +204,7 @@ static void on_row_activated_cb(GtkTreeView *treeview, GtkTreePath *path, GtkTre
gtk_tree_model_get_value(store, &iter, COLUMN_DUMP_DIR, &d_dir);
const char *dirname = g_value_get_string(&d_dir);
- report_problem_in_dir(dirname, LIBREPORT_ANALYZE | LIBREPORT_NOWAIT);
+ report_problem_in_dir(dirname, LIBREPORT_ANALYZE | LIBREPORT_NOWAIT | LIBREPORT_GETPID);
}
}
}
@@ -293,8 +293,7 @@ static void on_button_send_cb(GtkWidget *button, gpointer data)
/* why it doesn't want to hide before report ends? */
gtk_widget_destroy(s_report_window);
- int status = report_problem_in_memory(pd, LIBREPORT_NOWAIT);
- VERB1 log("Reporting finished with status %i", status);
+ report_problem_in_memory(pd, LIBREPORT_NOWAIT | LIBREPORT_GETPID);
free_problem_data(pd);
}
--
1.7.6

View file

@ -1,192 +0,0 @@
From 82b27dca87ef5a4f1cbb29377524bbdee26b1d64 Mon Sep 17 00:00:00 2001
Message-Id: <82b27dca87ef5a4f1cbb29377524bbdee26b1d64.1317979766.git.npajkovs@redhat.com>
From: Nikola Pajkovsky <npajkovs@redhat.com>
Date: Wed, 5 Oct 2011 15:13:23 +0200
Subject: [PATCH 1/2] rhbz#724838 - don't file kernel bugs if "tainted: B" is
set
Kernel maintainers are not much happy that we filling bugs when kernel
is tainted.
Dave Jones said
---
If something has corrupted memory, we typically see a whole bunch of things
start crashing. This leads to situations where abrt files a lot of bugs, even
though most of them are just fallout from the first.
an example: bugs 710925 710930 710932 710933 710935 710942 710948 710955 710956
are all the same crash. The traces and addresses are different, but 'something
scribbled over memory' is the root cause here. Sadly out of all those bugs, we
actually somehow missed the first crash which is the most relevant one. (That
one would have not had the 'Tainted: G B' text)
---
First part of the patch is that we won't relay on /proc/sys/kernel/tainted and
we will parse the kernel bt manually, because of reading that file after an oops
is ALWAYS going to show it as tainted.
Second part of the patch is that whenever you want to prohibit reporting, put a
file with name *not-reportable* into <dump-dir>. That file could be empty or with
reasonable message why are you trying to prohibit reporting.
All 3 reporters plugins will be respect that file and it won't try to report anything.
Reporters will show only the messages from *not-reportable* and *reason*.
Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
---
src/gui-gtk/main.c | 16 ++++++++--
src/plugins/abrt-dump-oops.c | 65 +++++++++++++++++++++++------------------
2 files changed, 49 insertions(+), 32 deletions(-)
diff --git a/src/gui-gtk/main.c b/src/gui-gtk/main.c
index 8172951..d11bf57 100644
--- a/src/gui-gtk/main.c
+++ b/src/gui-gtk/main.c
@@ -100,7 +100,14 @@ static void add_directory_to_dirlist(const char *dirname)
}
free(time_str);
- char *reason = dd_load_text(dd, FILENAME_REASON);
+
+ char *not_reportable_reason = dd_load_text_ext(dd, FILENAME_NOT_REPORTABLE, 0
+ | DD_LOAD_TEXT_RETURN_NULL_ON_FAILURE
+ | DD_FAIL_QUIETLY_ENOENT
+ | DD_FAIL_QUIETLY_EACCES);
+ char *reason = NULL;
+ if (!not_reportable_reason)
+ reason = dd_load_text(dd, FILENAME_REASON);
/* the source of the problem:
* - first we try to load component, as we use it on Fedora
@@ -142,7 +149,7 @@ static void add_directory_to_dirlist(const char *dirname)
gtk_list_store_append(list_store, &iter);
gtk_list_store_set(list_store, &iter,
COLUMN_SOURCE, source,
- COLUMN_REASON, reason,
+ COLUMN_REASON, not_reportable_reason? :reason,
//OPTION: time format
COLUMN_LATEST_CRASH_STR, time_buf,
COLUMN_LATEST_CRASH, t,
@@ -150,6 +157,7 @@ static void add_directory_to_dirlist(const char *dirname)
COLUMN_REPORTED_TO, msg ? subm_status : NULL,
-1);
/* this is safe, subm_status is either null or malloced string from get_last_line */
+ free(not_reportable_reason);
free(subm_status);
free(msg);
free(reason);
@@ -243,7 +251,9 @@ static void on_row_activated_cb(GtkTreeView *treeview, GtkTreePath *path, GtkTre
gtk_tree_model_get_value(store, &iter, COLUMN_DUMP_DIR, &d_dir);
const char *dirname = g_value_get_string(&d_dir);
- report_problem_in_dir(dirname, LIBREPORT_ANALYZE | LIBREPORT_NOWAIT | LIBREPORT_GETPID);
+
+ report_problem_in_dir(dirname,
+ LIBREPORT_ANALYZE | LIBREPORT_NOWAIT | LIBREPORT_GETPID);
}
}
}
diff --git a/src/plugins/abrt-dump-oops.c b/src/plugins/abrt-dump-oops.c
index 76c699d..58af506 100644
--- a/src/plugins/abrt-dump-oops.c
+++ b/src/plugins/abrt-dump-oops.c
@@ -480,16 +480,6 @@ static unsigned save_oops_to_dump_dir(GList *oops_list, unsigned oops_cnt)
VERB1 log("Saving %u oopses as dump dirs", idx >= countdown ? countdown-1 : idx);
- char *tainted_str = NULL;
- FILE *tainted_fp = fopen("/proc/sys/kernel/tainted", "r");
- if (tainted_fp)
- {
- tainted_str = xmalloc_fgetline(tainted_fp);
- fclose(tainted_fp);
- }
- else
- perror_msg("Can't open '%s'", "/proc/sys/kernel/tainted");
-
char *cmdline_str = NULL;
FILE *cmdline_fp = fopen("/proc/cmdline", "r");
if (cmdline_fp)
@@ -536,35 +526,44 @@ static unsigned save_oops_to_dump_dir(GList *oops_list, unsigned oops_cnt)
if (cmdline_str)
dd_save_text(dd, FILENAME_CMDLINE, cmdline_str);
dd_save_text(dd, FILENAME_BACKTRACE, second_line);
-// TODO: add "Kernel oops: " prefix, so that all oopses have recognizable FILENAME_REASON?
-// kernel oops 1st line may look quite puzzling otherwise...
- strchrnul(second_line, '\n')[0] = '\0';
- dd_save_text(dd, FILENAME_REASON, second_line);
- if (tainted_str && tainted_str[0] != '0')
+ char *tainted_short = kernel_tainted_short(second_line);
+ if (tainted_short)
{
- unsigned long tainted = xatoi_positive(tainted_str);
- char *tainted_short = kernel_tainted_short(tainted);
- GList *tainted_long = kernel_tainted_long(tainted);
-
- struct strbuf *tnt_long = strbuf_new();
- for (GList *li = tainted_long; li; li = li->next)
- strbuf_append_strf(tnt_long, "%s\n", (char*) li->data);
-
- dd_save_text(dd, FILENAME_TAINTED, tainted_str);
+ VERB1 log("Kernel is tainted '%s'", tainted_short);
dd_save_text(dd, FILENAME_TAINTED_SHORT, tainted_short);
- dd_save_text(dd, FILENAME_TAINTED_LONG, tnt_long->buf);
- strbuf_free(tnt_long);
- list_free_with_free(tainted_long);
+ char *reason = xasprintf("Your kernel is tainted by flags '%s'. "
+ "Kernel maintainers are not interesting about "
+ "tainted kernel, because the trace might not be showing "
+ "the root problem."
+ , tainted_short);
+ dd_save_text(dd, FILENAME_NOT_REPORTABLE, reason);
+ free(reason);
}
+// TODO: add "Kernel oops: " prefix, so that all oopses have recognizable FILENAME_REASON?
+// kernel oops 1st line may look quite puzzling otherwise...
+ strchrnul(second_line, '\n')[0] = '\0';
+ dd_save_text(dd, FILENAME_REASON, second_line);
+/*
+ GList *tainted_long = kernel_tainted_long(tainted);
+
+ struct strbuf *tnt_long = strbuf_new();
+ for (GList *li = tainted_long; li; li = li->next)
+ strbuf_append_strf(tnt_long, "%s\n", (char*) li->data);
+
+ dd_save_text(dd, FILENAME_TAINTED, tainted_str);
+ dd_save_text(dd, FILENAME_TAINTED_SHORT, tainted_short);
+ dd_save_text(dd, FILENAME_TAINTED_LONG, tnt_long->buf);
+ strbuf_free(tnt_long);
+ list_free_with_free(tainted_long);
+*/
dd_close(dd);
}
else
errors++;
}
- free(tainted_str);
free(cmdline_str);
return errors;
@@ -718,7 +717,15 @@ int main(int argc, char **argv)
{
int i = 0;
while (i < oops_cnt)
- printf("\nVersion: %s", (char*)g_list_nth_data(oops_list, i++));
+ {
+ char *kernel_bt = (char*)g_list_nth_data(oops_list, i++);
+ char *tainted_short = kernel_tainted_short(kernel_bt);
+ if (tainted_short)
+ log("Kernel is tainted '%s'", tainted_short);
+
+ free(tainted_short);
+ printf("\nVersion: %s", kernel_bt);
+ }
}
if ((opts & OPT_d) || (opts & OPT_D))
{
--
1.7.7.rc0.70.g82660

View file

@ -0,0 +1,27 @@
From 3e39d5b9944536a6f4d4f266b3c4961ad8da443e Mon Sep 17 00:00:00 2001
From: Jiri <moskovcak@gmail.com>
Date: Wed, 7 Dec 2011 10:34:27 +0100
Subject: [PATCH 2/2] disabled reporting to kerneloops.org
- we get lot of complains about dead kerneloops.org and since it's
not wihtin our power to fix it -> disable it!
---
src/plugins/koops_event.conf | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/plugins/koops_event.conf b/src/plugins/koops_event.conf
index 3b80a1b..2fdccda 100644
--- a/src/plugins/koops_event.conf
+++ b/src/plugins/koops_event.conf
@@ -10,7 +10,7 @@ EVENT=post-create analyzer=Kerneloops
reporter-kerneloops
# report
-EVENT=report_Kerneloops analyzer=Kerneloops
+#EVENT=report_Kerneloops analyzer=Kerneloops
reporter-kerneloops
EVENT=report_Bugzilla analyzer=Kerneloops
--
1.7.7.3

View file

@ -1,79 +0,0 @@
From af62f5f9fc31a8b24a56983d37cad2d29380ff20 Mon Sep 17 00:00:00 2001
From: Jiri Moskovcak <jmoskovc@redhat.com>
Date: Fri, 4 Nov 2011 15:28:15 +0100
Subject: [PATCH 2/2] gtk3 build fixes
---
configure.ac | 7 ++++++-
src/applet/applet.c | 4 ++--
src/gui-gtk/main.c | 7 ++++++-
3 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/configure.ac b/configure.ac
index 6b0732c..d584047 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,6 +20,11 @@ AC_ARG_ENABLE(debug,
[Enable debug information])],
[CFLAGS="$CFLAGS -DDEBUG -ggdb -g"])
+AC_ARG_ENABLE(gtk3,
+ [AC_HELP_STRING([--enable-gtk3],
+ [Use gtk3 instead of gtk2])],
+ [GTK_VER="gtk+-3.0"],[GTK_VER="gtk+-2.0"])
+
dnl ****** INTERNATIONALIZATION **********************
GETTEXT_PACKAGE=abrt
AC_SUBST(GETTEXT_PACKAGE)
@@ -56,7 +61,7 @@ AC_PATH_PROG([XMLTO], [xmlto], [no])
[exit 1]
[fi]
-PKG_CHECK_MODULES([GTK], [gtk+-2.0])
+PKG_CHECK_MODULES([GTK], [$GTK_VER])
PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.21])
PKG_CHECK_MODULES([DBUS], [dbus-1])
PKG_CHECK_MODULES([LIBXML], [libxml-2.0])
diff --git a/src/applet/applet.c b/src/applet/applet.c
index 4ff73b6..95b7091 100644
--- a/src/applet/applet.c
+++ b/src/applet/applet.c
@@ -581,8 +581,8 @@ static void init_applet(void)
ap_status_icon = gtk_status_icon_new_from_icon_name("abrt");
}
hide_icon();
- g_signal_connect(G_OBJECT(ap_status_icon), "activate", GTK_SIGNAL_FUNC(on_applet_activate_cb), NULL);
- g_signal_connect(G_OBJECT(ap_status_icon), "popup_menu", GTK_SIGNAL_FUNC(on_menu_popup_cb), NULL);
+ g_signal_connect(G_OBJECT(ap_status_icon), "activate", G_CALLBACK(on_applet_activate_cb), NULL);
+ g_signal_connect(G_OBJECT(ap_status_icon), "popup_menu", G_CALLBACK(on_menu_popup_cb), NULL);
ap_menu = create_menu();
}
diff --git a/src/gui-gtk/main.c b/src/gui-gtk/main.c
index a8aacec..b31509b 100644
--- a/src/gui-gtk/main.c
+++ b/src/gui-gtk/main.c
@@ -25,6 +25,11 @@
#include <internal_libreport_gtk.h>
#include "libabrt.h"
+#if GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION < 22
+# define GDK_KEY_Delete GDK_Delete
+# define GDK_KEY_KP_Delete GDK_KP_Delete
+#endif
+
static void scan_dirs_and_add_to_dirlist(void);
@@ -460,7 +465,7 @@ static gint on_key_press_event_cb(GtkTreeView *treeview, GdkEventKey *key, gpoin
{
int k = key->keyval;
- if (k == GDK_Delete || k == GDK_KP_Delete)
+ if (k == GDK_KEY_Delete || k == GDK_KEY_KP_Delete)
{
delete_report(treeview);
return TRUE;
--
1.7.7

View file

@ -1,354 +0,0 @@
From 3f3655980007d39e0377e76a49fd2937f43f0be7 Mon Sep 17 00:00:00 2001
From: Jiri Moskovcak <jmoskovc@redhat.com>
Date: Thu, 21 Jul 2011 11:02:11 +0200
Subject: [PATCH 2/4] gui: split the main window in 2 panes -
reported/not-reported
---
src/gui-gtk/main.c | 215 ++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 182 insertions(+), 33 deletions(-)
diff --git a/src/gui-gtk/main.c b/src/gui-gtk/main.c
index 1409191..776e85a 100644
--- a/src/gui-gtk/main.c
+++ b/src/gui-gtk/main.c
@@ -32,7 +32,9 @@ static const char help_uri[] = "http://docs.fedoraproject.org/en-US/"
"Fedora/14/html/Deployment_Guide/ch-abrt.html";
static GtkListStore *s_dumps_list_store;
+static GtkListStore *s_reported_dumps_list_store;
static GtkWidget *s_treeview;
+static GtkWidget *s_reported_treeview;
static GtkWidget *g_main_window;
static GtkWidget *s_report_window;
@@ -40,13 +42,38 @@ enum
{
COLUMN_SOURCE,
COLUMN_REASON,
- COLUMN_DIRNAME,
COLUMN_LATEST_CRASH_STR,
COLUMN_LATEST_CRASH,
COLUMN_DUMP_DIR,
+ COLUMN_REPORTED_TO,
NUM_COLUMNS
};
+//FIXME: maybe we can use strrchr and make this faster...
+static char *get_last_line(const char* msg)
+{
+ const char *curr_end = NULL;
+ const char *start = msg;
+ const char *end = msg;
+
+ while((curr_end = strchr(end, '\n')) != NULL)
+ {
+ end = curr_end;
+ curr_end = strchr(end+1, '\n');
+ if (curr_end == NULL || strchr(end+2, '\n') == NULL)
+ break;
+
+ start = end+1;
+ end = curr_end;
+ }
+
+ //fix the case where reported_to has only 1 line without \n
+ if (end == msg)
+ end = end + strlen(msg);
+
+ return xstrndup(start, end - start);
+}
+
static void add_directory_to_dirlist(const char *dirname)
{
/* Silently ignore *any* errors, not only EACCES.
@@ -67,21 +94,11 @@ static void add_directory_to_dirlist(const char *dirname)
{
time_t t = strtol(time_str, NULL, 10); /* atoi won't work past 2038! */
struct tm *ptm = localtime(&t);
- size_t time_len = strftime(time_buf, sizeof(time_buf)-1, "%Y-%m-%m %H:%M", ptm);
+ size_t time_len = strftime(time_buf, sizeof(time_buf)-1, "%Y-%m-%d %H:%M", ptm);
time_buf[time_len] = '\0';
}
free(time_str);
- /*
- char *msg = dd_load_text_ext(dd, FILENAME_REPORTED_TO, 0
- | DD_LOAD_TEXT_RETURN_NULL_ON_FAILURE
- | DD_FAIL_QUIETLY_ENOENT
- | DD_FAIL_QUIETLY_EACCES
- );
- const char *reported = (msg ? GTK_STOCK_YES : GTK_STOCK_NO);
- free(msg);
- */
-
char *reason = dd_load_text(dd, FILENAME_REASON);
/* the source of the problem:
@@ -102,18 +119,38 @@ static void add_directory_to_dirlist(const char *dirname)
);
}
+ char *msg = dd_load_text_ext(dd, FILENAME_REPORTED_TO, 0
+ | DD_LOAD_TEXT_RETURN_NULL_ON_FAILURE
+ | DD_FAIL_QUIETLY_ENOENT
+ | DD_FAIL_QUIETLY_EACCES
+ );
+
+
+ GtkListStore *list_store;
+
+ char *subm_status = NULL;
+ if (msg)
+ {
+ list_store = s_reported_dumps_list_store;
+ subm_status = get_last_line(msg);
+ }
+ else
+ list_store = s_dumps_list_store;
GtkTreeIter iter;
- gtk_list_store_append(s_dumps_list_store, &iter);
- gtk_list_store_set(s_dumps_list_store, &iter,
+ gtk_list_store_append(list_store, &iter);
+ gtk_list_store_set(list_store, &iter,
COLUMN_SOURCE, source,
COLUMN_REASON, reason,
- COLUMN_DIRNAME, dd->dd_dirname,
//OPTION: time format
COLUMN_LATEST_CRASH_STR, time_buf,
COLUMN_LATEST_CRASH, time,
COLUMN_DUMP_DIR, dirname,
+ COLUMN_REPORTED_TO, msg ? subm_status : NULL,
-1);
+ /* this is safe, subm_status is either null or malloced string from get_last_line */
+ free(subm_status);
+ free(msg);
free(reason);
dd_close(dd);
@@ -123,6 +160,7 @@ static void add_directory_to_dirlist(const char *dirname)
static void rescan_dirs_and_add_to_dirlist(void)
{
gtk_list_store_clear(s_dumps_list_store);
+ gtk_list_store_clear(s_reported_dumps_list_store);
scan_dirs_and_add_to_dirlist();
}
@@ -232,7 +270,7 @@ static void delete_report(GtkTreeView *treeview)
VERB1 log("Deleting '%s'", dump_dir_name);
if (delete_dump_dir_possibly_using_abrtd(dump_dir_name) == 0)
{
- gtk_list_store_remove(s_dumps_list_store, &iter);
+ gtk_list_store_remove(GTK_LIST_STORE(store), &iter);
}
else
{
@@ -262,7 +300,9 @@ static gint on_key_press_event_cb(GtkTreeView *treeview, GdkEventKey *key, gpoin
static void on_btn_delete_cb(GtkButton *button, gpointer unused)
{
+ /* delete from both treeviews */
delete_report(GTK_TREE_VIEW(s_treeview));
+ delete_report(GTK_TREE_VIEW(s_reported_treeview));
}
static void on_menu_help_cb(GtkMenuItem *menuitem, gpointer unused)
@@ -421,6 +461,50 @@ static void add_columns(GtkTreeView *treeview)
gtk_tree_view_append_column(treeview, column);
}
+static void add_columns_reported(GtkTreeView *treeview)
+{
+ GtkCellRenderer *renderer;
+ GtkTreeViewColumn *column;
+
+ renderer = gtk_cell_renderer_text_new();
+ column = gtk_tree_view_column_new_with_attributes(_("Source"),
+ renderer,
+ "text",
+ COLUMN_SOURCE,
+ NULL);
+ gtk_tree_view_column_set_resizable(column, TRUE);
+ gtk_tree_view_column_set_sort_column_id(column, COLUMN_SOURCE);
+ gtk_tree_view_append_column(treeview, column);
+
+ renderer = gtk_cell_renderer_text_new();
+ column = gtk_tree_view_column_new_with_attributes(_("Problem"),
+ renderer,
+ "text",
+ COLUMN_REASON,
+ NULL);
+ gtk_tree_view_column_set_resizable(column, TRUE);
+ gtk_tree_view_column_set_sort_column_id(column, COLUMN_REASON);
+ gtk_tree_view_append_column(treeview, column);
+
+ renderer = gtk_cell_renderer_text_new();
+ column = gtk_tree_view_column_new_with_attributes(_("Date Submitted"),
+ renderer,
+ "text",
+ COLUMN_LATEST_CRASH_STR,
+ NULL);
+ gtk_tree_view_column_set_sort_column_id(column, COLUMN_LATEST_CRASH);
+ gtk_tree_view_append_column(treeview, column);
+
+ renderer = gtk_cell_renderer_text_new();
+ column = gtk_tree_view_column_new_with_attributes(_("Submision Result"),
+ renderer,
+ "text",
+ COLUMN_REPORTED_TO,
+ NULL);
+ //gtk_tree_view_column_set_sort_column_id(column, COLUMN_LATEST_CRASH);
+ gtk_tree_view_append_column(treeview, column);
+}
+
static GtkWidget *create_menu(void)
{
/* main bar */
@@ -476,40 +560,102 @@ static GtkWidget *create_main_window(void)
gtk_window_set_default_icon_name("abrt");
GtkWidget *main_vbox = gtk_vbox_new(false, 0);
+ /* add menu */
+ gtk_box_pack_start(GTK_BOX(main_vbox), create_menu(), false, false, 0);
- /* Scrolled region inside main window */
- GtkWidget *scroll_win = gtk_scrolled_window_new(NULL, NULL);
- gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scroll_win),
+ GtkWidget *not_subm_vbox = gtk_vbox_new(false, 0);
+ gtk_container_set_border_width(GTK_CONTAINER(not_subm_vbox), 10);
+ GtkWidget *subm_vbox = gtk_vbox_new(false, 0);
+ gtk_container_set_border_width(GTK_CONTAINER(subm_vbox), 10);
+
+ /* Scrolled region for not reported problems inside main window*/
+ GtkWidget *new_problems_scroll_win = gtk_scrolled_window_new(NULL, NULL);
+ gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(new_problems_scroll_win),
GTK_SHADOW_ETCHED_IN);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll_win),
+ gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(new_problems_scroll_win),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
- gtk_box_pack_start(GTK_BOX(main_vbox), create_menu(), false, false, 0);
- gtk_box_pack_start(GTK_BOX(main_vbox), scroll_win, true, true, 0);
- gtk_container_add(GTK_CONTAINER(g_main_window), main_vbox);
+ GtkWidget *not_subm_lbl = gtk_label_new(_("Not submitted reports"));
+ gtk_misc_set_alignment(GTK_MISC(not_subm_lbl), 0, 0);
+ gtk_label_set_markup(GTK_LABEL(not_subm_lbl), _("<b>Not submitted reports</b>"));
+
+ /* add label for not submitted tree view */
+ gtk_box_pack_start(GTK_BOX(not_subm_vbox), not_subm_lbl, false, false, 0);
+ gtk_box_pack_start(GTK_BOX(not_subm_vbox), new_problems_scroll_win, true, true, 0);
+ gtk_box_pack_start(GTK_BOX(main_vbox), not_subm_vbox, true, true, 0);
/* Tree view inside scrolled region */
s_treeview = gtk_tree_view_new();
g_object_set(s_treeview, "rules-hint", 1, NULL); /* use alternating colors */
add_columns(GTK_TREE_VIEW(s_treeview));
- gtk_container_add(GTK_CONTAINER(scroll_win), s_treeview);
+ gtk_container_add(GTK_CONTAINER(new_problems_scroll_win), s_treeview);
/* Create data store for the list and attach it */
- s_dumps_list_store = gtk_list_store_new(NUM_COLUMNS, G_TYPE_STRING, /* source */
+ s_dumps_list_store = gtk_list_store_new(NUM_COLUMNS,
+ G_TYPE_STRING, /* source */
+ G_TYPE_STRING, /* executable */
+ G_TYPE_STRING, /* time */
+ G_TYPE_INT, /* unix time - used for sort */
+ G_TYPE_STRING, /* dump dir path */
+ G_TYPE_STRING); /* reported_to */
+
+
+ //FIXME: configurable!!
+ gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(s_dumps_list_store),
+ COLUMN_LATEST_CRASH,
+ GTK_SORT_DESCENDING);
+
+ gtk_tree_view_set_model(GTK_TREE_VIEW(s_treeview), GTK_TREE_MODEL(s_dumps_list_store));
+
+ /* Double click/Enter handler */
+ g_signal_connect(s_treeview, "row-activated", G_CALLBACK(on_row_activated_cb), NULL);
+ /* Delete handler */
+ g_signal_connect(s_treeview, "key-press-event", G_CALLBACK(on_key_press_event_cb), NULL);
+
+ /* scrolled region for reported problems */
+ GtkWidget *reported_problems_scroll_win = gtk_scrolled_window_new(NULL, NULL);
+ gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(reported_problems_scroll_win),
+ GTK_SHADOW_ETCHED_IN);
+ gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(reported_problems_scroll_win),
+ GTK_POLICY_AUTOMATIC,
+ GTK_POLICY_AUTOMATIC);
+
+ GtkWidget *subm_lbl = gtk_label_new(_("Submitted reports"));
+ /* align to left */
+ gtk_misc_set_alignment(GTK_MISC(subm_lbl), 0, 0);
+ gtk_label_set_markup(GTK_LABEL(subm_lbl), _("<b>Submitted reports</b>"));
+
+
+ /* add label for submitted tree view */
+ gtk_box_pack_start(GTK_BOX(subm_vbox), subm_lbl, false, false, 0);
+ gtk_box_pack_start(GTK_BOX(subm_vbox), reported_problems_scroll_win, true, true, 0);
+ gtk_box_pack_start(GTK_BOX(main_vbox), subm_vbox, true, true, 0);
+
+ /* Tree view inside scrolled region */
+ s_reported_treeview = gtk_tree_view_new();
+ g_object_set(s_reported_treeview, "rules-hint", 1, NULL); /* use alternating colors */
+ add_columns_reported(GTK_TREE_VIEW(s_reported_treeview));
+ gtk_container_add(GTK_CONTAINER(reported_problems_scroll_win), s_reported_treeview);
+
+ /* Create data store for the list and attach it */
+ s_reported_dumps_list_store = gtk_list_store_new(NUM_COLUMNS,
+ G_TYPE_STRING, /* source */
G_TYPE_STRING, /* executable */
- G_TYPE_STRING, /* hostname */
G_TYPE_STRING, /* time */
G_TYPE_INT, /* unix time - used for sort */
G_TYPE_STRING, /* dump dir path */
- G_TYPE_STRING);/* row background */
+ G_TYPE_STRING); /* reported_to */
+
//FIXME: configurable!!
- gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(s_dumps_list_store),
+ gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(s_reported_dumps_list_store),
COLUMN_LATEST_CRASH,
GTK_SORT_DESCENDING);
- gtk_tree_view_set_model(GTK_TREE_VIEW(s_treeview), GTK_TREE_MODEL(s_dumps_list_store));
+
+ gtk_tree_view_set_model(GTK_TREE_VIEW(s_reported_treeview), GTK_TREE_MODEL(s_reported_dumps_list_store));
+
/* buttons are homogenous so set size only for one button and it will
* work for the rest buttons in same gtk_hbox_new() */
@@ -518,20 +664,23 @@ static GtkWidget *create_main_window(void)
GtkWidget *btn_delete = gtk_button_new_from_stock(GTK_STOCK_DELETE);
- GtkWidget *hbox_report_delete = gtk_hbox_new(true, 4);
+ GtkWidget *hbox_report_delete = gtk_hbox_new(true, 0);
gtk_box_pack_start(GTK_BOX(hbox_report_delete), btn_delete, true, true, 0);
- gtk_box_pack_start(GTK_BOX(hbox_report_delete), btn_report, true, true, 0);
+ gtk_box_pack_start(GTK_BOX(hbox_report_delete), btn_report, true, true, 10);
GtkWidget *halign = gtk_alignment_new(1, 0, 0, 0);
gtk_container_add(GTK_CONTAINER(halign), hbox_report_delete);
gtk_box_pack_start(GTK_BOX(main_vbox), halign, false, false, 10);
+ /* put the main_vbox to main window */
+ gtk_container_add(GTK_CONTAINER(g_main_window), main_vbox);
+
/* Double click/Enter handler */
- g_signal_connect(s_treeview, "row-activated", G_CALLBACK(on_row_activated_cb), NULL);
+ g_signal_connect(s_reported_treeview, "row-activated", G_CALLBACK(on_row_activated_cb), NULL);
g_signal_connect(btn_report, "clicked", G_CALLBACK(on_btn_report_cb), NULL);
/* Delete handler */
- g_signal_connect(s_treeview, "key-press-event", G_CALLBACK(on_key_press_event_cb), NULL);
+ g_signal_connect(s_reported_treeview, "key-press-event", G_CALLBACK(on_key_press_event_cb), NULL);
g_signal_connect(btn_delete, "clicked", G_CALLBACK(on_btn_delete_cb), NULL);
/* Quit when user closes the main window */
g_signal_connect(g_main_window, "destroy", gtk_main_quit, NULL);
--
1.7.6

View file

@ -1,35 +0,0 @@
From e965fb7a7c768889cdd4a59859d28dc83b3daf09 Mon Sep 17 00:00:00 2001
Message-Id: <e965fb7a7c768889cdd4a59859d28dc83b3daf09.1317979766.git.npajkovs@redhat.com>
In-Reply-To: <82b27dca87ef5a4f1cbb29377524bbdee26b1d64.1317979766.git.npajkovs@redhat.com>
References: <82b27dca87ef5a4f1cbb29377524bbdee26b1d64.1317979766.git.npajkovs@redhat.com>
From: Nikola Pajkovsky <npajkovs@redhat.com>
Date: Wed, 5 Oct 2011 17:23:22 +0200
Subject: [PATCH 2/2] rhbz#718097 - don't file bugs about BIOS bugs
Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
---
src/plugins/abrt-dump-oops.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/src/plugins/abrt-dump-oops.c b/src/plugins/abrt-dump-oops.c
index 58af506..3bfc617 100644
--- a/src/plugins/abrt-dump-oops.c
+++ b/src/plugins/abrt-dump-oops.c
@@ -527,8 +527,13 @@ static unsigned save_oops_to_dump_dir(GList *oops_list, unsigned oops_cnt)
dd_save_text(dd, FILENAME_CMDLINE, cmdline_str);
dd_save_text(dd, FILENAME_BACKTRACE, second_line);
+ /* check if trace doesn't have line: 'Your BIOS is broken' */
+ char *broken_bios = strstr(second_line, "Your BIOS is broken");
+ if (broken_bios)
+ dd_save_text(dd, FILENAME_NOT_REPORTABLE, "Your BIOS is broken");
+
char *tainted_short = kernel_tainted_short(second_line);
- if (tainted_short)
+ if (tainted_short && !broken_bios)
{
VERB1 log("Kernel is tainted '%s'", tainted_short);
dd_save_text(dd, FILENAME_TAINTED_SHORT, tainted_short);
--
1.7.7.rc0.70.g82660

View file

@ -1,72 +0,0 @@
From ecfc461fd979aeb2d3ce4b9d811e4bf4a7730532 Mon Sep 17 00:00:00 2001
From: Jiri Moskovcak <jmoskovc@redhat.com>
Date: Sat, 5 Nov 2011 18:04:54 +0100
Subject: [PATCH 3/3] - glib 2.31 build fixes
---
src/applet/applet.c | 14 +++++++++++++-
src/gui-gtk/main.c | 4 ++--
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/src/applet/applet.c b/src/applet/applet.c
index 95b7091..bead61f 100644
--- a/src/applet/applet.c
+++ b/src/applet/applet.c
@@ -766,10 +766,20 @@ int main(int argc, char** argv)
textdomain(PACKAGE);
#endif
+ /* Glib 2.31:
+ * Major changes to threading and synchronisation
+ - threading is now always enabled in GLib
+ - support for custom thread implementations (including our own internal
+ - support for errorcheck mutexes) has been removed
+ */
+#if (GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION < 31)
+ //can't use log(), because g_verbose is not set yet
+ g_print("abrt-applet: glib < 2.31 - init threading\n");
/* Need to be thread safe */
g_thread_init(NULL);
gdk_threads_init();
gdk_threads_enter();
+#endif
gtk_init(&argc, &argv);
@@ -869,8 +879,10 @@ int main(int argc, char** argv)
/* Enter main loop */
gtk_main();
-
+#if (GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION < 31)
gdk_threads_leave();
+#endif
+
if (notify_is_initted())
notify_uninit();
diff --git a/src/gui-gtk/main.c b/src/gui-gtk/main.c
index b31509b..a24745a 100644
--- a/src/gui-gtk/main.c
+++ b/src/gui-gtk/main.c
@@ -912,7 +912,7 @@ static gboolean handle_signal_pipe(GIOChannel *gio, GIOCondition condition, gpoi
*/
gchar buf[16];
gsize bytes_read;
- g_io_channel_read(gio, buf, sizeof(buf), &bytes_read);
+ g_io_channel_read_chars(gio, buf, sizeof(buf), &bytes_read, NULL);
/* Destroy zombies */
while (safe_waitpid(-1, NULL, WNOHANG) > 0)
@@ -975,7 +975,7 @@ static gboolean handle_inotify_cb(GIOChannel *gio, GIOCondition condition, gpoin
/* We read inotify events, but don't analyze them */
gchar buf[sizeof(struct inotify_event) + PATH_MAX + 64];
gsize bytes_read;
- while (g_io_channel_read(gio, buf, sizeof(buf), &bytes_read) == G_IO_ERROR_NONE
+ while (g_io_channel_read_chars(gio, buf, sizeof(buf), &bytes_read, NULL) == G_IO_STATUS_NORMAL
&& bytes_read > 0
) {
continue;
--
1.7.7

View file

@ -1,268 +0,0 @@
From 89de28a3510c6e7a30ca053caea35ccabfbde75a Mon Sep 17 00:00:00 2001
From: Miroslav Lichvar <mlichvar@redhat.com>
Date: Thu, 21 Jul 2011 15:34:50 +0200
Subject: [PATCH 3/4] remove forgotten abrt-action-kerneloops files
---
src/plugins/abrt-action-kerneloops.c | 173 --------------------------------
src/plugins/abrt-action-kerneloops.txt | 68 -------------
2 files changed, 0 insertions(+), 241 deletions(-)
delete mode 100644 src/plugins/abrt-action-kerneloops.c
delete mode 100644 src/plugins/abrt-action-kerneloops.txt
diff --git a/src/plugins/abrt-action-kerneloops.c b/src/plugins/abrt-action-kerneloops.c
deleted file mode 100644
index a117266..0000000
--- a/src/plugins/abrt-action-kerneloops.c
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- Copyright (C) 2010 ABRT team
- Copyright (C) 2010 RedHat Inc
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- Authors:
- Anton Arapov <anton@redhat.com>
- Arjan van de Ven <arjan@linux.intel.com>
- */
-#include <curl/curl.h>
-#include "abrtlib.h"
-
-/* helpers */
-static size_t writefunction(void *ptr, size_t size, size_t nmemb, void *stream)
-{
- size *= nmemb;
-/*
- char *c, *c1, *c2;
-
- log("received: '%*.*s'", (int)size, (int)size, (char*)ptr);
- c = (char*)xzalloc(size + 1);
- memcpy(c, ptr, size);
- c1 = strstr(c, "201 ");
- if (c1)
- {
- c1 += 4;
- c2 = strchr(c1, '\n');
- if (c2)
- *c2 = 0;
- }
- free(c);
-*/
-
- return size;
-}
-
-/* Send oops data to kerneloops.org-style site, using HTTP POST */
-/* Returns 0 on success */
-static CURLcode http_post_to_kerneloops_site(const char *url, const char *oopsdata)
-{
- CURLcode ret;
- CURL *handle;
- struct curl_httppost *post = NULL;
- struct curl_httppost *last = NULL;
-
- handle = curl_easy_init();
- if (!handle)
- error_msg_and_die("Can't create curl handle");
-
- curl_easy_setopt(handle, CURLOPT_URL, url);
-
- curl_formadd(&post, &last,
- CURLFORM_COPYNAME, "oopsdata",
- CURLFORM_COPYCONTENTS, oopsdata,
- CURLFORM_END);
- curl_formadd(&post, &last,
- CURLFORM_COPYNAME, "pass_on_allowed",
- CURLFORM_COPYCONTENTS, "yes",
- CURLFORM_END);
-
- curl_easy_setopt(handle, CURLOPT_HTTPPOST, post);
- curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, writefunction);
-
- ret = curl_easy_perform(handle);
-
- curl_formfree(post);
- curl_easy_cleanup(handle);
-
- return ret;
-}
-
-static void report_to_kerneloops(
- const char *dump_dir_name,
- map_string_h *settings)
-{
- problem_data_t *problem_data = create_problem_data_for_reporting(dump_dir_name);
- if (!problem_data)
- xfunc_die(); /* create_problem_data_for_reporting already emitted error msg */
-
- const char *backtrace = get_problem_item_content_or_NULL(problem_data, FILENAME_BACKTRACE);
- if (!backtrace)
- error_msg_and_die("Error sending kernel oops due to missing backtrace");
-
- const char *env = getenv("KerneloopsReporter_SubmitURL");
- const char *submitURL = (env ? env : get_map_string_item_or_empty(settings, "SubmitURL"));
- if (!submitURL[0])
- submitURL = "http://submit.kerneloops.org/submitoops.php";
-
- log(_("Submitting oops report to %s"), submitURL);
-
- CURLcode ret = http_post_to_kerneloops_site(submitURL, backtrace);
- if (ret != CURLE_OK)
- error_msg_and_die("Kernel oops has not been sent due to %s", curl_easy_strerror(ret));
-
- free_problem_data(problem_data);
-
- /* Server replies with:
- * 200 thank you for submitting the kernel oops information
- * RemoteIP: 34192fd15e34bf60fac6a5f01bba04ddbd3f0558
- * - no URL or bug ID apparently...
- */
- struct dump_dir *dd = dd_opendir(dump_dir_name, /*flags:*/ 0);
- if (dd)
- {
- char *msg = xasprintf("kerneloops: URL=%s", submitURL);
- add_reported_to(dd, msg);
- free(msg);
- dd_close(dd);
- }
-
- log("Kernel oops report was uploaded");
-}
-
-int main(int argc, char **argv)
-{
- abrt_init(argv);
-
- map_string_h *settings = new_map_string();
- const char *dump_dir_name = ".";
- GList *conf_file = NULL;
-
- /* Can't keep these strings/structs static: _() doesn't support that */
- const char *program_usage_string = _(
- "\b [-v] [-c CONFFILE]... -d DIR\n"
- "\n"
- "Reports kernel oops to kerneloops.org (or similar) site.\n"
- "\n"
- "Files with names listed in $EXCLUDE_FROM_REPORT are not included\n"
- "into the tarball.\n"
- "\n"
- "CONFFILE lines should have 'PARAM = VALUE' format.\n"
- "Recognized string parameter: SubmitURL.\n"
- "Parameter can be overridden via $KerneloopsReporter_SubmitURL."
- );
- enum {
- OPT_v = 1 << 0,
- OPT_d = 1 << 1,
- OPT_c = 1 << 2,
- };
- /* Keep enum above and order of options below in sync! */
- struct options program_options[] = {
- OPT__VERBOSE(&g_verbose),
- OPT_STRING('d', NULL, &dump_dir_name, "DIR" , _("Dump directory")),
- OPT_LIST( 'c', NULL, &conf_file , "FILE", _("Configuration file")),
- OPT_END()
- };
- /*unsigned opts =*/ parse_opts(argc, argv, program_options, program_usage_string);
-
- export_abrt_envvars(0);
-
- while (conf_file)
- {
- char *fn = (char *)conf_file->data;
- VERB1 log("Loading settings from '%s'", fn);
- load_conf_file(fn, settings, /*skip key w/o values:*/ true);
- VERB3 log("Loaded '%s'", fn);
- conf_file = g_list_remove(conf_file, fn);
- }
-
- report_to_kerneloops(dump_dir_name, settings);
-
- free_map_string(settings);
- return 0;
-}
diff --git a/src/plugins/abrt-action-kerneloops.txt b/src/plugins/abrt-action-kerneloops.txt
deleted file mode 100644
index 468287f..0000000
--- a/src/plugins/abrt-action-kerneloops.txt
+++ /dev/null
@@ -1,68 +0,0 @@
-abrt-action-kerneloops(1)
-=========================
-
-NAME
-----
-abrt-action-kerneloops - Reports kernel oops to kerneloops.org (or similar)
-site.
-
-SYNOPSIS
---------
-'abrt-action-kerneloops' [-v] [-c CONFFILE]... [ -d DIR ]
-
-DESCRIPTION
------------
-The tool is used to report the crash to the Kerneloops tracker.
-
-Configuration file
-~~~~~~~~~~~~~~~~~~
-Configuration file contains entries in a format "Option = Value".
-
-The options are:
-
-'SubmitURL'::
- The URL of the kerneloops tracker, the default is
- "http://submit.kerneloops.org/submitoops.php".
-
-Integration with ABRT events
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-'abrt-action-kerneloops' can be used as a reporter, to allow users to report
-problems to the Kerneloops tracker. This usage is pre-configured in
-/etc/libreport/events.d/koops_event.conf:
-
-------------
-EVENT=report_Kerneloops analyzer=Kerneloops abrt-action-kerneloops
-------------
-
-It can be also used automatically and immediately without user interaction.
-When this is desired, modify the event configuration file to run the tool on
-the 'post-create' event:
-
-------------
-EVENT=post-create analyzer=Kerneloops abrt-action-kerneloops
-------------
-
-OPTIONS
--------
--v::
- Be more verbose. Can be given multiple times.
-
--d DIR::
- Path to dump directory.
-
--c CONFFILE::
- Path to configration file. When used in ABRT event system, the file
- contains site-wide configuration. Users can change the values via
- environment variables.
-
-ENVIRONMENT VARIABLES
----------------------
-Environment variables take precedence over values provided in
-the configuration file.
-
-'KerneloopsReporter_SubmitURL'::
- The URL of the kerneloops tracker.
-
-AUTHORS
--------
-* ABRT team
--
1.7.6

View file

@ -1,71 +0,0 @@
From 90893a0c84a594337ca22fa83f364f5b4a7fb1b2 Mon Sep 17 00:00:00 2001
From: Michal Toman <mtoman@redhat.com>
Date: Thu, 21 Jul 2011 16:48:08 +0200
Subject: [PATCH 4/4] install-debuginfo: ask before downloading
---
src/plugins/abrt-action-install-debuginfo | 34 ++++++----------------------
1 files changed, 8 insertions(+), 26 deletions(-)
diff --git a/src/plugins/abrt-action-install-debuginfo b/src/plugins/abrt-action-install-debuginfo
index 2ad0790..31aab2c 100644
--- a/src/plugins/abrt-action-install-debuginfo
+++ b/src/plugins/abrt-action-install-debuginfo
@@ -11,6 +11,7 @@ import errno
import time
import getopt
import shutil
+import reportclient
from subprocess import Popen, PIPE
from yum import _, YumBase
from yum.callbacks import DownloadBaseCallback
@@ -74,22 +75,6 @@ def unmute_stdout():
else:
print "ERR: unmute called without mute?"
-def ask_yes_no(prompt, retries=4):
- while True:
- try:
- response = raw_input(prompt)
- except EOFError:
- log1("got eof, probably executed from helper, assuming - yes")
- return True
- if response in (_("y")): # for translators -> y/Y as yes
- return True
- if response in ("", _("n")): # for translators -> N/n as no
- return False
- retries = retries - 1
- if retries < 0:
- break
- return False
-
# TODO: unpack just required debuginfo and not entire rpm?
# ..that can lead to: foo.c No such file and directory
# files is not used...
@@ -286,16 +271,13 @@ class DebugInfoDownload(YumBase):
print _("Can't find packages for %u debuginfo files") % len(not_found)
if verbose != 0 or total_pkgs != 0:
print _("Packages to download: %u") % total_pkgs
- print _("Downloading %.2fMb, installed size: %.2fMb") % (
- todownload_size / (1024**2),
- installed_size / (1024**2)
- )
-
- # ask only if we have terminal, because for now we don't have a way
- # how to pass the question to gui and the response back
- if noninteractive == False and sys.stdout.isatty():
- if not ask_yes_no(_("Is this ok? [y/N] ")):
- return RETURN_OK
+ question = _("Downloading %.2fMb, installed size: %.2fMb. Continue?") % (
+ todownload_size / (1024**2),
+ installed_size / (1024**2)
+ )
+ if not reportclient.ask_yes_no(question):
+ print _("Download cancelled by user")
+ return RETURN_OK
for pkg, files in package_files_dict.iteritems():
dnlcb.downloaded_pkgs = downloaded_pkgs
--
1.7.6

View file

@ -1,151 +0,0 @@
#!/bin/bash
# Install abrt coredump hook
#
# chkconfig: 35 82 16
# description: Installs coredump handler which saves segfault data
### BEGIN INIT INFO
# Provides: abrt-ccpp
# Required-Start: $abrtd
# Default-Stop: 0 1 2 6
# Default-Start: 3 5
# Short-Description: Installs coredump handler which saves segfault data
# Description: Installs coredump handler which saves segfault data
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
# For debugging
dry_run=false
verbose=false
# We don't have pid files, therefore have to use
# a flag file in /var/lock/subsys to enable GUI service tools
# to figure out our status
LOCK="/var/lock/subsys/abrt-ccpp"
PATTERN_FILE="/proc/sys/kernel/core_pattern"
SAVED_PATTERN_FILE="/var/run/abrt/saved_core_pattern"
HOOK_BIN="/usr/libexec/abrt-hook-ccpp"
PATTERN="|$HOOK_BIN /var/spool/abrt %s %c %p %u %g %t %h %e"
# core_pipe_limit specifies how many dump_helpers can run at the same time
# 0 - means unlimited, but it's not guaranteed that /proc/<pid> of crashing
# process will be available for dump_helper.
# 4 - means that 4 dump_helpers can run at the same time (the rest will also
# run, but they will fail to read /proc/<pid>).
#
# This should be enough for ABRT, we can miss some crashes, but what are
# the odds that more processes crash at the same time? And moreover,
# do people want to save EVERY ONE of the crashes when they have
# a crash storm? I don't think so.
# The value of 4 has been recommended by nhorman.
#
CORE_PIPE_LIMIT_FILE="/proc/sys/kernel/core_pipe_limit"
CORE_PIPE_LIMIT="4"
RETVAL=0
check() {
# Check that we're a privileged user
[ "`id -u`" = 0 ] || exit 4
}
start() {
check
cur=`cat "$PATTERN_FILE"`
cur_first=`printf "%s" "$cur" | sed 's/ .*//'`
$verbose && printf "cur:'%s'\n" "$cur"
# Is it already installed?
if test x"$cur_first" != x"|$HOOK_BIN"; then # no
# It is not installed
printf "%s\n" "$cur" >"$SAVED_PATTERN_FILE"
OLD_PATTERN=""
# Does old pattern start with '|'?
if test x"${cur#|}" = x"$cur"; then # no
# Encode it as hex string, NUL terminated
OLD_PATTERN=`printf "%s" "$cur" | od -tx1 | sed 's/000[^ ]*//' | xargs | sed 's/ //g'`
$verbose && printf "OLD_PATTERN:'%s'\n" "$OLD_PATTERN"
OLD_PATTERN=" ${OLD_PATTERN}00"
fi
# Install new handler
$verbose && printf "Installing to %s:'%s'\n" "$PATTERN_FILE" "${PATTERN}${OLD_PATTERN}"
$dry_run || echo "${PATTERN}${OLD_PATTERN}" >"$PATTERN_FILE"
$dry_run || touch -- "$LOCK"
# Check core_pipe_limit and change it if it's 0,
# otherwise the abrt-hook-ccpp won't be able to read /proc/<pid>
# of the crashing process
if test x"`cat "$CORE_PIPE_LIMIT_FILE"`" = x"0"; then
echo "$CORE_PIPE_LIMIT" >"$CORE_PIPE_LIMIT_FILE"
fi
fi
return $RETVAL
}
stop() {
check
if test -f "$SAVED_PATTERN_FILE"; then
$verbose && printf "Restoring to %s:'%s'\n" "$PATTERN_FILE" "`cat "$SAVED_PATTERN_FILE"`"
$dry_run || cat "$SAVED_PATTERN_FILE" >"$PATTERN_FILE"
fi
$dry_run || rm -f -- "$LOCK"
return $RETVAL
}
restart() {
stop
start
}
reload() {
restart
}
case "$1" in
start)
start
;;
stop)
stop
;;
reload)
reload
;;
force-reload)
echo "$0: Unimplemented feature."
RETVAL=3
;;
restart)
restart
;;
condrestart)
cur=`cat "$PATTERN_FILE"`
cur_first=`printf "%s" "$cur" | sed 's/ .*//'`
# Is it already installed?
if test x"$cur_first" = x"|$HOOK_BIN"; then # yes
$verbose && printf "Installed, re-installing\n"
restart
fi
;;
status)
cur=`cat "$PATTERN_FILE"`
cur_first=`printf "%s" "$cur" | sed 's/ .*//'`
# Is it already installed?
if test x"$cur_first" = x"|$HOOK_BIN"; then # yes
$verbose && printf "Installed\n"
RETVAL=0
else
$verbose && printf "Not installed\n"
RETVAL=3 # "stopped normally"
fi
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload}"
RETVAL=2
esac
exit $RETVAL

View file

@ -1,91 +0,0 @@
#!/bin/bash
# Start ABRT kernel log watcher
#
# chkconfig: 35 82 16
# description: Watches system log for oops messages, creates ABRT dump directories for each oops
### BEGIN INIT INFO
# Provides: abrt-oops
# Required-Start: $abrtd
# Default-Stop: 0 1 2 6
# Default-Start: 3 5
# Short-Description: Watches system log for oops messages, creates ABRT dump directories for each oops
# Description: Watches system log for oops messages, creates ABRT dump directories for each oops
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
# For debugging
dry_run=false
verbose=false
# We don't have pid files, therefore have to use
# a flag file in /var/lock/subsys to enable GUI service tools
# to figure out our status
LOCK="/var/lock/subsys/abrt-oops"
RETVAL=0
check() {
# Check that we're a privileged user
[ "`id -u`" = 0 ] || exit 4
}
start() {
check
killall abrt-dump-oops 2>/dev/null
setsid abrt-dump-oops -d /var/spool/abrt -rwx /var/log/messages </dev/null >/dev/null 2>&1 &
$dry_run || touch -- "$LOCK"
return $RETVAL
}
stop() {
check
killall abrt-dump-oops
$dry_run || rm -f -- "$LOCK"
return $RETVAL
}
restart() {
stop
start
}
reload() {
restart
}
case "$1" in
start)
start
;;
stop)
stop
;;
reload)
reload
;;
force-reload)
echo "$0: Unimplemented feature."
RETVAL=3
;;
restart)
restart
;;
condrestart)
# Is it already running?
if test -f "$LOCK"; then # yes
$verbose && printf "Running, restarting\n"
restart
fi
;;
status)
status abrt-dump-oops
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload}"
RETVAL=2
esac
exit $RETVAL

View file

@ -1,79 +0,0 @@
#!/bin/bash
# Harvest vmcores for ABRT
#
# chkconfig: 35 82 16
# description: Installs coredump handler which saves segfault data
### BEGIN INIT INFO
# Provides: abrt-vmcore
# Required-Start: $abrtd
# Default-Stop: 0 1 2 6
# Default-Start: 3 5
# Short-Description: Collects vmcore (kernel crash data) for ABRT
# Description: Collects vmcore (kernel crash data) for ABRT
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
LOCK="/var/lock/subsys/abrt-vmcore"
HARVEST_CMD="/usr/sbin/abrt-harvest-vmcore"
RETVAL=0
check() {
# Check that we're a privileged user
[ "`id -u`" = 0 ] || exit 4
}
start() {
check
"$HARVEST_CMD"
RETVAL=$?
[ $RETVAL -eq 0 ] && touch -- "$LOCK"
return $RETVAL
}
stop() {
check
rm -f -- "$LOCK"
return 0
}
restart() {
stop
start
}
reload() {
restart
}
case "$1" in
start)
start
;;
stop)
stop
;;
reload)
reload
;;
force-reload)
echo "$0: Unimplemented feature."
RETVAL=3
;;
restart)
restart
;;
condrestart)
test -f "$LOCK" && restart
;;
status)
test -f "$LOCK" && RETVAL=0 || RETVAL=3
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload}"
RETVAL=2
esac
exit $RETVAL

115
abrt.init
View file

@ -1,115 +0,0 @@
#!/bin/bash
# Starts the abrt daemon
#
# chkconfig: 35 82 16
# description: Daemon to detect crashing apps
# processname: abrtd
### BEGIN INIT INFO
# Provides: abrt
# Required-Start: $syslog $local_fs
# Required-Stop: $syslog $local_fs
# Default-Stop: 0 1 2 6
# Default-Start: 3 5
# Short-Description: start and stop abrt daemon
# Description: Listen to and dispatch crash events
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
ABRT_BIN="/usr/sbin/abrtd"
LOCK="/var/lock/subsys/abrtd"
OLD_LOCK="/var/lock/subsys/abrt"
RETVAL=0
#
# Set these variables if you are behind proxy
#
#export http_proxy=
#export https_proxy=
#
# See how we were called.
#
check() {
# Check that we're a privileged user
[ "`id -u`" = 0 ] || exit 4
# Check if abrt is executable
test -x $ABRT_BIN || exit 5
}
start() {
check
# Check if it is already running
if [ ! -f $LOCK ] && [ ! -f $OLD_LOCK ]; then
echo -n $"Starting abrt daemon: "
daemon $ABRT_BIN
RETVAL=$?
[ $RETVAL -eq 0 ] && touch $LOCK
echo
fi
return $RETVAL
}
stop() {
check
echo -n $"Stopping abrt daemon: "
killproc $ABRT_BIN
RETVAL=$?
[ $RETVAL -eq 0 ] && rm -f $LOCK
[ $RETVAL -eq 0 ] && rm -f $OLD_LOCK
echo
return $RETVAL
}
restart() {
stop
start
}
reload() {
restart
}
case "$1" in
start)
start
;;
stop)
stop
;;
reload)
reload
;;
force-reload)
echo "$0: Unimplemented feature."
RETVAL=3
;;
restart)
restart
;;
condrestart)
if [ -f $LOCK ]; then
restart
fi
# update from older version
if [ -f $OLD_LOCK ]; then
restart
fi
;;
status)
status abrtd
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload}"
RETVAL=2
esac
exit $RETVAL

View file

@ -15,7 +15,7 @@
Summary: Automatic bug detection and reporting tool
Name: abrt
Version: 2.0.6
Version: 2.0.7
Release: 1%{?dist}
License: GPLv2+
Group: Applications/System
@ -24,8 +24,7 @@ Source: https://fedorahosted.org/released/%{name}/%{name}-%{version}.tar.gz
Source1: abrt1_to_abrt2
Patch0: blacklist.patch
Patch1: abrt_disable_gpgcheck.diff
Patch2: 0002-gtk3-build-fixes.patch
Patch3: 0003-glib-2.31-build-fixes.patch
Patch2: 0002-disabled-reporting-to-kerneloops.org.patch
BuildRequires: dbus-devel
BuildRequires: gtk2-devel
BuildRequires: rpm-devel >= 4.6
@ -173,6 +172,7 @@ Requires: gdb >= 7.0-3
Requires: abrt-gui
Requires: libreport-plugin-logger, libreport-plugin-bugzilla
Requires: abrt-retrace-client
Requires: libreport-plugin-bodhi
#Requires: abrt-plugin-firefox
Obsoletes: bug-buddy > 0.0.1
Provides: bug-buddy
@ -186,17 +186,11 @@ Virtual package to make easy default installation on desktop environments.
%patch0 -p1 -b .blacklist
# general
%patch1 -p1 -b .gpg
%patch2 -p1 -b .gtk3
%patch3 -p1 -b .glib231
%patch2 -p1 -b .disable_koops_org
%build
mkdir -p m4
test -r m4/aclocal.m4 || touch m4/aclocal.m4
autoconf
automake
%configure
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
CFLAGS="-fno-strict-aliasing"
make %{?_smp_mflags}
@ -241,11 +235,9 @@ getent passwd abrt >/dev/null || useradd --system -g abrt -u %{abrt_gid_uid} -d
exit 0
%post
## [ $1 -eq 1 ] install section
if [ $1 -eq 1 ]; then
%if %{with systemd}
# Enable (but don't start) the units by default
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
/bin/systemctl enable abrtd.service >/dev/null 2>&1 || :
%else
/sbin/chkconfig --add abrtd
@ -258,70 +250,29 @@ fi
# because /cache/abrt-di/* was created under root with root:root
# so 2.x fails when it tries to extract debuginfo there..
chown -R abrt:abrt %{_localstatedir}/cache/abrt-di
## [ $1 -eq 1 ] install section
if [ $1 -eq 1 ]; then
%if %{with systemd}
# Enable (but don't start) the units by default
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
/bin/systemctl enable abrt-ccpp.service >/dev/null 2>&1 || :
%else
/sbin/chkconfig --add abrt-ccpp
%endif
fi
# FIXME: Workaround for update from abrt-1.1.x, can be removed in
# F17(18) update. When we are updating from ABRT 1 to ABRT 2, assume
# that abrtd service is enabled and thus enable the new abrt-ccpp
# service. If abrtd is running on the system, run abrt-ccpp service
# as well, because what was a part of abrtd became a separate service.
## [ $1 -gt 1 ] upgrade section
if [ $1 -gt 1 ]; then
%if %{with systemd}
/bin/systemctl restart abrt-ccpp.service >/dev/null 2>&1 || :
%else
/sbin/chkconfig --add abrt-ccpp > /dev/null 2>&1 || :
/sbin/pidof abrtd >/dev/null 2>&1
if [ $? -eq 0 ]; then # Is abrtd running?
service abrt-ccpp restart >/dev/null 2>&1 || :
fi
%endif
fi
%post addon-kerneloops
## [ $1 -eq 1 ] install section
if [ $1 -eq 1 ]; then
%if %{with systemd}
# Enable (but don't start) the units by default
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
/bin/systemctl enable abrt-oops.service >/dev/null 2>&1 || :
%else
/sbin/chkconfig --add abrt-oops
%endif
fi
# FIXME: Workaround for update from abrt-1.1.x, can be removed in
# F17(18) update. When we are updating from ABRT 1 to ABRT 2, assume
# that abrtd service is enabled and thus enable the new abrt-oops
# service. If abrtd is running on the system, run abrt-ccpp service
# as well, because what was a part of abrtd became a separate service.
## [ $1 -gt 1 ] upgrade section
if [ $1 -gt 1 ]; then
%if %{with systemd}
/bin/systemctl try-restart abrt-oops.service >/dev/null 2>&1 || :
%else
/sbin/chkconfig --add abrt-oops > /dev/null 2>&1 || :
/sbin/pidof abrtd >/dev/null 2>&1
if [ $? -eq 0 ]; then # Is abrtd running?
service abrt-oops restart >/dev/null 2>&1 || :
fi
%endif
fi
%post addon-vmcore
if [ $1 -eq 1 ]; then
%if %{with systemd}
# Enable (but don't start) the units by default
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
/bin/systemctl enable abrt-vmcore.service >/dev/null 2>&1 || :
%else
/sbin/chkconfig --add abrt-vmcore
@ -374,16 +325,16 @@ fi
%if %{with systemd}
%postun
/bin/systemctl try-reload abrtd.service >/dev/null 2>&1 || :
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
%postun addon-kerneloops
/bin/systemctl try-reload abrt-oops.service >/dev/null 2>&1 || :
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
%postun addon-vmcore
/bin/systemctl try-reload abrt-vmcore.service >/dev/null 2>&1 || :
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
%postun addon-ccpp
/bin/systemctl try-reload abrt-ccpp.service >/dev/null 2>&1 || :
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
%endif
@ -425,6 +376,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%{_initrddir}/abrtd
%endif
%{_sbindir}/abrtd
%{_sbindir}/abrt-dbus
%{_sbindir}/abrt-server
%{_libexecdir}/abrt-handle-event
%{_bindir}/abrt-handle-upload
@ -450,6 +402,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%{_mandir}/man1/abrt-server.1.gz
%{_mandir}/man1/abrt-action-save-package-data.1.gz
%{_mandir}/man8/abrtd.8.gz
%{_mandir}/man8/abrt-dbus.8.gz
%{_mandir}/man5/abrt.conf.5.gz
%{_mandir}/man5/abrt-action-save-package-data.conf.5.gz
# {_mandir}/man5/pyhook.conf.5.gz
@ -564,9 +517,20 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%defattr(-,root,root,-)
%changelog
* Wed Dec 07 2011 Jiri Moskovcak <jmoskovc@redhat.com> 2.0.7-1
- new version
- disabled kerneloops.org
- abrt-ccpp hook fixes
- catch indentation errors in python rhbz#578969
- fixed make check
- fixed retrace-client to work with rawhide
- require abrtd service in other services rhbz#752014
- fixed problems with dupes rhbz#701717
- keep abrt services enabled when updating F15->F16
- Resolves: 752014 749891 749603 744887 730422 665210 639068 625445 701717 752014 578969 732876 757683 753183 756146 749100
* Fri Nov 04 2011 Jiri Moskovcak <jmoskovc@redhat.com> 2.0.6-1
- new version
- moved to gtk3
- Resolves: #701171 #712508 #726033 #728194 #728314 #730107 #733389 #738602
- Resolves: #741242 #749365 #700252 #734298 #736016 #738324 #748457 #692274
- Resolves: #711986 #723219 #749891 #712602 #744887 #749603 #625445 #665210

View file

@ -1,11 +0,0 @@
--- abrt-2.0.6/src/daemon/abrt-action-save-package-data.conf 2011-11-04 13:03:43.271953835 +0100
+++ abrt-2.0.6_/src/daemon/abrt-action-save-package-data.conf 2011-11-04 13:03:36.661746556 +0100
@@ -3,7 +3,7 @@
# the list of public keys used to check the signature is
# in the file gpg_keys
#
-OpenGPGCheck = yes
+OpenGPGCheck = no
# Blacklisted packages
#

View file

@ -1,11 +0,0 @@
--- abrt-2.0.4/src/plugins/koops_event.conf 2011-07-19 16:59:38.000000000 +0200
+++ abrt-2.0.4_/src/plugins/koops_event.conf 2011-08-19 11:04:05.485464706 +0200
@@ -8,4 +8,7 @@ EVENT=post-create analyzer=Kerneloops
#EVENT=post-create analyzer=Kerneloops abrt-action-kerneloops
# report
-EVENT=report_Kerneloops analyzer=Kerneloops abrt-action-kerneloops
+EVENT=report_Kerneloops analyzer=Kerneloops reporter-kerneloops
+
+#fedora
+EVENT=reporter_Bugzilla analyzer=Kerneloops reporter-bugzilla

View file

@ -1,29 +0,0 @@
commit e91b22a9654bf9912f3f88c917773a96ff7733a3
Author: Martin Milata <mmilata@redhat.com>
Date: Thu Sep 8 16:29:01 2011 +0200
Fix free space checking
The g_settings_dump_location was freed before it was passed to the free
space check, thus preventing it from working.
diff --git a/src/daemon/abrt-server.c b/src/daemon/abrt-server.c
index 983706e..330f85f 100644
--- a/src/daemon/abrt-server.c
+++ b/src/daemon/abrt-server.c
@@ -143,7 +143,6 @@ static int create_debug_dump()
/* Trim old crash dumps if necessary */
load_abrt_conf();
- free_abrt_conf_data(); /* can do this because we need only g_settings_nMaxCrashReportsSize */
if (g_settings_nMaxCrashReportsSize > 0)
{
/* x1.25 and round up to 64m: go a bit up, so that usual in-daemon trimming
@@ -154,6 +153,7 @@ static int create_debug_dump()
check_free_space(maxsize);
trim_debug_dumps(DEBUG_DUMPS_DIR, maxsize * (double)(1024*1024), path);
}
+ free_abrt_conf_data();
free(path);

View file

@ -1,21 +0,0 @@
commit d2572a98f41df96534f41062b0020ee6a10047ea
Author: Martin Milata <mmilata@redhat.com>
Date: Tue Jul 26 16:49:28 2011 +0200
a-a-save-package-data: Fix NULL dereference
Fixes #324.
diff --git a/src/daemon/abrt-action-save-package-data.c b/src/daemon/abrt-action-save-package-data.c
index d37a05d..ddcf4ac 100644
--- a/src/daemon/abrt-action-save-package-data.c
+++ b/src/daemon/abrt-action-save-package-data.c
@@ -160,7 +160,7 @@ static char *get_argv1_if_full_path(const char* cmdline)
* with '/', it is not a full path to script
* and we can't use it to determine the package name
*/
- if (*argv1 != '/')
+ if (argv1 == NULL || *argv1 != '/')
return NULL;
/* good, it has "/foo/bar" form, return it */