[SATYR PATCH 1/2] koops: add flag names to taint flag table
by Martin Milata
The table of kernel taint flags has been extended to include the flag
name, and it has been exposed in the koops header so other compilation
units can use it.
Signed-off-by: Martin Milata <mmilata(a)redhat.com>
---
lib/koops_stacktrace.c | 83 ++++++++++++++++++++++----------------------------
lib/koops_stacktrace.h | 11 +++++++
2 files changed, 47 insertions(+), 47 deletions(-)
diff --git a/lib/koops_stacktrace.c b/lib/koops_stacktrace.c
index e094bf6..822d99a 100644
--- a/lib/koops_stacktrace.c
+++ b/lib/koops_stacktrace.c
@@ -26,6 +26,31 @@
#include <string.h>
#include <stddef.h>
+/* http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/plain/kern... */
+
+#define FLAG_OFFSET(flag) offsetof(struct sr_koops_stacktrace, taint_ ## flag)
+#define FLAG(letter, name) { letter, FLAG_OFFSET(name), #name }
+
+struct sr_taint_flag sr_flags[] = {
+ FLAG('P', module_proprietary),
+ FLAG('F', forced_module),
+ FLAG('S', smp_unsafe),
+ FLAG('R', forced_removal),
+ FLAG('M', mce),
+ FLAG('B', page_release),
+ FLAG('U', userspace),
+ FLAG('D', died_recently),
+ FLAG('A', acpi_overridden),
+ FLAG('W', warning),
+ FLAG('C', staging_driver),
+ FLAG('I', firmware_workaround),
+ FLAG('O', module_out_of_tree),
+ { '\0', 0, NULL} /* sentinel */
+};
+
+#undef FLAG
+#undef FLAG_OFFSET
+
struct sr_koops_stacktrace *
sr_koops_stacktrace_new()
{
@@ -103,32 +128,6 @@ sr_koops_stacktrace_remove_frame(struct sr_koops_stacktrace *stacktrace,
}
-struct taint_flag {
- char letter;
- size_t member_offset;
-};
-
-/* http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/plain/kern... */
-
-#define FLAG_OFFSET(flag) offsetof(struct sr_koops_stacktrace, taint_ ## flag)
-static struct taint_flag flags[] = {
- { 'P', FLAG_OFFSET(module_proprietary) },
- { 'F', FLAG_OFFSET(forced_module) },
- { 'S', FLAG_OFFSET(smp_unsafe) },
- { 'R', FLAG_OFFSET(forced_removal) },
- { 'M', FLAG_OFFSET(mce) },
- { 'B', FLAG_OFFSET(page_release) },
- { 'U', FLAG_OFFSET(userspace) },
- { 'D', FLAG_OFFSET(died_recently) },
- { 'A', FLAG_OFFSET(acpi_overridden) },
- { 'W', FLAG_OFFSET(warning) },
- { 'C', FLAG_OFFSET(staging_driver) },
- { 'I', FLAG_OFFSET(firmware_workaround) },
- { 'O', FLAG_OFFSET(module_out_of_tree) },
- { '\0', 0 /* sentinel */ }
-};
-#undef FLAG_OFFSET
-
/* Based on function kernel_tainted_short from abrt/src/lib/kernel.c */
static bool
parse_taint_flags(const char *input, struct sr_koops_stacktrace *stacktrace)
@@ -145,8 +144,8 @@ parse_taint_flags(const char *input, struct sr_koops_stacktrace *stacktrace)
if (tainted[0] >= 'A' && tainted[0] <= 'Z')
{
/* set the appropriate flag */
- struct taint_flag *f;
- for (f = flags; f->letter; f++)
+ struct sr_taint_flag *f;
+ for (f = sr_flags; f->letter; f++)
{
if (tainted[0] == f->letter)
{
@@ -373,25 +372,15 @@ taint_flags_to_json(struct sr_koops_stacktrace *stacktrace)
{
struct sr_strbuf *strbuf = sr_strbuf_new();
-#define FLAG_APPEND(flag) \
- if (stacktrace->taint_ ## flag) \
- sr_strbuf_append_strf(strbuf, ", \"" #flag "\"\n"); \
-
- FLAG_APPEND(module_proprietary)
- FLAG_APPEND(forced_module)
- FLAG_APPEND(forced_removal)
- FLAG_APPEND(smp_unsafe)
- FLAG_APPEND(mce)
- FLAG_APPEND(page_release)
- FLAG_APPEND(userspace)
- FLAG_APPEND(died_recently)
- FLAG_APPEND(acpi_overridden)
- FLAG_APPEND(warning)
- FLAG_APPEND(staging_driver)
- FLAG_APPEND(firmware_workaround)
- FLAG_APPEND(module_out_of_tree)
-
-#undef FLAG_APPEND
+ struct sr_taint_flag *f;
+ for (f = sr_flags; f->letter; f++)
+ {
+ bool val = *(bool *)((void *)stacktrace + f->member_offset);
+ if (val == true)
+ {
+ sr_strbuf_append_strf(strbuf, ", \"%s\"\n", f->name);
+ }
+ }
if (strbuf->len == 0)
return sr_strdup("[]");
diff --git a/lib/koops_stacktrace.h b/lib/koops_stacktrace.h
index 4d77b31..580610f 100644
--- a/lib/koops_stacktrace.h
+++ b/lib/koops_stacktrace.h
@@ -33,6 +33,7 @@ extern "C" {
#include "report_type.h"
#include <stdbool.h>
#include <inttypes.h>
+#include <stddef.h>
struct sr_location;
@@ -158,6 +159,16 @@ sr_koops_stacktrace_get_reason(struct sr_koops_stacktrace *stacktrace);
char *
sr_koops_stacktrace_to_json(struct sr_koops_stacktrace *stacktrace);
+
+/* TODO: this needs to go in a _private_ header and should not be exported */
+struct sr_taint_flag
+{
+ char letter;
+ size_t member_offset;
+ char *name;
+};
+extern struct sr_taint_flag sr_flags[];
+
#ifdef __cplusplus
}
#endif
--
1.7.11.7
10 years, 11 months
[ABRT PATCH] a-d-oops: obtain kernel version from the oops
by Martin Milata
The FILENAME_KERNEL was overwritten by dd_create_basic_files -- this can
be worked around by calling the function first and saving the version
later.
Signed-off-by: Martin Milata <mmilata(a)redhat.com>
---
src/plugins/abrt-dump-oops.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/plugins/abrt-dump-oops.c b/src/plugins/abrt-dump-oops.c
index 4ae725c..83ae5a7 100644
--- a/src/plugins/abrt-dump-oops.c
+++ b/src/plugins/abrt-dump-oops.c
@@ -198,8 +198,8 @@ static unsigned create_oops_dump_dirs(GList *oops_list, unsigned oops_cnt)
if (dd)
{
- save_oops_data_in_dump_dir(dd, (char*)g_list_nth_data(oops_list, idx++), proc_modules);
dd_create_basic_files(dd, /*uid:*/ my_euid, NULL);
+ save_oops_data_in_dump_dir(dd, (char*)g_list_nth_data(oops_list, idx++), proc_modules);
dd_save_text(dd, FILENAME_ABRT_VERSION, VERSION);
dd_save_text(dd, FILENAME_ANALYZER, "Kerneloops");
dd_save_text(dd, FILENAME_TYPE, "Kerneloops");
--
1.7.11.7
10 years, 11 months
[ABRT PATCH] fixed undefined variable rhbz#971194
by Jiri Moskovcak
Signed-off-by: Jiri Moskovcak <jmoskovc(a)redhat.com>
---
src/plugins/abrt-action-perform-ccpp-analysis.in | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/plugins/abrt-action-perform-ccpp-analysis.in b/src/plugins/abrt-action-perform-ccpp-analysis.in
index e84e1e2..c4a107c 100644
--- a/src/plugins/abrt-action-perform-ccpp-analysis.in
+++ b/src/plugins/abrt-action-perform-ccpp-analysis.in
@@ -11,7 +11,8 @@ import gettext
from subprocess import Popen
import report
-from reportclient import ask_yes_no_yesforever, RETURN_OK, RETURN_CANCEL_BY_USER
+from reportclient import ask_yes_no_yesforever, RETURN_OK, \
+ RETURN_CANCEL_BY_USER, RETURN_FAILURE
GETTEXT_PROGNAME = "abrt"
--
1.8.2.1
10 years, 11 months
[ABRT PATCH] a-a-p-ccpp-analysis: import all used attributes
by Jakub Filak
Closes rhbz#971194
Signed-off-by: Jakub Filak <jfilak(a)redhat.com>
---
src/plugins/abrt-action-perform-ccpp-analysis.in | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/plugins/abrt-action-perform-ccpp-analysis.in b/src/plugins/abrt-action-perform-ccpp-analysis.in
index e84e1e2..7348641 100644
--- a/src/plugins/abrt-action-perform-ccpp-analysis.in
+++ b/src/plugins/abrt-action-perform-ccpp-analysis.in
@@ -11,7 +11,10 @@ import gettext
from subprocess import Popen
import report
-from reportclient import ask_yes_no_yesforever, RETURN_OK, RETURN_CANCEL_BY_USER
+from reportclient import (ask_yes_no_yesforever,
+ RETURN_OK,
+ RETURN_CANCEL_BY_USER,
+ RETURN_FAILURE)
GETTEXT_PROGNAME = "abrt"
--
1.8.1.4
10 years, 11 months
[LIBREPORT PATCH] make the uploader event available for all report types
by Jakub Filak
Closes rhbz#971117
Signed-off-by: Jakub Filak <jfilak(a)redhat.com>
---
src/plugins/uploader_event.conf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/plugins/uploader_event.conf b/src/plugins/uploader_event.conf
index 2406008..bd13c5e 100644
--- a/src/plugins/uploader_event.conf
+++ b/src/plugins/uploader_event.conf
@@ -1 +1 @@
-EVENT=report_Uploader analyzer=libreport reporter-upload
+EVENT=report_Uploader reporter-upload
--
1.8.1.4
10 years, 11 months
[ABRT PATCH 1/2] a-d-oops: add 'update' command line argument
by Jakub Filak
If the argument (-u PROBLEM) is used, abrt-dump-oops saves the data
obtained from input in the passed problem directory.
Related to #662
Signed-off-by: Jakub Filak <jfilak(a)redhat.com>
---
src/plugins/abrt-dump-oops.c | 129 +++++++++++++++++++++++++++----------------
1 file changed, 80 insertions(+), 49 deletions(-)
diff --git a/src/plugins/abrt-dump-oops.c b/src/plugins/abrt-dump-oops.c
index 2c8612e..6c4e8eb 100644
--- a/src/plugins/abrt-dump-oops.c
+++ b/src/plugins/abrt-dump-oops.c
@@ -108,6 +108,56 @@ static char *list_of_tainted_modules(const char *proc_modules)
return strbuf_free_nobuf(result);
}
+static void save_oops_data_in_dump_dir(struct dump_dir *dd, char *oops, const char *proc_modules)
+{
+ char *first_line = oops;
+ char *second_line = (char*)strchr(first_line, '\n'); /* never NULL */
+ *second_line++ = '\0';
+
+ dd_save_text(dd, FILENAME_KERNEL, first_line);
+ 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.");
+ else
+ {
+ char *tainted_short = kernel_tainted_short(second_line);
+ if (tainted_short)
+ {
+ VERB1 log("Kernel is tainted '%s'", tainted_short);
+ dd_save_text(dd, FILENAME_TAINTED_SHORT, tainted_short);
+
+ char *tnt_long = kernel_tainted_long(tainted_short);
+ dd_save_text(dd, FILENAME_TAINTED_LONG, tnt_long);
+ free(tnt_long);
+
+ struct strbuf *reason = strbuf_new();
+ const char *fmt = _("A kernel problem occurred, but your kernel has been "
+ "tainted (flags:%s). Kernel maintainers are unable to "
+ "diagnose tainted reports.");
+ strbuf_append_strf(reason, fmt, tainted_short);
+
+ char *modlist = !proc_modules ? NULL : list_of_tainted_modules(proc_modules);
+ if (modlist)
+ {
+ strbuf_append_strf(reason, _(" Tainted modules: %s."), modlist);
+ free(modlist);
+ }
+
+ dd_save_text(dd, FILENAME_NOT_REPORTABLE, reason->buf);
+ strbuf_free(reason);
+ free(tainted_short);
+ }
+ }
+
+ // 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);
+}
+
/* returns number of errors */
static unsigned save_oops_to_dump_dir(GList *oops_list, unsigned oops_cnt)
{
@@ -137,10 +187,6 @@ static unsigned save_oops_to_dump_dir(GList *oops_list, unsigned oops_cnt)
unsigned errors = 0;
while (idx < oops_cnt && --countdown != 0)
{
- char *first_line = (char*)g_list_nth_data(oops_list, idx++);
- char *second_line = (char*)strchr(first_line, '\n'); /* never NULL */
- *second_line++ = '\0';
-
struct dump_dir *dd;
{
char base[sizeof("oops-YYYY-MM-DD-hh:mm:ss-%lu-%lu") + 2 * sizeof(long)*3];
@@ -152,12 +198,11 @@ static unsigned save_oops_to_dump_dir(GList *oops_list, unsigned oops_cnt)
if (dd)
{
+ save_oops_data_in_dump_dir(dd, (char*)g_list_nth_data(oops_list, idx++), proc_modules);
dd_create_basic_files(dd, /*uid:*/ my_euid, NULL);
dd_save_text(dd, FILENAME_ABRT_VERSION, VERSION);
dd_save_text(dd, FILENAME_ANALYZER, "Kerneloops");
dd_save_text(dd, FILENAME_TYPE, "Kerneloops");
- dd_save_text(dd, FILENAME_KERNEL, first_line);
- dd_save_text(dd, FILENAME_BACKTRACE, second_line);
if (cmdline_str)
dd_save_text(dd, FILENAME_CMDLINE, cmdline_str);
if (proc_modules)
@@ -166,46 +211,6 @@ static unsigned save_oops_to_dump_dir(GList *oops_list, unsigned oops_cnt)
dd_save_text(dd, "fips_enabled", fips_enabled);
if (suspend_stats)
dd_save_text(dd, "suspend_stats", suspend_stats);
-
- /* 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.");
- else
- {
- char *tainted_short = kernel_tainted_short(second_line);
- if (tainted_short)
- {
- VERB1 log("Kernel is tainted '%s'", tainted_short);
- dd_save_text(dd, FILENAME_TAINTED_SHORT, tainted_short);
-
- char *tnt_long = kernel_tainted_long(tainted_short);
- dd_save_text(dd, FILENAME_TAINTED_LONG, tnt_long);
- free(tnt_long);
-
- struct strbuf *reason = strbuf_new();
- const char *fmt = _("A kernel problem occurred, but your kernel has been "
- "tainted (flags:%s). Kernel maintainers are unable to "
- "diagnose tainted reports.");
- strbuf_append_strf(reason, fmt, tainted_short);
-
- char *modlist = !proc_modules ? NULL : list_of_tainted_modules(proc_modules);
- if (modlist)
- {
- strbuf_append_strf(reason, _(" Tainted modules: %s."), modlist);
- free(modlist);
- }
-
- dd_save_text(dd, FILENAME_NOT_REPORTABLE, reason->buf);
- strbuf_free(reason);
- free(tainted_short);
- }
- }
-
-// 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);
dd_close(dd);
}
else
@@ -233,7 +238,7 @@ int main(int argc, char **argv)
/* Can't keep these strings/structs static: _() doesn't support that */
const char *program_usage_string = _(
- "& [-vsoxm] [-d DIR]/[-D] [FILE]\n"
+ "& [-vusoxm] [-d DIR]/[-D] [FILE]\n"
"\n"
"Extract oops from FILE (or standard input)"
);
@@ -243,9 +248,11 @@ int main(int argc, char **argv)
OPT_o = 1 << 2,
OPT_d = 1 << 3,
OPT_D = 1 << 4,
- OPT_x = 1 << 5,
- OPT_m = 1 << 6,
+ OPT_u = 1 << 5,
+ OPT_x = 1 << 6,
+ OPT_m = 1 << 7,
};
+ char *problem_dir = NULL;
/* Keep enum above and order of options below in sync! */
struct options program_options[] = {
OPT__VERBOSE(&g_verbose),
@@ -256,6 +263,7 @@ int main(int argc, char **argv)
*/
OPT_STRING('d', NULL, &debug_dumps_dir, "DIR", _("Create new problem directory in DIR for every oops found")),
OPT_BOOL( 'D', NULL, NULL, _("Same as -d DumpLocation, DumpLocation is specified in abrt.conf")),
+ OPT_STRING('u', NULL, &problem_dir, "PROBLEM", _("Save the extracted information in PROBLEM")),
OPT_BOOL( 'x', NULL, NULL, _("Make the problem directory world readable")),
OPT_BOOL( 'm', NULL, NULL, _("Print search string(s) to stdout and exit")),
OPT_END()
@@ -337,6 +345,29 @@ int main(int argc, char **argv)
oops_cnt
);
}
+ if (opts & OPT_u)
+ {
+ log("Updating problem directory");
+ switch(g_list_length(oops_list))
+ {
+ case 0:
+ error_msg(_("Cannot update the problem because of no oops found"));
+ break;
+ case 1:
+ {
+ struct dump_dir *dd = dd_opendir(problem_dir, /*open for writing*/0);
+ if (dd)
+ {
+ save_oops_data_in_dump_dir(dd, (char *)oops_list->data, /*no proc modules*/NULL);
+ dd_close(dd);
+ }
+ }
+ break;
+ default:
+ error_msg(_("Cannot update the problem because of more oopses were found"));
+ break;
+ }
+ }
}
list_free_with_free(oops_list);
//oops_list = NULL;
--
1.8.1.4
10 years, 11 months
[LIBREPORT PATCH] fixed relro flags rhbz#812283
by Jiri Moskovcak
Signed-off-by: Jiri Moskovcak <jmoskovc(a)redhat.com>
---
src/client-python/Makefile.am | 3 ++-
src/report-python/Makefile.am | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/client-python/Makefile.am b/src/client-python/Makefile.am
index c3ce8c6..67e3b7a 100644
--- a/src/client-python/Makefile.am
+++ b/src/client-python/Makefile.am
@@ -19,7 +19,8 @@ _reportclient_la_CPPFLAGS = \
$(GLIB_CFLAGS) \
$(PYTHON_CFLAGS) \
-D_GNU_SOURCE \
- -fPIE -Wl,-z,relro,now
+ -fPIE \
+ -Wl,-z,relro -Wl,-z,now
_reportclient_la_LDFLAGS = \
-module \
-avoid-version \
diff --git a/src/report-python/Makefile.am b/src/report-python/Makefile.am
index 5dc0b54..2afdf34 100644
--- a/src/report-python/Makefile.am
+++ b/src/report-python/Makefile.am
@@ -24,7 +24,8 @@ _pyreport_la_CPPFLAGS = \
$(GLIB_CFLAGS) \
$(PYTHON_CFLAGS) \
-D_GNU_SOURCE \
- -fPIE -Wl,-z,relro,now
+ -fPIE \
+ -Wl,-z,relro -Wl,-z,now
_pyreport_la_LDFLAGS = \
-module \
-avoid-version \
--
1.8.2.1
10 years, 11 months
[LIBREPORT PATCH] ureport: add conversion from abrt vmcore type to ureport KERNELOOPS type
by Jakub Filak
Closes #163
Signed-off-by: Jakub Filak <jfilak(a)redhat.com>
---
src/lib/json.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lib/json.c b/src/lib/json.c
index bf1e049..d5c6f2d 100644
--- a/src/lib/json.c
+++ b/src/lib/json.c
@@ -139,7 +139,7 @@ static bool ureport_add_type(struct json_object *ur, problem_data_t *pd)
ureport_add_str(ur, "type", "USERSPACE");
else if (strcmp(pd_item, "Python") == 0)
ureport_add_str(ur, "type", "PYTHON");
- else if (strcmp(pd_item, "Kerneloops") == 0)
+ else if (strcmp(pd_item, "Kerneloops") == 0 || strcmp(pd_item, "vmcore") == 0)
ureport_add_str(ur, "type", "KERNELOOPS");
else
{
--
1.8.1.4
10 years, 11 months
[SATYR PATCH] unwind: resolve symbols through libunwind
by Martin Milata
The libunwind-based unwind code used elfutils to obtain function names.
This patch adds fallback to symbol resolution provided by libunwind if
elfutils do not return any result. This is useful on systems where
binaries have embedded minidebuginfo and libunwind has minidebuginfo
support while elfutils do not (e.g. fedora 19).
Related to #82.
Signed-off-by: Martin Milata <mmilata(a)redhat.com>
---
lib/core_unwind_libunwind.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/lib/core_unwind_libunwind.c b/lib/core_unwind_libunwind.c
index 29805da..8f4664b 100644
--- a/lib/core_unwind_libunwind.c
+++ b/lib/core_unwind_libunwind.c
@@ -395,6 +395,17 @@ unwind_thread(struct UCD_info *ui,
entry->function_name = sr_strdup(funcname);
}
+ if (!entry->function_name)
+ {
+ size_t funcname_len = 512;
+ char *funcname = sr_malloc(funcname_len);
+
+ if (unw_get_proc_name(&c, funcname, funcname_len, NULL) == 0)
+ entry->function_name = funcname;
+ else
+ free(funcname);
+ }
+
trace = sr_core_frame_append(trace, entry);
/*
printf("%s 0x%llx %s %s -\n",
--
1.7.11.7
10 years, 11 months
How to get mock chroot with rpms for a core file?
by Jan Kratochvil
Hi,
as an example for example core file:
https://bugzilla.redhat.com/show_bug.cgi?id=926099#c16
On updated Fedora 18 x86_64 the rpms are too new; but how to get the matching
ones?
I had the best result with:
retrace-server/src/coredump2packages
But still even there GDB wants to load nspr - one of the many failures - but
coredump2packages does not list nspr at all, therefore the system one does not
match.
Tried also darkclient I can generate a list of rpms but then I fail how to
install them:
* yum remote installation does not work as older rpms are only in Koji, not
in Fedora repos.
* yum localinstall for missing dependencies again searches only Fedora repos
and not Koji
* yum never downgrades version to the specified rpm file if a newer rpm is
already installed / available as a dependency.
* rpm -Uvh --oldpackage does not resolve missing dependecies at all, neither
from Fedora repos nor from Koji.
You have something done on the ABRT Retrace Server but how to prepare the same
mock chroot for local core file investigations?
Thanks,
Jan
10 years, 11 months