[PATCH-libreport] report-python: don't include executable
by Martin Milata
Doesn't really make sense, as it is always path to the python
executable. bz#741255
---
src/include/problem_data.h | 3 +++
src/lib/problem_data.c | 5 +++++
src/report-python/problem_data.c | 8 ++++++++
3 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/src/include/problem_data.h b/src/include/problem_data.h
index 14d1240..87037a2 100644
--- a/src/include/problem_data.h
+++ b/src/include/problem_data.h
@@ -74,6 +74,9 @@ void add_to_problem_data(problem_data_t *problem_data,
const char *name,
const char *content);
+/* Removes item from problem data */
+void remove_from_problem_data(problem_data_t *problem_data, const char *key);
+
static inline struct problem_item *get_problem_data_item_or_NULL(problem_data_t *problem_data, const char *key)
{
return (struct problem_item *)g_hash_table_lookup(problem_data, key);
diff --git a/src/lib/problem_data.c b/src/lib/problem_data.c
index 2ddff86..7d85709 100644
--- a/src/lib/problem_data.c
+++ b/src/lib/problem_data.c
@@ -155,6 +155,11 @@ void add_to_problem_data(problem_data_t *problem_data,
add_to_problem_data_ext(problem_data, name, content, CD_FLAG_TXT + CD_FLAG_ISNOTEDITABLE);
}
+void remove_from_problem_data(problem_data_t *problem_data, const char *key)
+{
+ g_hash_table_remove(problem_data, key);
+}
+
const char *get_problem_item_content_or_die(problem_data_t *problem_data, const char *key)
{
struct problem_item *item = get_problem_data_item_or_NULL(problem_data, key);
diff --git a/src/report-python/problem_data.c b/src/report-python/problem_data.c
index 9067dea..8b4088d 100644
--- a/src/report-python/problem_data.c
+++ b/src/report-python/problem_data.c
@@ -115,8 +115,16 @@ static PyObject *p_create_dump_dir_from_problem_data(PyObject *pself, PyObject *
static PyObject *p_add_basics_to_problem_data(PyObject *pself, PyObject *always_null)
{
p_problem_data *self = (p_problem_data*)pself;
+ int have_executable = (get_problem_data_item_or_NULL(self->cd, "executable") != NULL);
+
add_basics_to_problem_data(self->cd);
+ /* Workaround - the executable item will always be /usr/bin/python, which is useless. */
+ if (!have_executable)
+ {
+ remove_from_problem_data(self->cd, "executable");
+ }
+
Py_RETURN_NONE;
}
--
1.7.6.4
12 years, 1 month
[PATCH] koops-unit-test: test for stripping jiffies from kernel trace
by Nikola Pajkovsky
Signed-off-by: Nikola Pajkovsky <npajkovs(a)redhat.com>
---
examples/oops-with-jiffies.right | 45 ++---
examples/oops-with-jiffies.test | 23 +++
src/include/libabrt.h | 2 +
src/lib/kernel.c | 347 +++++++++++++++++++++++++++++++++++++
src/plugins/abrt-dump-oops.c | 352 +-------------------------------------
tests/koops-parser.at | 38 ++++
6 files changed, 435 insertions(+), 372 deletions(-)
create mode 100644 examples/oops-with-jiffies.test
diff --git a/examples/oops-with-jiffies.right b/examples/oops-with-jiffies.right
index 7bcc728..369793e 100644
--- a/examples/oops-with-jiffies.right
+++ b/examples/oops-with-jiffies.right
@@ -1,23 +1,24 @@
-[178856.137422] WARNING: at /builddir/build/BUILD/kernel-3.2.fc16/compat-wireless-3.3-rc1-2/include/net/mac80211.h:3618 rate_control_send_low+0x23e/0x250 [mac80211]()
-[178856.137437] Hardware name: 4177CTO
-[178856.137438] Modules linked in: usb_storage tcp_lp ppdev parport_pc lp parport fuse ipt_MASQUERADE iptable_nat nf_nat xt_CHECKSUM be2iscsi iscsi_boot_sysfs bnx2i iptable_mangle cnic uio cxgb4i cxgb4 cxgb3i bridge stp llc libcxgbi cxgb3 mdio ib_iser rdma_cm ib_cm iw_cm ib_sa ib_mad ib_core ib_addr iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi ip6t_REJECT nf_conntrack_ipv4 nf_conntrack_ipv6 nf_defrag_ipv6 nf_defrag_ipv4 xt_state ip6table_filter nf_conntrack ip6_tables sha256_generic dm_crypt snd_hda_codec_hdmi snd_hda_codec_conexant snd_hda_intel snd_hda_codec snd_hwdep arc4 vhost_net macvtap macvlan tun snd_seq snd_seq_device virtio_net snd_pcm kvm_intel snd_timer kvm thinkpad_acpi iwlwifi snd mac80211 e1000e tpm_tis tpm tpm_bios nfsd lockd snd_page_alloc soundcore cfg80211 rfkill nfs_acl auth_rpcgss i2c_i801 sunrpc uinput joydev iTCO_wdt iTCO_vendor_support microcode firewire_ohci firewire_core crc_itu_t sdhci_pci sdhci mmc_core wmi i915 drm_kms_helper drm i2c_alg!
o_bit i2
+3.2.5-3.fc16.x86_64
+WARNING: at /builddir/build/BUILD/kernel-3.2.fc16/compat-wireless-3.3-rc1-2/include/net/mac80211.h:3618 rate_control_send_low+0x23e/0x250 [mac80211]()
+Hardware name: 4177CTO
+Modules linked in: usb_storage tcp_lp ppdev parport_pc lp parport fuse ipt_MASQUERADE iptable_nat nf_nat xt_CHECKSUM be2iscsi iscsi_boot_sysfs bnx2i iptable_mangle cnic uio cxgb4i cxgb4 cxgb3i bridge stp llc libcxgbi cxgb3 mdio ib_iser rdma_cm ib_cm iw_cm ib_sa ib_mad ib_core ib_addr iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi ip6t_REJECT nf_conntrack_ipv4 nf_conntrack_ipv6 nf_defrag_ipv6 nf_defrag_ipv4 xt_state ip6table_filter nf_conntrack ip6_tables sha256_generic dm_crypt snd_hda_codec_hdmi snd_hda_codec_conexant snd_hda_intel snd_hda_codec snd_hwdep arc4 vhost_net macvtap macvlan tun snd_seq snd_seq_device virtio_net snd_pcm kvm_intel snd_timer kvm thinkpad_acpi iwlwifi snd mac80211 e1000e tpm_tis tpm tpm_bios nfsd lockd snd_page_alloc soundcore cfg80211 rfkill nfs_acl auth_rpcgss i2c_i801 sunrpc uinput joydev iTCO_wdt iTCO_vendor_support microcode firewire_ohci firewire_core crc_itu_t sdhci_pci sdhci mmc_core wmi i915 drm_kms_helper drm i2c_algo_bit i2
c_core video [last unloaded: scsi_wait_scan]
-[178856.137482] Pid: 22695, comm: ksoftirqd/2 Not tainted 3.2.5-3.fc16.x86_64 #1
-[178856.137484] Call Trace:
-[178856.137490] [<ffffffff8106dd4f>] warn_slowpath_common+0x7f/0xc0
-[178856.137493] [<ffffffff8106ddaa>] warn_slowpath_null+0x1a/0x20
-[178856.137500] [<ffffffffa02a344e>] rate_control_send_low+0x23e/0x250 [mac80211]
-[178856.137506] [<ffffffffa0336d15>] rs_get_rate+0x65/0x1d0 [iwlwifi]
-[178856.137513] [<ffffffffa02a37c6>] rate_control_get_rate+0x96/0x170 [mac80211]
-[178856.137522] [<ffffffffa02af59f>] invoke_tx_handlers+0x6ff/0x13e0 [mac80211]
-[178856.137528] [<ffffffffa028edac>] ? sta_info_get+0x6c/0x80 [mac80211]
-[178856.137536] [<ffffffffa02b03d0>] ieee80211_tx+0x60/0xc0 [mac80211]
-[178856.137543] [<ffffffffa02b1352>] ieee80211_tx_pending+0x162/0x270 [mac80211]
-[178856.137546] [<ffffffff81074d18>] tasklet_action+0x78/0x140
-[178856.137548] [<ffffffff81075378>] __do_softirq+0xb8/0x230
-[178856.137550] [<ffffffff810755aa>] run_ksoftirqd+0xba/0x170
-[178856.137552] [<ffffffff810754f0>] ? __do_softirq+0x230/0x230
-[178856.137556] [<ffffffff8108fb9c>] kthread+0x8c/0xa0
-[178856.137559] [<ffffffff815eb8f4>] kernel_thread_helper+0x4/0x10
-[178856.137561] [<ffffffff8108fb10>] ? kthread_worker_fn+0x190/0x190
-[178856.137563] [<ffffffff815eb8f0>] ? gs_change+0x13/0x13
+Pid: 22695, comm: ksoftirqd/2 Not tainted 3.2.5-3.fc16.x86_64 #1
+Call Trace:
+ [<ffffffff8106dd4f>] warn_slowpath_common+0x7f/0xc0
+ [<ffffffff8106ddaa>] warn_slowpath_null+0x1a/0x20
+ [<ffffffffa02a344e>] rate_control_send_low+0x23e/0x250 [mac80211]
+ [<ffffffffa0336d15>] rs_get_rate+0x65/0x1d0 [iwlwifi]
+ [<ffffffffa02a37c6>] rate_control_get_rate+0x96/0x170 [mac80211]
+ [<ffffffffa02af59f>] invoke_tx_handlers+0x6ff/0x13e0 [mac80211]
+ [<ffffffffa028edac>] ? sta_info_get+0x6c/0x80 [mac80211]
+ [<ffffffffa02b03d0>] ieee80211_tx+0x60/0xc0 [mac80211]
+ [<ffffffffa02b1352>] ieee80211_tx_pending+0x162/0x270 [mac80211]
+ [<ffffffff81074d18>] tasklet_action+0x78/0x140
+ [<ffffffff81075378>] __do_softirq+0xb8/0x230
+ [<ffffffff810755aa>] run_ksoftirqd+0xba/0x170
+ [<ffffffff810754f0>] ? __do_softirq+0x230/0x230
+ [<ffffffff8108fb9c>] kthread+0x8c/0xa0
+ [<ffffffff815eb8f4>] kernel_thread_helper+0x4/0x10
+ [<ffffffff8108fb10>] ? kthread_worker_fn+0x190/0x190
+ [<ffffffff815eb8f0>] ? gs_change+0x13/0x13
diff --git a/examples/oops-with-jiffies.test b/examples/oops-with-jiffies.test
new file mode 100644
index 0000000..7bcc728
--- /dev/null
+++ b/examples/oops-with-jiffies.test
@@ -0,0 +1,23 @@
+[178856.137422] WARNING: at /builddir/build/BUILD/kernel-3.2.fc16/compat-wireless-3.3-rc1-2/include/net/mac80211.h:3618 rate_control_send_low+0x23e/0x250 [mac80211]()
+[178856.137437] Hardware name: 4177CTO
+[178856.137438] Modules linked in: usb_storage tcp_lp ppdev parport_pc lp parport fuse ipt_MASQUERADE iptable_nat nf_nat xt_CHECKSUM be2iscsi iscsi_boot_sysfs bnx2i iptable_mangle cnic uio cxgb4i cxgb4 cxgb3i bridge stp llc libcxgbi cxgb3 mdio ib_iser rdma_cm ib_cm iw_cm ib_sa ib_mad ib_core ib_addr iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi ip6t_REJECT nf_conntrack_ipv4 nf_conntrack_ipv6 nf_defrag_ipv6 nf_defrag_ipv4 xt_state ip6table_filter nf_conntrack ip6_tables sha256_generic dm_crypt snd_hda_codec_hdmi snd_hda_codec_conexant snd_hda_intel snd_hda_codec snd_hwdep arc4 vhost_net macvtap macvlan tun snd_seq snd_seq_device virtio_net snd_pcm kvm_intel snd_timer kvm thinkpad_acpi iwlwifi snd mac80211 e1000e tpm_tis tpm tpm_bios nfsd lockd snd_page_alloc soundcore cfg80211 rfkill nfs_acl auth_rpcgss i2c_i801 sunrpc uinput joydev iTCO_wdt iTCO_vendor_support microcode firewire_ohci firewire_core crc_itu_t sdhci_pci sdhci mmc_core wmi i915 drm_kms_helper drm i2c_alg!
o_bit i2
+c_core video [last unloaded: scsi_wait_scan]
+[178856.137482] Pid: 22695, comm: ksoftirqd/2 Not tainted 3.2.5-3.fc16.x86_64 #1
+[178856.137484] Call Trace:
+[178856.137490] [<ffffffff8106dd4f>] warn_slowpath_common+0x7f/0xc0
+[178856.137493] [<ffffffff8106ddaa>] warn_slowpath_null+0x1a/0x20
+[178856.137500] [<ffffffffa02a344e>] rate_control_send_low+0x23e/0x250 [mac80211]
+[178856.137506] [<ffffffffa0336d15>] rs_get_rate+0x65/0x1d0 [iwlwifi]
+[178856.137513] [<ffffffffa02a37c6>] rate_control_get_rate+0x96/0x170 [mac80211]
+[178856.137522] [<ffffffffa02af59f>] invoke_tx_handlers+0x6ff/0x13e0 [mac80211]
+[178856.137528] [<ffffffffa028edac>] ? sta_info_get+0x6c/0x80 [mac80211]
+[178856.137536] [<ffffffffa02b03d0>] ieee80211_tx+0x60/0xc0 [mac80211]
+[178856.137543] [<ffffffffa02b1352>] ieee80211_tx_pending+0x162/0x270 [mac80211]
+[178856.137546] [<ffffffff81074d18>] tasklet_action+0x78/0x140
+[178856.137548] [<ffffffff81075378>] __do_softirq+0xb8/0x230
+[178856.137550] [<ffffffff810755aa>] run_ksoftirqd+0xba/0x170
+[178856.137552] [<ffffffff810754f0>] ? __do_softirq+0x230/0x230
+[178856.137556] [<ffffffff8108fb9c>] kthread+0x8c/0xa0
+[178856.137559] [<ffffffff815eb8f4>] kernel_thread_helper+0x4/0x10
+[178856.137561] [<ffffffff8108fb10>] ? kthread_worker_fn+0x190/0x190
+[178856.137563] [<ffffffff815eb8f0>] ? gs_change+0x13/0x13
diff --git a/src/include/libabrt.h b/src/include/libabrt.h
index c7d2bae..bb23ec3 100644
--- a/src/include/libabrt.h
+++ b/src/include/libabrt.h
@@ -71,6 +71,8 @@ char *koops_extract_version(const char *line);
char *kernel_tainted_short(const char *kernel_bt);
#define koops_hash_str abrt_koops_hash_str
void koops_hash_str(char hash_str[SHA1_RESULT_LEN*2 + 1], char *oops_buf, const char *oops_ptr);
+#define koops_extract_oopses abrt_koops_extract_oopses
+void koops_extract_oopses(GList **oops_list, char *buffer, size_t buflen);
#ifdef __cplusplus
}
diff --git a/src/lib/kernel.c b/src/lib/kernel.c
index 25fab21..ed7c754 100644
--- a/src/lib/kernel.c
+++ b/src/lib/kernel.c
@@ -19,6 +19,353 @@
#include "libabrt.h"
+/*
+ * extract_oops tries to find oops signatures in a log
+ */
+
+struct line_info {
+ char *ptr;
+ char level;
+};
+
+static void record_oops(GList **oops_list, struct line_info* lines_info, int oopsstart, int oopsend)
+{
+ int q;
+ int len;
+ int rv = 1;
+
+ len = 2;
+ for (q = oopsstart; q <= oopsend; q++)
+ len += strlen(lines_info[q].ptr) + 1;
+
+ /* too short oopses are invalid */
+ if (len > 100)
+ {
+ char *oops = (char*)xzalloc(len);
+ char *dst = oops;
+ char *version = NULL;
+ for (q = oopsstart; q <= oopsend; q++)
+ {
+ if (!version)
+ version = koops_extract_version(lines_info[q].ptr);
+ if (lines_info[q].ptr[0])
+ {
+ dst = stpcpy(dst, lines_info[q].ptr);
+ dst = stpcpy(dst, "\n");
+ }
+ }
+ if ((dst - oops) > 100)
+ {
+ *oops_list = g_list_append(
+ *oops_list,
+ xasprintf("%s\n%s", (version ? version : "undefined"), oops)
+ );
+ }
+ else
+ {
+ /* too short oopses are invalid */
+ rv = 0;
+ }
+ free(oops);
+ free(version);
+ }
+
+ VERB3 if (rv == 0) log("Dropped oops: too short");
+}
+
+void koops_extract_oopses(GList **oops_list, char *buffer, size_t buflen)
+{
+ char *c;
+ int linecount = 0;
+ int lines_info_size = 0;
+ struct line_info *lines_info = NULL;
+
+ /* Split buffer into lines */
+
+ if (buflen != 0)
+ buffer[buflen - 1] = '\n'; /* the buffer usually ends with \n, but let's make sure */
+ c = buffer;
+ while (c < buffer + buflen)
+ {
+ char linelevel;
+ char *c9;
+ char *colon;
+
+ linecount++;
+ c9 = (char*)memchr(c, '\n', buffer + buflen - c); /* a \n will always be found */
+ assert(c9);
+ *c9 = '\0'; /* turn the \n into a string termination */
+ if (c9 == c)
+ goto next_line;
+
+ /* Is it a syslog file (/var/log/messages or similar)?
+ * Even though _usually_ it looks like "Nov 19 12:34:38 localhost kernel: xxx",
+ * some users run syslog in non-C locale:
+ * "2010-02-22T09:24:08.156534-08:00 gnu-4 gnome-session[2048]: blah blah"
+ * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ !!!
+ * We detect it by checking for N:NN:NN pattern in first 15 chars
+ * (and this still is not good enough... false positive: "pci 0000:15:00.0: PME# disabled")
+ */
+ colon = strchr(c, ':');
+ if (colon && colon > c && colon < c + 15
+ && isdigit(colon[-1]) /* N:... */
+ && isdigit(colon[1]) /* ...N:NN:... */
+ && isdigit(colon[2])
+ && colon[3] == ':'
+ && isdigit(colon[4]) /* ...N:NN:NN... */
+ && isdigit(colon[5])
+ ) {
+ /* It's syslog file, not a bare dmesg */
+
+ /* Skip non-kernel lines */
+ char *kernel_str = strstr(c, "kernel: ");
+ if (!kernel_str)
+ {
+ /* if we see our own marker:
+ * "hostname abrt: Kerneloops: Reported 1 kernel oopses to Abrt"
+ * we know we submitted everything upto here already */
+ if (strstr(c, "kernel oopses to Abrt"))
+ {
+ VERB3 log("Found our marker at line %d", linecount);
+ free(lines_info);
+ lines_info = NULL;
+ lines_info_size = 0;
+ list_free_with_free(*oops_list);
+ *oops_list = NULL;
+ }
+ goto next_line;
+ }
+ c = kernel_str + sizeof("kernel: ")-1;
+ }
+
+ linelevel = 0;
+ /* store and remove kernel log level */
+ if (*c == '<' && c[1] && c[2] == '>')
+ {
+ linelevel = c[1];
+ c += 3;
+ }
+ /* remove jiffies time stamp counter if present
+ * jiffies are unsigned long, so it can be 2^64 long, which is
+ * 20 decimal digits*/
+ if (*c == '[')
+ {
+ char *c2 = strchr(c, '.');
+ char *c3 = strchr(c, ']');
+ if (c2 && c3 && (c2 < c3) && (c3-c) < 21 && (c2-c) < 8)
+ {
+ c = c3 + 1;
+ if (*c == ' ')
+ c++;
+ }
+ }
+ if ((lines_info_size & 0xfff) == 0)
+ {
+ lines_info = xrealloc(lines_info, (lines_info_size + 0x1000) * sizeof(lines_info[0]));
+ }
+ lines_info[lines_info_size].ptr = c;
+ lines_info[lines_info_size].level = linelevel;
+ lines_info_size++;
+next_line:
+ c = c9 + 1;
+ }
+
+ /* Analyze lines */
+
+ int i;
+ char prevlevel = 0;
+ int oopsstart = -1;
+ int inbacktrace = 0;
+
+ i = 0;
+ while (i < lines_info_size)
+ {
+ char *curline = lines_info[i].ptr;
+
+ if (curline == NULL)
+ {
+ i++;
+ continue;
+ }
+ while (*curline == ' ')
+ curline++;
+
+ if (oopsstart < 0)
+ {
+ /* Find start-of-oops markers */
+ /* In some comparisons, we skip 1st letter, to avoid dealing with
+ * changes in capitalization in kernel. For example, I see that
+ * current kernel git (at 2011-01-01) has both "kernel BUG at ..."
+ * and "Kernel BUG at ..." messages, and I don't want to change
+ * the code below whenever kernel is changed to use "K" (or "k")
+ * uniformly.
+ */
+ if (strstr(curline, /*g*/ "eneral protection fault:"))
+ oopsstart = i;
+ else if (strstr(curline, "BUG:"))
+ oopsstart = i;
+ else if (strstr(curline, /*k*/ "ernel BUG at"))
+ oopsstart = i;
+ /* WARN_ON() generated message */
+ else if (strstr(curline, "WARNING: at "))
+ oopsstart = i;
+ else if (strstr(curline, /*u*/ "nable to handle kernel"))
+ oopsstart = i;
+ else if (strstr(curline, /*d*/ "ouble fault:"))
+ oopsstart = i;
+ else if (strstr(curline, "do_IRQ: stack overflow:"))
+ oopsstart = i;
+ else if (strstr(curline, "RTNL: assertion failed"))
+ oopsstart = i;
+ else if (strstr(curline, /*e*/ "eek! page_mapcount(page) went negative!"))
+ oopsstart = i;
+ else if (strstr(curline, /*n*/ "ear stack overflow (cur:"))
+ oopsstart = i;
+ else if (strstr(curline, /*b*/ "adness at"))
+ oopsstart = i;
+ else if (strstr(curline, "NETDEV WATCHDOG"))
+ oopsstart = i;
+ else if (strstr(curline, /*s*/ "ysctl table check failed"))
+ oopsstart = i;
+ else if (strstr(curline, "INFO: possible recursive locking detected"))
+ oopsstart = i;
+ // Not needed: "--[ cut here ]--" is always followed
+ // by "Badness at", "kernel BUG at", or "WARNING: at" string
+ //else if (strstr(curline, "------------[ cut here ]------------"))
+ // oopsstart = i;
+ else if (strstr(curline, "list_del corruption"))
+ oopsstart = i;
+ else if (strstr(curline, "list_add corruption"))
+ oopsstart = i;
+ /* "irq NN: nobody cared..." */
+ else if (strstr(curline, ": nobody cared"))
+ oopsstart = i;
+ else if (strstr(curline, "IRQ handler type mismatch"))
+ oopsstart = i;
+
+ if (oopsstart >= 0)
+ {
+ /* debug information */
+ VERB3 {
+ log("Found oops at line %d: '%s'", oopsstart, lines_info[oopsstart].ptr);
+ if (oopsstart != i)
+ log("Trigger line is %d: '%s'", i, c);
+ }
+ /* try to find the end marker */
+ int i2 = i + 1;
+ while (i2 < lines_info_size && i2 < (i+50))
+ {
+ if (strstr(lines_info[i2].ptr, "---[ end trace"))
+ {
+ inbacktrace = 1;
+ i = i2;
+ break;
+ }
+ i2++;
+ }
+ }
+ }
+
+ /* Are we entering a call trace part? */
+ /* a call trace starts with "Call Trace:" or with the " [<.......>] function+0xFF/0xAA" pattern */
+ if (oopsstart >= 0 && !inbacktrace)
+ {
+ if (strstr(curline, "Call Trace:"))
+ inbacktrace = 1;
+ else
+ if (strnlen(curline, 9) > 8
+ && curline[0] == '[' && curline[1] == '<'
+ && strstr(curline, ">]")
+ && strstr(curline, "+0x")
+ && strstr(curline, "/0x")
+ ) {
+ inbacktrace = 1;
+ }
+ }
+
+ /* Are we at the end of an oops? */
+ else if (oopsstart >= 0 && inbacktrace)
+ {
+ int oopsend = INT_MAX;
+
+ /* line needs to start with " [" or have "] [" if it is still a call trace */
+ /* example: "[<ffffffffa006c156>] radeon_get_ring_head+0x16/0x41 [radeon]" */
+ if (curline[0] != '['
+ && !strstr(curline, "] [")
+ && !strstr(curline, "--- Exception")
+ && !strstr(curline, "LR =")
+ && !strstr(curline, "<#DF>")
+ && !strstr(curline, "<IRQ>")
+ && !strstr(curline, "<EOI>")
+ && !strstr(curline, "<<EOE>>")
+ && strncmp(curline, "Code: ", 6) != 0
+ && strncmp(curline, "RIP ", 4) != 0
+ && strncmp(curline, "RSP ", 4) != 0
+ ) {
+ oopsend = i-1; /* not a call trace line */
+ }
+ /* oops lines are always more than 8 chars long */
+ else if (strnlen(curline, 8) < 8)
+ oopsend = i-1;
+ /* single oopses are of the same loglevel */
+ else if (lines_info[i].level != prevlevel)
+ oopsend = i-1;
+ else if (strstr(curline, "Instruction dump:"))
+ oopsend = i;
+ /* if a new oops starts, this one has ended */
+ else if (strstr(curline, "WARNING: at ") && oopsstart != i) /* WARN_ON() generated message */
+ oopsend = i-1;
+ else if (strstr(curline, "Unable to handle") && oopsstart != i)
+ oopsend = i-1;
+ /* kernel end-of-oops marker (not including marker itself) */
+ else if (strstr(curline, "---[ end trace"))
+ oopsend = i-1;
+
+ if (oopsend <= i)
+ {
+ VERB3 log("End of oops at line %d (%d): '%s'", oopsend, i, lines_info[oopsend].ptr);
+ record_oops(oops_list, lines_info, oopsstart, oopsend);
+ oopsstart = -1;
+ inbacktrace = 0;
+ }
+ }
+
+ prevlevel = lines_info[i].level;
+ i++;
+
+ if (oopsstart >= 0)
+ {
+ /* Do we have a suspiciously long oops? Cancel it.
+ * Bumped from 60 to 80 (see examples/oops_recursive_locking1.test)
+ */
+ if (i - oopsstart > 80)
+ {
+ inbacktrace = 0;
+ oopsstart = -1;
+ VERB3 log("Dropped oops, too long");
+ continue;
+ }
+ if (!inbacktrace && i - oopsstart > 40)
+ {
+ /*inbacktrace = 0; - already is */
+ oopsstart = -1;
+ VERB3 log("Dropped oops, too long");
+ continue;
+ }
+ }
+ } /* while (i < lines_info_size) */
+
+ /* process last oops if we have one */
+ if (oopsstart >= 0 && inbacktrace)
+ {
+ int oopsend = i-1;
+ VERB3 log("End of oops at line %d (end of file): '%s'", oopsend, lines_info[oopsend].ptr);
+ record_oops(oops_list, lines_info, oopsstart, oopsend);
+ }
+
+ free(lines_info);
+}
+
void koops_hash_str(char hash_str[SHA1_RESULT_LEN*2 + 1], char *oops_buf, const char *oops_ptr)
{
// Example of call trace part of oops:
diff --git a/src/plugins/abrt-dump-oops.c b/src/plugins/abrt-dump-oops.c
index 006c801..60b84fa 100644
--- a/src/plugins/abrt-dump-oops.c
+++ b/src/plugins/abrt-dump-oops.c
@@ -22,354 +22,6 @@
#include "libabrt.h"
-/*
- * extract_oops tries to find oops signatures in a log
- */
-
-struct line_info {
- char *ptr;
- char level;
-};
-
-static void record_oops(GList **oops_list, struct line_info* lines_info, int oopsstart, int oopsend)
-{
- int q;
- int len;
- int rv = 1;
-
- len = 2;
- for (q = oopsstart; q <= oopsend; q++)
- len += strlen(lines_info[q].ptr) + 1;
-
- /* too short oopses are invalid */
- if (len > 100)
- {
- char *oops = (char*)xzalloc(len);
- char *dst = oops;
- char *version = NULL;
- for (q = oopsstart; q <= oopsend; q++)
- {
- if (!version)
- version = koops_extract_version(lines_info[q].ptr);
- if (lines_info[q].ptr[0])
- {
- dst = stpcpy(dst, lines_info[q].ptr);
- dst = stpcpy(dst, "\n");
- }
- }
- if ((dst - oops) > 100)
- {
- *oops_list = g_list_append(
- *oops_list,
- xasprintf("%s\n%s", (version ? version : "undefined"), oops)
- );
- }
- else
- {
- /* too short oopses are invalid */
- rv = 0;
- }
- free(oops);
- free(version);
- }
-
- VERB3 if (rv == 0) log("Dropped oops: too short");
-}
-
-static void extract_oopses(GList **oops_list, char *buffer, size_t buflen)
-{
- char *c;
- int linecount = 0;
- int lines_info_size = 0;
- struct line_info *lines_info = NULL;
-
- /* Split buffer into lines */
-
- if (buflen != 0)
- buffer[buflen - 1] = '\n'; /* the buffer usually ends with \n, but let's make sure */
- c = buffer;
- while (c < buffer + buflen)
- {
- char linelevel;
- char *c9;
- char *colon;
-
- linecount++;
- c9 = (char*)memchr(c, '\n', buffer + buflen - c); /* a \n will always be found */
- assert(c9);
- *c9 = '\0'; /* turn the \n into a string termination */
- if (c9 == c)
- goto next_line;
-
- /* Is it a syslog file (/var/log/messages or similar)?
- * Even though _usually_ it looks like "Nov 19 12:34:38 localhost kernel: xxx",
- * some users run syslog in non-C locale:
- * "2010-02-22T09:24:08.156534-08:00 gnu-4 gnome-session[2048]: blah blah"
- * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ !!!
- * We detect it by checking for N:NN:NN pattern in first 15 chars
- * (and this still is not good enough... false positive: "pci 0000:15:00.0: PME# disabled")
- */
- colon = strchr(c, ':');
- if (colon && colon > c && colon < c + 15
- && isdigit(colon[-1]) /* N:... */
- && isdigit(colon[1]) /* ...N:NN:... */
- && isdigit(colon[2])
- && colon[3] == ':'
- && isdigit(colon[4]) /* ...N:NN:NN... */
- && isdigit(colon[5])
- ) {
- /* It's syslog file, not a bare dmesg */
-
- /* Skip non-kernel lines */
- char *kernel_str = strstr(c, "kernel: ");
- if (!kernel_str)
- {
- /* if we see our own marker:
- * "hostname abrt: Kerneloops: Reported 1 kernel oopses to Abrt"
- * we know we submitted everything upto here already */
- if (strstr(c, "kernel oopses to Abrt"))
- {
- VERB3 log("Found our marker at line %d", linecount);
- free(lines_info);
- lines_info = NULL;
- lines_info_size = 0;
- list_free_with_free(*oops_list);
- *oops_list = NULL;
- }
- goto next_line;
- }
- c = kernel_str + sizeof("kernel: ")-1;
- }
-
- linelevel = 0;
- /* store and remove kernel log level */
- if (*c == '<' && c[1] && c[2] == '>')
- {
- linelevel = c[1];
- c += 3;
- }
- /* remove jiffies time stamp counter if present
- * jiffies are unsigned long, so it can be 2^64 long, which is
- * 20 decimal digits*/
- if (*c == '[')
- {
- char *c2 = strchr(c, '.');
- char *c3 = strchr(c, ']');
- if (c2 && c3 && (c2 < c3) && (c3-c) < 21 && (c2-c) < 8)
- {
- c = c3 + 1;
- if (*c == ' ')
- c++;
- }
- }
- if ((lines_info_size & 0xfff) == 0)
- {
- lines_info = xrealloc(lines_info, (lines_info_size + 0x1000) * sizeof(lines_info[0]));
- }
- lines_info[lines_info_size].ptr = c;
- lines_info[lines_info_size].level = linelevel;
- lines_info_size++;
-next_line:
- c = c9 + 1;
- }
-
- /* Analyze lines */
-
- int i;
- char prevlevel = 0;
- int oopsstart = -1;
- int inbacktrace = 0;
-
- i = 0;
- while (i < lines_info_size)
- {
- char *curline = lines_info[i].ptr;
-
- if (curline == NULL)
- {
- i++;
- continue;
- }
- while (*curline == ' ')
- curline++;
-
- if (oopsstart < 0)
- {
- /* Find start-of-oops markers */
- /* In some comparisons, we skip 1st letter, to avoid dealing with
- * changes in capitalization in kernel. For example, I see that
- * current kernel git (at 2011-01-01) has both "kernel BUG at ..."
- * and "Kernel BUG at ..." messages, and I don't want to change
- * the code below whenever kernel is changed to use "K" (or "k")
- * uniformly.
- */
- if (strstr(curline, /*g*/ "eneral protection fault:"))
- oopsstart = i;
- else if (strstr(curline, "BUG:"))
- oopsstart = i;
- else if (strstr(curline, /*k*/ "ernel BUG at"))
- oopsstart = i;
- /* WARN_ON() generated message */
- else if (strstr(curline, "WARNING: at "))
- oopsstart = i;
- else if (strstr(curline, /*u*/ "nable to handle kernel"))
- oopsstart = i;
- else if (strstr(curline, /*d*/ "ouble fault:"))
- oopsstart = i;
- else if (strstr(curline, "do_IRQ: stack overflow:"))
- oopsstart = i;
- else if (strstr(curline, "RTNL: assertion failed"))
- oopsstart = i;
- else if (strstr(curline, /*e*/ "eek! page_mapcount(page) went negative!"))
- oopsstart = i;
- else if (strstr(curline, /*n*/ "ear stack overflow (cur:"))
- oopsstart = i;
- else if (strstr(curline, /*b*/ "adness at"))
- oopsstart = i;
- else if (strstr(curline, "NETDEV WATCHDOG"))
- oopsstart = i;
- else if (strstr(curline, /*s*/ "ysctl table check failed"))
- oopsstart = i;
- else if (strstr(curline, "INFO: possible recursive locking detected"))
- oopsstart = i;
- // Not needed: "--[ cut here ]--" is always followed
- // by "Badness at", "kernel BUG at", or "WARNING: at" string
- //else if (strstr(curline, "------------[ cut here ]------------"))
- // oopsstart = i;
- else if (strstr(curline, "list_del corruption"))
- oopsstart = i;
- else if (strstr(curline, "list_add corruption"))
- oopsstart = i;
- /* "irq NN: nobody cared..." */
- else if (strstr(curline, ": nobody cared"))
- oopsstart = i;
- else if (strstr(curline, "IRQ handler type mismatch"))
- oopsstart = i;
-
- if (oopsstart >= 0)
- {
- /* debug information */
- VERB3 {
- log("Found oops at line %d: '%s'", oopsstart, lines_info[oopsstart].ptr);
- if (oopsstart != i)
- log("Trigger line is %d: '%s'", i, c);
- }
- /* try to find the end marker */
- int i2 = i + 1;
- while (i2 < lines_info_size && i2 < (i+50))
- {
- if (strstr(lines_info[i2].ptr, "---[ end trace"))
- {
- inbacktrace = 1;
- i = i2;
- break;
- }
- i2++;
- }
- }
- }
-
- /* Are we entering a call trace part? */
- /* a call trace starts with "Call Trace:" or with the " [<.......>] function+0xFF/0xAA" pattern */
- if (oopsstart >= 0 && !inbacktrace)
- {
- if (strstr(curline, "Call Trace:"))
- inbacktrace = 1;
- else
- if (strnlen(curline, 9) > 8
- && curline[0] == '[' && curline[1] == '<'
- && strstr(curline, ">]")
- && strstr(curline, "+0x")
- && strstr(curline, "/0x")
- ) {
- inbacktrace = 1;
- }
- }
-
- /* Are we at the end of an oops? */
- else if (oopsstart >= 0 && inbacktrace)
- {
- int oopsend = INT_MAX;
-
- /* line needs to start with " [" or have "] [" if it is still a call trace */
- /* example: "[<ffffffffa006c156>] radeon_get_ring_head+0x16/0x41 [radeon]" */
- if (curline[0] != '['
- && !strstr(curline, "] [")
- && !strstr(curline, "--- Exception")
- && !strstr(curline, "LR =")
- && !strstr(curline, "<#DF>")
- && !strstr(curline, "<IRQ>")
- && !strstr(curline, "<EOI>")
- && !strstr(curline, "<<EOE>>")
- && strncmp(curline, "Code: ", 6) != 0
- && strncmp(curline, "RIP ", 4) != 0
- && strncmp(curline, "RSP ", 4) != 0
- ) {
- oopsend = i-1; /* not a call trace line */
- }
- /* oops lines are always more than 8 chars long */
- else if (strnlen(curline, 8) < 8)
- oopsend = i-1;
- /* single oopses are of the same loglevel */
- else if (lines_info[i].level != prevlevel)
- oopsend = i-1;
- else if (strstr(curline, "Instruction dump:"))
- oopsend = i;
- /* if a new oops starts, this one has ended */
- else if (strstr(curline, "WARNING: at ") && oopsstart != i) /* WARN_ON() generated message */
- oopsend = i-1;
- else if (strstr(curline, "Unable to handle") && oopsstart != i)
- oopsend = i-1;
- /* kernel end-of-oops marker (not including marker itself) */
- else if (strstr(curline, "---[ end trace"))
- oopsend = i-1;
-
- if (oopsend <= i)
- {
- VERB3 log("End of oops at line %d (%d): '%s'", oopsend, i, lines_info[oopsend].ptr);
- record_oops(oops_list, lines_info, oopsstart, oopsend);
- oopsstart = -1;
- inbacktrace = 0;
- }
- }
-
- prevlevel = lines_info[i].level;
- i++;
-
- if (oopsstart >= 0)
- {
- /* Do we have a suspiciously long oops? Cancel it.
- * Bumped from 60 to 80 (see examples/oops_recursive_locking1.test)
- */
- if (i - oopsstart > 80)
- {
- inbacktrace = 0;
- oopsstart = -1;
- VERB3 log("Dropped oops, too long");
- continue;
- }
- if (!inbacktrace && i - oopsstart > 40)
- {
- /*inbacktrace = 0; - already is */
- oopsstart = -1;
- VERB3 log("Dropped oops, too long");
- continue;
- }
- }
- } /* while (i < lines_info_size) */
-
- /* process last oops if we have one */
- if (oopsstart >= 0 && inbacktrace)
- {
- int oopsend = i-1;
- VERB3 log("End of oops at line %d (end of file): '%s'", oopsend, lines_info[oopsend].ptr);
- record_oops(oops_list, lines_info, oopsstart, oopsend);
- }
-
- free(lines_info);
-}
-
-
static bool world_readable_dump = false;
static const char *debug_dumps_dir = ".";
@@ -387,7 +39,7 @@ static void scan_dmesg(GList **oops_list)
*/
char *buffer = xzalloc(16*1024);
syscall(__NR_syslog, 3, buffer, 16*1024 - 1); /* always NUL terminated */
- extract_oopses(oops_list, buffer, strlen(buffer));
+ koops_extract_oopses(oops_list, buffer, strlen(buffer));
free(buffer);
}
@@ -446,7 +98,7 @@ static int scan_syslog_file(GList **oops_list, int fd, struct stat *statbuf, int
if (partial_line_len > 500) /* cap it */
partial_line_len = 500;
- extract_oopses(oops_list, buffer, r);
+ koops_extract_oopses(oops_list, buffer, r);
cur_pos += r;
} while (cur_pos < statbuf->st_size);
diff --git a/tests/koops-parser.at b/tests/koops-parser.at
index f6b2f63..493098b 100644
--- a/tests/koops-parser.at
+++ b/tests/koops-parser.at
@@ -148,3 +148,41 @@ int main(void)
}
]])
+
+AT_TESTFUN([koops_remove_jiffies_timestamp],
+[[
+#include "libabrt.h"
+#include "koops-test.h"
+
+int run_test(const struct test_struct *test)
+{
+ char *oops_jiffies = fread_full(test->filename);
+ char *oops_no_jiffies = fread_full(test->expected_results);
+
+ /* for testing purpose, I will record only one koops */
+ GList *oops_list = NULL;
+ koops_extract_oopses(&oops_list, oops_jiffies, strlen(oops_jiffies));
+
+ if (oops_list && !strcmp((char *)oops_list->data, oops_no_jiffies))
+ return 0;
+
+ log("'%s' \n '%s'", (char *)oops_list->data, oops_no_jiffies);
+
+ return 1;
+}
+
+int main(void)
+{
+ struct test_struct all_same_hashes[] = {
+ { EXAMPLE_PFX"/oops-with-jiffies.test", EXAMPLE_PFX"/oops-with-jiffies.right" },
+ { EXAMPLE_PFX"/oops_recursive_locking1.test", EXAMPLE_PFX"/oops_recursive_locking1-no-jiffies.test"},
+ };
+
+ int ret = 0;
+ for (int i = 0; i < ARRAY_SIZE(all_same_hashes); ++i)
+ ret |= run_test(&all_same_hashes[i]);
+
+ return ret;
+}
+
+]])
--
1.7.9.2.302.g3724c
12 years, 2 months
[PATCH] koops-unit-test: rhbz#789526 write unit test for improving hash calculation
by Nikola Pajkovsky
Signed-off-by: Nikola Pajkovsky <npajkovs(a)redhat.com>
---
examples/hash-gen-same-as-oop6.right | 29 ----------
examples/hash-gen-same-as-oops6.right | 29 ++++++++++
src/include/libabrt.h | 3 +-
src/lib/kernel.c | 90 +++++++++++++++++++++++++++++++
src/plugins/Makefile.am | 3 +-
src/plugins/abrt-action-analyze-oops.c | 91 +-------------------------------
tests/koops-parser.at | 40 ++++++++++++++
7 files changed, 164 insertions(+), 121 deletions(-)
delete mode 100644 examples/hash-gen-same-as-oop6.right
create mode 100644 examples/hash-gen-same-as-oops6.right
diff --git a/examples/hash-gen-same-as-oop6.right b/examples/hash-gen-same-as-oop6.right
deleted file mode 100644
index c22a6aa..0000000
--- a/examples/hash-gen-same-as-oop6.right
+++ /dev/null
@@ -1,29 +0,0 @@
-WARNING: at drivers/misc/lis3lv02d/lis3lv02d.c:213 lis3lv02d_get_pwron_wait+0x8f/0xa0 [lis3lv02d]()
-Hardware name: HP Pavilion dv7 Notebook PC
-device returned spurious data
-Modules linked in: mac80211 brcmutil cfg80211 crc8 cordic hp_wmi(+) sparse_keymap rfkill uvcvideo videodev hid_logitech_dj media v4l2_compat_ioctl32 joydev snd_hda_codec_idt microcode snd_hda_codec_hdmi snd_hda_intel snd_hda_codec snd_hwdep snd_seq snd_seq_device i2c_piix4 k10temp r8169 bcma mii snd_pcm snd_timer snd soundcore snd_page_alloc hp_accel(+) lis3lv02d input_polldev virtio_net kvm_amd kvm uinput sunrpc pata_acpi ata_generic usb_storage pata_atiixp sdhci_pci sdhci mmc_core wmi video radeon ttm drm_kms_helper drm i2c_algo_bit i2c_core
-Pid: 547, comm: modprobe Not tainted 3.2.3-2.fc16.x86_64 #1
-Call Trace:
- [<ffffffff8106dd4f>] warn_slowpath_common+0x7f/0xc0
- [<ffffffff8106de46>] warn_slowpath_fmt+0x46/0x50
- [<ffffffff81329a58>] ? acpi_evaluate_object+0x1e2/0x1f4
- [<ffffffffa024c6ef>] lis3lv02d_get_pwron_wait+0x8f/0xa0 [lis3lv02d]
- [<ffffffffa024cbe7>] lis3lv02d_poweron+0x57/0xc0 [lis3lv02d]
- [<ffffffffa024d5af>] lis3lv02d_init_device+0x16f/0xbc0 [lis3lv02d]
- [<ffffffffa025533d>] lis3lv02d_add+0xdd/0x1d0 [hp_accel]
- [<ffffffff81313492>] acpi_device_probe+0x4e/0x11c
- [<ffffffff813932cc>] driver_probe_device+0x9c/0x300
- [<ffffffff813935db>] __driver_attach+0xab/0xb0
- [<ffffffff81393530>] ? driver_probe_device+0x300/0x300
- [<ffffffff81393530>] ? driver_probe_device+0x300/0x300
- [<ffffffff8139214c>] bus_for_each_dev+0x5c/0x90
- [<ffffffff81392ede>] driver_attach+0x1e/0x20
- [<ffffffff81392ae0>] bus_add_driver+0x1b0/0x2a0
- [<ffffffffa025d000>] ? 0xffffffffa025cfff
- [<ffffffff81393b36>] driver_register+0x76/0x140
- [<ffffffffa025d000>] ? 0xffffffffa025cfff
- [<ffffffff81313cfb>] acpi_bus_register_driver+0x43/0x45
- [<ffffffffa025d01e>] lis3lv02d_init_module+0x1e/0x1000 [hp_accel]
- [<ffffffff81002042>] do_one_initcall+0x42/0x180
- [<ffffffff810ac970>] sys_init_module+0xc0/0x230
- [<ffffffff815e9782>] system_call_fastpath+0x16/0x1b
diff --git a/examples/hash-gen-same-as-oops6.right b/examples/hash-gen-same-as-oops6.right
new file mode 100644
index 0000000..c22a6aa
--- /dev/null
+++ b/examples/hash-gen-same-as-oops6.right
@@ -0,0 +1,29 @@
+WARNING: at drivers/misc/lis3lv02d/lis3lv02d.c:213 lis3lv02d_get_pwron_wait+0x8f/0xa0 [lis3lv02d]()
+Hardware name: HP Pavilion dv7 Notebook PC
+device returned spurious data
+Modules linked in: mac80211 brcmutil cfg80211 crc8 cordic hp_wmi(+) sparse_keymap rfkill uvcvideo videodev hid_logitech_dj media v4l2_compat_ioctl32 joydev snd_hda_codec_idt microcode snd_hda_codec_hdmi snd_hda_intel snd_hda_codec snd_hwdep snd_seq snd_seq_device i2c_piix4 k10temp r8169 bcma mii snd_pcm snd_timer snd soundcore snd_page_alloc hp_accel(+) lis3lv02d input_polldev virtio_net kvm_amd kvm uinput sunrpc pata_acpi ata_generic usb_storage pata_atiixp sdhci_pci sdhci mmc_core wmi video radeon ttm drm_kms_helper drm i2c_algo_bit i2c_core
+Pid: 547, comm: modprobe Not tainted 3.2.3-2.fc16.x86_64 #1
+Call Trace:
+ [<ffffffff8106dd4f>] warn_slowpath_common+0x7f/0xc0
+ [<ffffffff8106de46>] warn_slowpath_fmt+0x46/0x50
+ [<ffffffff81329a58>] ? acpi_evaluate_object+0x1e2/0x1f4
+ [<ffffffffa024c6ef>] lis3lv02d_get_pwron_wait+0x8f/0xa0 [lis3lv02d]
+ [<ffffffffa024cbe7>] lis3lv02d_poweron+0x57/0xc0 [lis3lv02d]
+ [<ffffffffa024d5af>] lis3lv02d_init_device+0x16f/0xbc0 [lis3lv02d]
+ [<ffffffffa025533d>] lis3lv02d_add+0xdd/0x1d0 [hp_accel]
+ [<ffffffff81313492>] acpi_device_probe+0x4e/0x11c
+ [<ffffffff813932cc>] driver_probe_device+0x9c/0x300
+ [<ffffffff813935db>] __driver_attach+0xab/0xb0
+ [<ffffffff81393530>] ? driver_probe_device+0x300/0x300
+ [<ffffffff81393530>] ? driver_probe_device+0x300/0x300
+ [<ffffffff8139214c>] bus_for_each_dev+0x5c/0x90
+ [<ffffffff81392ede>] driver_attach+0x1e/0x20
+ [<ffffffff81392ae0>] bus_add_driver+0x1b0/0x2a0
+ [<ffffffffa025d000>] ? 0xffffffffa025cfff
+ [<ffffffff81393b36>] driver_register+0x76/0x140
+ [<ffffffffa025d000>] ? 0xffffffffa025cfff
+ [<ffffffff81313cfb>] acpi_bus_register_driver+0x43/0x45
+ [<ffffffffa025d01e>] lis3lv02d_init_module+0x1e/0x1000 [hp_accel]
+ [<ffffffff81002042>] do_one_initcall+0x42/0x180
+ [<ffffffff810ac970>] sys_init_module+0xc0/0x230
+ [<ffffffff815e9782>] system_call_fastpath+0x16/0x1b
diff --git a/src/include/libabrt.h b/src/include/libabrt.h
index 3dfaad4..c7d2bae 100644
--- a/src/include/libabrt.h
+++ b/src/include/libabrt.h
@@ -69,7 +69,8 @@ int daemon_is_ok();
char *koops_extract_version(const char *line);
#define kernel_tainted_short abrt_kernel_tainted_short
char *kernel_tainted_short(const char *kernel_bt);
-
+#define koops_hash_str abrt_koops_hash_str
+void koops_hash_str(char hash_str[SHA1_RESULT_LEN*2 + 1], char *oops_buf, const char *oops_ptr);
#ifdef __cplusplus
}
diff --git a/src/lib/kernel.c b/src/lib/kernel.c
index f97572c..25fab21 100644
--- a/src/lib/kernel.c
+++ b/src/lib/kernel.c
@@ -19,6 +19,96 @@
#include "libabrt.h"
+void koops_hash_str(char hash_str[SHA1_RESULT_LEN*2 + 1], char *oops_buf, const char *oops_ptr)
+{
+ // Example of call trace part of oops:
+ // Call Trace:
+ // [<f88e11c7>] ? radeon_cp_resume+0x7d/0xbc [radeon]
+ // [<f88745f8>] ? drm_ioctl+0x1b0/0x225 [drm]
+ // [<f88e114a>] ? radeon_cp_resume+0x0/0xbc [radeon]
+ // [<c049b1c0>] ? vfs_ioctl+0x50/0x69
+ // [<c049b414>] ? do_vfs_ioctl+0x23b/0x247
+ // [<c0460a56>] ? audit_syscall_entry+0xf9/0x123
+ // [<c049b460>] ? sys_ioctl+0x40/0x5c
+ // [<c0403c76>] ? syscall_call+0x7/0xb
+ struct strbuf *kernel_bt = strbuf_new();
+ char *call_trace = strstr(oops_buf, "Call Trace");
+ if (call_trace)
+ {
+ call_trace += sizeof("Call Trace\n");
+ char *end_line = strchr(call_trace, '\n');
+ int i = 0;
+ while (end_line && !*end_line)
+ {
+ char *line = xstrndup(call_trace, end_line - call_trace);
+
+ char *p = skip_whitespace(line);
+ char *end_mem_block = strchr(p, ' ');
+ if (!end_mem_block)
+ error_msg_and_die("no [<mem>] mark");
+
+ end_mem_block = skip_whitespace(end_mem_block);
+
+ char *begin_off_len, *function;
+
+ /* skip symbols prefixed with ? */
+ if (end_mem_block && *end_mem_block == '?')
+ {
+ free(line);
+ goto skip_line;
+ }
+ /* strip out offset +off/len */
+ begin_off_len = strchr(end_mem_block, '+');
+ if (!begin_off_len)
+ error_msg_and_die("'%s'\nno +offset/len at the end of bt", end_mem_block);
+
+ function = xstrndup(end_mem_block, begin_off_len - end_mem_block);
+ strbuf_append_strf(kernel_bt, "%s\n", function);
+ free(line);
+ free(function);
+ if (i == 5)
+ break;
+
+ ++i;
+ skip_line:
+ call_trace += end_line - call_trace + 1;
+ end_line = strchr(call_trace, '\n');
+ if (end_line)
+ ++end_line; /* skip \n */
+ }
+ goto gen_hash;
+ }
+
+ /* Special-case: if the first line is of form:
+ * WARNING: at net/wireless/core.c:614 wdev_cleanup_work+0xe9/0x120 [cfg80211]() (Not tainted)
+ * then hash only "file:line func+ofs/len" part.
+ */
+ if (strncmp(oops_ptr, "WARNING: at ", sizeof("WARNING: at ")-1) == 0)
+ {
+ const char *p = oops_ptr + sizeof("WARNING: at ")-1;
+ p = strchr(p, ' '); /* skip filename:NNN */
+ if (p)
+ {
+ p = strchrnul(p + 1, ' '); /* skip function_name+0xNN/0xNNN */
+ oops_ptr += sizeof("WARNING: at ")-1;
+ while (oops_ptr < p)
+ strbuf_append_char(kernel_bt, *oops_ptr++);
+ }
+ }
+
+gen_hash: ;
+
+ char hash_bytes[SHA1_RESULT_LEN];
+ sha1_ctx_t sha1ctx;
+ sha1_begin(&sha1ctx);
+ sha1_hash(&sha1ctx, kernel_bt->buf, kernel_bt->len);
+ sha1_end(&sha1ctx, hash_bytes);
+ strbuf_free(kernel_bt);
+
+ bin2hex(hash_str, hash_bytes, SHA1_RESULT_LEN)[0] = '\0';
+ VERB3 log("hash: %s", hash_str);
+}
+
char *koops_extract_version(const char *linepointer)
{
if (strstr(linepointer, "Pid")
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
index 5edbd3e..e922f61 100644
--- a/src/plugins/Makefile.am
+++ b/src/plugins/Makefile.am
@@ -119,7 +119,8 @@ abrt_action_analyze_oops_CPPFLAGS = \
-D_GNU_SOURCE \
-Wall -Wwrite-strings -Werror
abrt_action_analyze_oops_LDADD = \
- $(LIBREPORT_LIBS)
+ $(LIBREPORT_LIBS) \
+ ../lib/libabrt.la
abrt_action_trim_files_SOURCES = \
abrt-action-trim-files.c
diff --git a/src/plugins/abrt-action-analyze-oops.c b/src/plugins/abrt-action-analyze-oops.c
index f7d223b..3eb0a61 100644
--- a/src/plugins/abrt-action-analyze-oops.c
+++ b/src/plugins/abrt-action-analyze-oops.c
@@ -18,95 +18,6 @@
*/
#include "libabrt.h"
-static void hash_oops_str(char hash_str[SHA1_RESULT_LEN*2 + 1], char *oops_buf, const char *oops_ptr)
-{
- // Example of call trace part of oops:
- // Call Trace:
- // [<f88e11c7>] ? radeon_cp_resume+0x7d/0xbc [radeon]
- // [<f88745f8>] ? drm_ioctl+0x1b0/0x225 [drm]
- // [<f88e114a>] ? radeon_cp_resume+0x0/0xbc [radeon]
- // [<c049b1c0>] ? vfs_ioctl+0x50/0x69
- // [<c049b414>] ? do_vfs_ioctl+0x23b/0x247
- // [<c0460a56>] ? audit_syscall_entry+0xf9/0x123
- // [<c049b460>] ? sys_ioctl+0x40/0x5c
- // [<c0403c76>] ? syscall_call+0x7/0xb
- struct strbuf *kernel_bt = strbuf_new();
- char *call_trace = strstr(oops_buf, "Call Trace");
- if (call_trace)
- {
- call_trace += sizeof("Call Trace\n");
- char *end_line = strchr(call_trace, '\n');
- int i = 0;
- while (end_line && !*end_line)
- {
- char *line = xstrndup(call_trace, end_line - call_trace);
-
- char *p = skip_whitespace(line);
- char *end_mem_block = strchr(p, ' ');
- if (!end_mem_block)
- error_msg_and_die("no [<mem>] mark");
-
- end_mem_block = skip_whitespace(end_mem_block);
-
- char *begin_off_len, *function;
-
- /* skip symbols prefixed with ? */
- if (end_mem_block && *end_mem_block == '?')
- {
- free(line);
- goto skip_line;
- }
- /* strip out offset +off/len */
- begin_off_len = strchr(end_mem_block, '+');
- if (!begin_off_len)
- error_msg_and_die("'%s'\nno +offset/len at the end of bt", end_mem_block);
-
- function = xstrndup(end_mem_block, begin_off_len - end_mem_block);
- strbuf_append_strf(kernel_bt, "%s\n", function);
- free(line);
- free(function);
- if (i == 5)
- break;
-
- ++i;
- skip_line:
- call_trace += end_line - call_trace + 1;
- end_line = strchr(call_trace, '\n');
- if (end_line)
- ++end_line; /* skip \n */
- }
- goto gen_hash;
- }
-
- /* Special-case: if the first line is of form:
- * WARNING: at net/wireless/core.c:614 wdev_cleanup_work+0xe9/0x120 [cfg80211]() (Not tainted)
- * then hash only "file:line func+ofs/len" part.
- */
- if (strncmp(oops_ptr, "WARNING: at ", sizeof("WARNING: at ")-1) == 0)
- {
- const char *p = oops_ptr + sizeof("WARNING: at ")-1;
- p = strchr(p, ' '); /* skip filename:NNN */
- if (p)
- {
- p = strchrnul(p + 1, ' '); /* skip function_name+0xNN/0xNNN */
- oops_ptr += sizeof("WARNING: at ")-1;
- while (oops_ptr < p)
- strbuf_append_char(kernel_bt, *oops_ptr++);
- }
- }
-
-gen_hash: ;
-
- char hash_bytes[SHA1_RESULT_LEN];
- sha1_ctx_t sha1ctx;
- sha1_begin(&sha1ctx);
- sha1_hash(&sha1ctx, kernel_bt->buf, kernel_bt->len);
- sha1_end(&sha1ctx, hash_bytes);
- strbuf_free(kernel_bt);
-
- bin2hex(hash_str, hash_bytes, SHA1_RESULT_LEN)[0] = '\0';
- VERB3 log("hash: %s", hash_str);
-}
int main(int argc, char **argv)
{
@@ -147,7 +58,7 @@ int main(int argc, char **argv)
char *oops = dd_load_text(dd, FILENAME_BACKTRACE);
char hash_str[SHA1_RESULT_LEN*2 + 1];
- hash_oops_str(hash_str, oops, oops);
+ koops_hash_str(hash_str, oops, oops);
free(oops);
dd_save_text(dd, FILENAME_UUID, hash_str);
diff --git a/tests/koops-parser.at b/tests/koops-parser.at
index d2c1e6d..f6b2f63 100644
--- a/tests/koops-parser.at
+++ b/tests/koops-parser.at
@@ -108,3 +108,43 @@ int main(void)
return ret;
}
]])
+
+AT_TESTFUN([koops_hash_improve],
+[[
+#include "libabrt.h"
+#include "koops-test.h"
+
+int run_test(const struct test_struct *test)
+{
+ char *oops1 = fread_full(test->filename);
+ char *oops2 = fread_full(test->expected_results);
+
+ char hash_oops1[SHA1_RESULT_LEN*2 + 1];
+ koops_hash_str(hash_oops1, oops1, oops1);
+
+ char hash_oops2[SHA1_RESULT_LEN*2 + 1];
+ koops_hash_str(hash_oops2, oops2, oops2);
+
+ if (!strcmp(hash_oops1, hash_oops2))
+ return 0;
+
+ log("'%s' != '%s'", hash_oops1, hash_oops2);
+
+ return 1;
+}
+
+int main(void)
+{
+ struct test_struct all_same_hashes[] = {
+ { EXAMPLE_PFX"/oops4.right", EXAMPLE_PFX"/oops-same-as-oops4.right" },
+ { EXAMPLE_PFX"/hash-gen-oops6.right", EXAMPLE_PFX"/hash-gen-same-as-oops6.right" },
+ };
+
+ int ret = 0;
+ for (int i = 0; i < ARRAY_SIZE(all_same_hashes); ++i)
+ ret |= run_test(&all_same_hashes[i]);
+
+ return ret;
+}
+
+]])
--
1.7.9.2.302.g3724c
12 years, 2 months
[PATCH] koops-unit-test: test refactorization
by Nikola Pajkovsky
Signed-off-by: Nikola Pajkovsky <npajkovs(a)redhat.com>
---
tests/koops-parser.at | 26 ++++++++------------------
tests/koops-test.h | 18 ++++++++++++++++++
2 files changed, 26 insertions(+), 18 deletions(-)
diff --git a/tests/koops-parser.at b/tests/koops-parser.at
index 6c726b5..d2c1e6d 100644
--- a/tests/koops-parser.at
+++ b/tests/koops-parser.at
@@ -33,9 +33,9 @@ int main(void)
{
/* tests run in abrt/tests/testsuite.dir/X, where X is test number */
struct test_struct test[] = {
- {"../../../examples/cut_here.right", "2.6.32-19.el6.x86_64"},
- {"../../../examples/oops-kernel-3.x.x", "3.0.0-3.fc16.i686.PAE"},
- {"../../../examples/koops-tainted-gw", "3.1.0-0.rc9.git0.0.fc16.x86_64"},
+ { EXAMPLE_PFX"/cut_here.right", "2.6.32-19.el6.x86_64" },
+ { EXAMPLE_PFX"/oops-kernel-3.x.x", "3.0.0-3.fc16.i686.PAE" },
+ { EXAMPLE_PFX"/koops-tainted-gw", "3.1.0-0.rc9.git0.0.fc16.x86_64"},
};
int ret = 0;
@@ -58,17 +58,7 @@ enum {
int run_test(const struct test_struct *test, int flags)
{
- FILE *fp = xfopen_ro(test->filename);
-
- fseek(fp, 0, SEEK_END);
- off_t size = ftell(fp);
- fseek(fp, 0, SEEK_SET);
-
- char *koops_bt = xzalloc(size + 1);
- int r = fread(koops_bt, sizeof(char), size, fp);
- fclose(fp);
- if (r < 0)
- perror_msg_and_die("Can't read '%s'", test->filename);
+ char *koops_bt = fread_full(test->filename);
char *tnt = kernel_tainted_short(koops_bt);
free(koops_bt);
@@ -97,13 +87,13 @@ int main(void)
{
/* tests run in abrt/tests/testsuite.dir/X, where X is test number */
struct test_struct not_tainted[] = {
- {"../../../examples/oops1.right", NULL},
+ { EXAMPLE_PFX"/oops1.right", NULL},
};
struct test_struct tainted[] = {
- {"../../../examples/koops-tainted-bg1", "G B "},
- {"../../../examples/oops-same-as-oops4.right", "P "},
- {"../../../examples/koops-tainted-gw", NULL},
+ { EXAMPLE_PFX"/koops-tainted-bg1", "G B " },
+ { EXAMPLE_PFX"/oops-same-as-oops4.right", "P " },
+ { EXAMPLE_PFX"/koops-tainted-gw", NULL },
};
log("test not tainted");
diff --git a/tests/koops-test.h b/tests/koops-test.h
index fee7229..53787aa 100644
--- a/tests/koops-test.h
+++ b/tests/koops-test.h
@@ -18,6 +18,8 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#define EXAMPLE_PFX "../../../examples"
+
struct test_struct {
const char *filename;
const char *expected_results;
@@ -31,3 +33,19 @@ static inline FILE *xfopen_ro(const char *filename)
return fp;
}
+
+static inline char *fread_full(const char *filenamep)
+{
+ FILE *fp = xfopen_ro(filenamep);
+
+ fseek(fp, 0, SEEK_END);
+ off_t size = ftell(fp);
+ fseek(fp, 0, SEEK_SET);
+ char *koops_bt = xzalloc(size + 1);
+ int r = fread(koops_bt, sizeof(char), size, fp);
+ fclose(fp);
+ if (r < 0)
+ perror_msg_and_die("Can't read '%s'", filenamep);
+
+ return koops_bt;
+}
--
1.7.9.2.302.g3724c
12 years, 2 months
[PATCH] dump-oops: fix removing jiffies time stamp
by Nikola Pajkovsky
jiffies are unsigned long, so it can be 2^64 long, which is
20 decimal digits
Signed-off-by: Nikola Pajkovsky <npajkovs(a)redhat.com>
---
examples/oops-with-jiffies.right | 23 +++++++++++++++++++++++
src/plugins/abrt-dump-oops.c | 6 ++++--
2 files changed, 27 insertions(+), 2 deletions(-)
create mode 100644 examples/oops-with-jiffies.right
diff --git a/examples/oops-with-jiffies.right b/examples/oops-with-jiffies.right
new file mode 100644
index 0000000..7bcc728
--- /dev/null
+++ b/examples/oops-with-jiffies.right
@@ -0,0 +1,23 @@
+[178856.137422] WARNING: at /builddir/build/BUILD/kernel-3.2.fc16/compat-wireless-3.3-rc1-2/include/net/mac80211.h:3618 rate_control_send_low+0x23e/0x250 [mac80211]()
+[178856.137437] Hardware name: 4177CTO
+[178856.137438] Modules linked in: usb_storage tcp_lp ppdev parport_pc lp parport fuse ipt_MASQUERADE iptable_nat nf_nat xt_CHECKSUM be2iscsi iscsi_boot_sysfs bnx2i iptable_mangle cnic uio cxgb4i cxgb4 cxgb3i bridge stp llc libcxgbi cxgb3 mdio ib_iser rdma_cm ib_cm iw_cm ib_sa ib_mad ib_core ib_addr iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi ip6t_REJECT nf_conntrack_ipv4 nf_conntrack_ipv6 nf_defrag_ipv6 nf_defrag_ipv4 xt_state ip6table_filter nf_conntrack ip6_tables sha256_generic dm_crypt snd_hda_codec_hdmi snd_hda_codec_conexant snd_hda_intel snd_hda_codec snd_hwdep arc4 vhost_net macvtap macvlan tun snd_seq snd_seq_device virtio_net snd_pcm kvm_intel snd_timer kvm thinkpad_acpi iwlwifi snd mac80211 e1000e tpm_tis tpm tpm_bios nfsd lockd snd_page_alloc soundcore cfg80211 rfkill nfs_acl auth_rpcgss i2c_i801 sunrpc uinput joydev iTCO_wdt iTCO_vendor_support microcode firewire_ohci firewire_core crc_itu_t sdhci_pci sdhci mmc_core wmi i915 drm_kms_helper drm i2c_alg!
o_bit i2
+c_core video [last unloaded: scsi_wait_scan]
+[178856.137482] Pid: 22695, comm: ksoftirqd/2 Not tainted 3.2.5-3.fc16.x86_64 #1
+[178856.137484] Call Trace:
+[178856.137490] [<ffffffff8106dd4f>] warn_slowpath_common+0x7f/0xc0
+[178856.137493] [<ffffffff8106ddaa>] warn_slowpath_null+0x1a/0x20
+[178856.137500] [<ffffffffa02a344e>] rate_control_send_low+0x23e/0x250 [mac80211]
+[178856.137506] [<ffffffffa0336d15>] rs_get_rate+0x65/0x1d0 [iwlwifi]
+[178856.137513] [<ffffffffa02a37c6>] rate_control_get_rate+0x96/0x170 [mac80211]
+[178856.137522] [<ffffffffa02af59f>] invoke_tx_handlers+0x6ff/0x13e0 [mac80211]
+[178856.137528] [<ffffffffa028edac>] ? sta_info_get+0x6c/0x80 [mac80211]
+[178856.137536] [<ffffffffa02b03d0>] ieee80211_tx+0x60/0xc0 [mac80211]
+[178856.137543] [<ffffffffa02b1352>] ieee80211_tx_pending+0x162/0x270 [mac80211]
+[178856.137546] [<ffffffff81074d18>] tasklet_action+0x78/0x140
+[178856.137548] [<ffffffff81075378>] __do_softirq+0xb8/0x230
+[178856.137550] [<ffffffff810755aa>] run_ksoftirqd+0xba/0x170
+[178856.137552] [<ffffffff810754f0>] ? __do_softirq+0x230/0x230
+[178856.137556] [<ffffffff8108fb9c>] kthread+0x8c/0xa0
+[178856.137559] [<ffffffff815eb8f4>] kernel_thread_helper+0x4/0x10
+[178856.137561] [<ffffffff8108fb10>] ? kthread_worker_fn+0x190/0x190
+[178856.137563] [<ffffffff815eb8f0>] ? gs_change+0x13/0x13
diff --git a/src/plugins/abrt-dump-oops.c b/src/plugins/abrt-dump-oops.c
index 1722843..006c801 100644
--- a/src/plugins/abrt-dump-oops.c
+++ b/src/plugins/abrt-dump-oops.c
@@ -148,12 +148,14 @@ static void extract_oopses(GList **oops_list, char *buffer, size_t buflen)
linelevel = c[1];
c += 3;
}
- /* remove jiffies time stamp counter if present */
+ /* remove jiffies time stamp counter if present
+ * jiffies are unsigned long, so it can be 2^64 long, which is
+ * 20 decimal digits*/
if (*c == '[')
{
char *c2 = strchr(c, '.');
char *c3 = strchr(c, ']');
- if (c2 && c3 && (c2 < c3) && (c3-c) < 14 && (c2-c) < 8)
+ if (c2 && c3 && (c2 < c3) && (c3-c) < 21 && (c2-c) < 8)
{
c = c3 + 1;
if (*c == ' ')
--
1.7.9.1.244.gb0d66b
12 years, 2 months
[PATCH] bugzilla: exclude appending package name for kernel oops
by Nikola Pajkovsky
Signed-off-by: Nikola Pajkovsky <npajkovs(a)redhat.com>
---
src/plugins/rhbz.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/plugins/rhbz.c b/src/plugins/rhbz.c
index 991b1cb..32b61dc 100644
--- a/src/plugins/rhbz.c
+++ b/src/plugins/rhbz.c
@@ -420,7 +420,11 @@ int rhbz_new_bug(struct abrt_xmlrpc *ax, problem_data_t *problem_data,
}
else
{
- strbuf_append_strf(buf_summary, "[abrt] %s", package);
+ if (analyzer && !strcmp(analyzer, "Kerneloops"))
+ strbuf_append_str(buf_summary, "[abrt]");
+ else
+ strbuf_append_strf(buf_summary, "[abrt] %s", package);
+
if (function && strlen(function) < 30)
strbuf_append_strf(buf_summary, ": %s", function);
--
1.7.9.1.244.gb0d66b
12 years, 2 months
Fwd: [PATCH] use suided helper to install vmcore debuginfo
by Jiri Moskovcak
This patch makes the a-a-analyze-vmcore to use the suided helper
abrt-action-debuginfo-install-to-abrt-cache to install vmcore debuginfo
to /var/cache/abrt-di. Please note that the minor-fix.path is meant for
libreport. Run-tested, please review.
Thank you,
Jirka
12 years, 2 months
[PATCH] use remote result as first dup-hash
by Nikola Pajkovsky
Signed-off-by: Nikola Pajkovsky <npajkovs(a)redhat.com>
---
src/plugins/reporter-bugzilla.c | 24 +++++++++++++++++++++++-
1 files changed, 23 insertions(+), 1 deletions(-)
diff --git a/src/plugins/reporter-bugzilla.c b/src/plugins/reporter-bugzilla.c
index ee0da0f..b1d7fa1 100644
--- a/src/plugins/reporter-bugzilla.c
+++ b/src/plugins/reporter-bugzilla.c
@@ -44,6 +44,27 @@ static void set_settings(struct bugzilla_struct *b, map_string_h *settings)
b->b_release = environ ? environ : get_map_string_item_or_NULL(settings, "OSRelease");
}
+/* caller is responsible to free returned value */
+static char *get_duphash(problem_data_t *problem_data)
+{
+ char *remote_result;
+ remote_result = xstrdup(get_problem_item_content_or_NULL(problem_data, FILENAME_REMOTE_RESULT));
+ char *duphash = xstrdup(get_problem_item_content_or_NULL(problem_data, FILENAME_DUPHASH));
+ if (!remote_result || !*remote_result)
+ return duphash;
+
+ char *line_tok = strtok(remote_result, "\n");
+ while (line_tok)
+ {
+ if (!prefixcmp(line_tok, "DUPLICATE "))
+ return line_tok + strlen("DUPLICATE ");
+
+ line_tok = strtok(NULL, "\n");
+ }
+
+ return duphash;
+}
+
int main(int argc, char **argv)
{
abrt_init(argv);
@@ -262,7 +283,8 @@ int main(int argc, char **argv)
xfunc_die(); /* create_problem_data_for_reporting already emitted error msg */
const char *component = get_problem_item_content_or_die(problem_data, FILENAME_COMPONENT);
- const char *duphash = get_problem_item_content_or_NULL(problem_data, FILENAME_DUPHASH);
+ const char *duphash = get_duphash(problem_data);
+
//COMPAT, remove after 2.1 release
if (!duphash) duphash = get_problem_item_content_or_die(problem_data, "global_uuid");
if (!rhbz.b_release || !*rhbz.b_release) /* if not overridden or empty... */
--
1.7.9.rc2
12 years, 2 months
[PATCH] move debuginfo downloader to report client
by Jiri Moskovcak
This is just a preparatory patch for converting a-a-a-vmcore to python
and make it use the same debuginfo downloading code as we use for C/C++
crashes. Run tested, please review and test.
Thank you,
Jirka
12 years, 2 months
[[PATCH-LIBREPORT] 1/4] do not scare people with XML-RPC's error codes
by Nikola Pajkovsky
Signed-off-by: Nikola Pajkovsky <npajkovs(a)redhat.com>
---
src/lib/abrt_xmlrpc.c | 4 ++--
src/plugins/reporter-bugzilla.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/lib/abrt_xmlrpc.c b/src/lib/abrt_xmlrpc.c
index 1741445..8bd63c8 100644
--- a/src/lib/abrt_xmlrpc.c
+++ b/src/lib/abrt_xmlrpc.c
@@ -22,12 +22,12 @@
void abrt_xmlrpc_die(xmlrpc_env *env)
{
- error_msg_and_die("fatal: XML-RPC(%d): %s", env->fault_code, env->fault_string);
+ error_msg_and_die("fatal: %s", env->fault_string);
}
void abrt_xmlrpc_error(xmlrpc_env *env)
{
- error_msg("error: XML-RPC (%d): %s", env->fault_code, env->fault_string);
+ error_msg("error: %s", env->fault_string);
}
struct abrt_xmlrpc *abrt_xmlrpc_new_client(const char *url, int ssl_verify)
diff --git a/src/plugins/reporter-bugzilla.c b/src/plugins/reporter-bugzilla.c
index bc1ff69..cf33d5e 100644
--- a/src/plugins/reporter-bugzilla.c
+++ b/src/plugins/reporter-bugzilla.c
@@ -116,7 +116,7 @@ int main(int argc, char **argv)
xmlrpc_env_init(&env);
xmlrpc_client_setup_global_const(&env);
if (env.fault_occurred)
- error_msg_and_die("XML-RPC Fault: %s(%d)", env.fault_string, env.fault_code);
+ abrt_xmlrpc_die(&env);
xmlrpc_env_clean(&env);
const char *environ;
--
1.7.9.rc2
12 years, 2 months