don't file bugs when kernel is tainted
Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
This commit is contained in:
parent
942930fbda
commit
95a610dee1
192
0001-rhbz-724838-don-t-file-kernel-bugs-if-tainted-B-is-s.patch
Normal file
192
0001-rhbz-724838-don-t-file-kernel-bugs-if-tainted-B-is-s.patch
Normal file
@ -0,0 +1,192 @@
|
|||||||
|
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
|
||||||
|
|
35
0002-rhbz-718097-don-t-file-bugs-about-BIOS-bugs.patch
Normal file
35
0002-rhbz-718097-don-t-file-bugs-about-BIOS-bugs.patch
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
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
|
||||||
|
|
12
abrt.spec
12
abrt.spec
@ -16,7 +16,7 @@
|
|||||||
Summary: Automatic bug detection and reporting tool
|
Summary: Automatic bug detection and reporting tool
|
||||||
Name: abrt
|
Name: abrt
|
||||||
Version: 2.0.4.981
|
Version: 2.0.4.981
|
||||||
Release: 2%{?dist}
|
Release: 3%{?dist}
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
Group: Applications/System
|
Group: Applications/System
|
||||||
URL: https://fedorahosted.org/abrt/
|
URL: https://fedorahosted.org/abrt/
|
||||||
@ -27,6 +27,8 @@ Source3: abrt-oops.init
|
|||||||
Source4: abrt-vmcore.init
|
Source4: abrt-vmcore.init
|
||||||
Source5: abrt1_to_abrt2
|
Source5: abrt1_to_abrt2
|
||||||
Patch0: blacklist.patch
|
Patch0: blacklist.patch
|
||||||
|
Patch1: 0001-rhbz-724838-don-t-file-kernel-bugs-if-tainted-B-is-s.patch
|
||||||
|
Patch2: 0002-rhbz-718097-don-t-file-bugs-about-BIOS-bugs.patch
|
||||||
BuildRequires: dbus-devel
|
BuildRequires: dbus-devel
|
||||||
BuildRequires: gtk2-devel
|
BuildRequires: gtk2-devel
|
||||||
BuildRequires: rpm-devel >= 4.6
|
BuildRequires: rpm-devel >= 4.6
|
||||||
@ -194,6 +196,8 @@ Virtual package to make easy default installation on desktop environments.
|
|||||||
# Fedora specific
|
# Fedora specific
|
||||||
%patch0 -p1 -b .blacklist
|
%patch0 -p1 -b .blacklist
|
||||||
# general fixes
|
# general fixes
|
||||||
|
%patch1 -p1
|
||||||
|
%patch2 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
autoconf
|
autoconf
|
||||||
@ -556,6 +560,12 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
|
|||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Oct 07 2011 Nikola Pajkovsky <npajkovs@redhat.com> - 2.0.4.981-3
|
||||||
|
- don't file kernel bugs if "tainted: B" is set.
|
||||||
|
- don't file bugs about BIOS bugs.
|
||||||
|
- incorrect TAINTED description in bugs.
|
||||||
|
- Resoves: #718097 #708534 724838
|
||||||
|
|
||||||
* Mon Oct 3 2011 Jiri Moskovcak <jmoskovc@redhat.com> - 2.0.4-981-2
|
* Mon Oct 3 2011 Jiri Moskovcak <jmoskovc@redhat.com> - 2.0.4-981-2
|
||||||
- added abrt-retrace-client as a dependency
|
- added abrt-retrace-client as a dependency
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user