[PATCH] ureport: always include offset
by Michal Toman
---
src/lib/json.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/lib/json.c b/src/lib/json.c
index cd30575..bd54a2d 100644
--- a/src/lib/json.c
+++ b/src/lib/json.c
@@ -146,8 +146,8 @@ static void ureport_add_core_backtrace(struct json_object *ur, problem_data_t *p
if (aux->fingerprint)
ureport_add_str(item, "funchash", aux->fingerprint);
- if ((uintmax_t)frame->address)
- ureport_add_int(item, "offset", (uintmax_t)frame->address);
+ /* always add offset - even offset 0 is valid */
+ ureport_add_int(item, "offset", (uintmax_t)frame->address);
ureport_add_int(item, "frame", frame_nr++);
ureport_add_int(item, "thread", 0);
--
1.7.1
11 years, 7 months
[LIBREPORT PATCH] rhbz#859422: report-gtk: rework forbidden words highlighting
by Jakub Filak
Signed-off-by: Jakub Filak <jfilak(a)redhat.com>
---
src/gui-wizard-gtk/wizard.c | 245 ++++++++++++++++++++++++++++++++------------
1 file changed, 182 insertions(+), 63 deletions(-)
diff --git a/src/gui-wizard-gtk/wizard.c b/src/gui-wizard-gtk/wizard.c
index ab6d01a..94cc63d 100644
--- a/src/gui-wizard-gtk/wizard.c
+++ b/src/gui-wizard-gtk/wizard.c
@@ -2013,16 +2013,147 @@ static void log_ready_state(void)
}
#endif
-static gboolean highligh_word_in_tabs(const char *search_word, int flags)
+static int compare_search_item(gconstpointer a, gconstpointer b)
{
- gboolean found = false;
- GtkTextBuffer *buffer;
+ const search_item_t *lhs = a;
+ const search_item_t *rhs = b;
+ return gtk_text_iter_compare(&(lhs->start), &(rhs->start));
+}
+
+static bool highligh_words_in_textview(int page, GtkTextView *tev, GList *words, int flags)
+{
+ GtkTextBuffer *buffer = gtk_text_view_get_buffer(tev);
+ gtk_text_buffer_set_modified(buffer, FALSE);
+
GtkTextIter start_find;
- GtkTextIter end_find;
+ gtk_text_buffer_get_start_iter(buffer, &start_find);
+
+ int bufferpos = -1;
+ GList *after_buffer = NULL;
+
+ if (flags & CLEAR_PREVIOUS_RESULT)
+ {
+ int allwordspos = 0;
+ int bufferwords = 0;
+ for (GList* item = g_search_result_list; item; ++allwordspos)
+ {
+ GList* current = item;
+ item = g_list_next(item);
+
+ search_item_t *word = (search_item_t *)current->data;
+ if (word->buffer == buffer)
+ {
+ ++bufferwords;
+
+ if (allwordspos < g_current_highlighted_word)
+ ++bufferpos;
+
+ g_search_result_list = g_list_delete_link(g_search_result_list, current);
+ free(word);
+ }
+ else if(after_buffer == NULL && bufferwords != 0)
+ after_buffer = current;
+ }
+
+ GtkTextIter end_find;
+ gtk_text_buffer_get_end_iter(buffer, &end_find);
+
+ gtk_text_buffer_remove_tag_by_name(buffer, "search_result_bg", &start_find, &end_find);
+ gtk_text_buffer_remove_tag_by_name(buffer, "current_result_bg", &start_find, &end_find);
+ }
+
GtkTextIter start_match;
GtkTextIter end_match;
+ int found = 0;
+ GList *result = NULL;
+ for (GList *w = words; w; w = g_list_next(w))
+ {
+ gtk_text_buffer_get_start_iter(buffer, &start_find);
+
+ const char *search_word = w->data;
+ while (search_word && search_word[0] && gtk_text_iter_forward_search(&start_find, search_word,
+ GTK_TEXT_SEARCH_TEXT_ONLY,
+ &start_match,
+ &end_match, NULL))
+ {
+ ++found;
+
+ search_item_t * found_word = (search_item_t *)xmalloc(sizeof(search_item_t));
+ found_word->start = start_match;
+ found_word->end = end_match;
+ found_word->buffer = buffer;
+ found_word->tev = tev;
+ found_word->page = page;
+ result = g_list_prepend(result, found_word);
+
+ gtk_text_buffer_apply_tag_by_name(buffer, "search_result_bg",
+ &start_match, &end_match);
+ int offset = gtk_text_iter_get_offset(&end_match);
+ gtk_text_buffer_get_iter_at_offset(buffer, &start_find, offset);
+ }
+ }
+
+ if (found)
+ {
+ /* The current order of the found words is defined by order of words in the
+ * passed list. We have to order the words according to their occurrence in
+ * the buffer.
+ */
+ result = g_list_sort(result, compare_search_item);
+
+ /* Put words of the buffer at the correct place */
+ if (after_buffer == g_search_result_list)
+ {
+ /*
+ * The original list:
+ * (buffer, after buffer)
+ */
+ g_search_result_list = g_list_concat(result, after_buffer);
+ }
+ else
+ {
+ /*
+ * The original:
+ * (before buffer, buffer, after buffer)
+ * After removing buffer's words:
+ * (before buffer, after buffer)
+ */
+ if (after_buffer && after_buffer->prev)
+ {
+ /* split to two lists (before buffer) and (after buffer) */
+ after_buffer->prev->next = NULL;
+ after_buffer->prev = NULL;
+ }
+
+ /* create (before buffer, buffer) */
+ g_search_result_list = g_list_concat(g_search_result_list, result);
+
+ if (after_buffer)
+ /* create (before buffer, buffer, after buffer) */
+ g_search_result_list = g_list_concat(g_search_result_list, after_buffer);
+ }
+ }
+
+ if (flags & CLEAR_PREVIOUS_RESULT)
+ {
+ /* The bufferpos variable greater than 0 means that current word was in
+ * the buffer or the currently highlighted word was after all buffer's
+ * words, therefore we have to decrease the index of the currently
+ * highlighted word. If any word was found the highlighting process
+ * will start from the beginning of the buffer. If no word was found
+ * the currently highlighted word will be the first word in a next buffer.
+ */
+ if (bufferpos >= 0)
+ g_current_highlighted_word -= (bufferpos + (found == 0));
+ }
+
+ return found;
+}
+
+static gboolean highligh_words_in_tabs(GList *words, int flags)
+{
+ gboolean found = false;
PangoAttrList *attrs;
- int offset = 0;
if (flags & CLEAR_PREVIOUS_RESULT)
{
@@ -2038,16 +2169,14 @@ static gboolean highligh_word_in_tabs(const char *search_word, int flags)
{
//notebook_page->scrolled_window->text_view
GtkWidget *notebook_child = gtk_notebook_get_nth_page(g_notebook, page);
- GtkTextView *tev = GTK_TEXT_VIEW(gtk_bin_get_child(GTK_BIN(notebook_child)));
- buffer = gtk_text_view_get_buffer(tev);
- gtk_text_buffer_get_start_iter(buffer, &start_find);
- gtk_text_buffer_get_end_iter(buffer, &end_find);
GtkWidget *tab_lbl = gtk_notebook_get_tab_label(g_notebook, notebook_child);
- //reset previous results
+
+ if (strncmp(gtk_label_get_text(GTK_LABEL(tab_lbl)), "page 1", 5) == 0)
+ continue;
+
+ //reset previous results
if (flags & CLEAR_PREVIOUS_RESULT)
{
- gtk_text_buffer_remove_tag_by_name(buffer, "search_result_bg", &start_find, &end_find);
- gtk_text_buffer_remove_tag_by_name(buffer, "current_result_bg", &start_find, &end_find);
attrs = gtk_label_get_attributes(GTK_LABEL(tab_lbl));
gtk_label_set_attributes(GTK_LABEL(tab_lbl), NULL);
pango_attr_list_unref(attrs); //If the result is zero, free the attribute list and the attributes it contains.
@@ -2063,46 +2192,22 @@ static gboolean highligh_word_in_tabs(const char *search_word, int flags)
free(lbl);
*/
- bool lbl_set = false;
+ GtkTextView *tev = GTK_TEXT_VIEW(gtk_bin_get_child(GTK_BIN(notebook_child)));
+ found = highligh_words_in_textview(page, tev, words, flags);
- if (strncmp(gtk_label_get_text(GTK_LABEL(tab_lbl)), "page 1", 5) == 0)
+ if (found)
{
- continue;
- }
-
- while (search_word && search_word[0] && gtk_text_iter_forward_search(&start_find, search_word,
- GTK_TEXT_SEARCH_TEXT_ONLY,
- &start_match,
- &end_match, NULL))
- {
- search_item_t * found_word = (search_item_t *)xmalloc(sizeof(search_item_t));
- found_word->start = start_match;
- found_word->end = end_match;
- found_word->buffer = buffer;
- found_word->tev = tev;
- found_word->page = page;
- g_search_result_list = g_list_append(g_search_result_list, found_word);
- found = true;
- if (!lbl_set)
- {
- attrs = pango_attr_list_new();
- PangoAttribute *foreground_attr = pango_attr_foreground_new(65535, 0, 0);
- pango_attr_list_insert(attrs, foreground_attr);
- gtk_label_set_attributes(GTK_LABEL(tab_lbl), attrs);
-
- /* adds * instead of changing color - usable for gtk < 2.8 */
- /*
- char *found_lbl = xasprintf("*%s", gtk_label_get_text(GTK_LABEL(tab_lbl)));
- gtk_label_set_text(GTK_LABEL(tab_lbl), found_lbl);
- free(found_lbl);
- */
-
- lbl_set = true;
- }
- gtk_text_buffer_apply_tag_by_name(buffer, "search_result_bg",
- &start_match, &end_match);
- offset = gtk_text_iter_get_offset(&end_match);
- gtk_text_buffer_get_iter_at_offset(buffer, &start_find, offset);
+ attrs = pango_attr_list_new();
+ PangoAttribute *foreground_attr = pango_attr_foreground_new(65535, 0, 0);
+ pango_attr_list_insert(attrs, foreground_attr);
+ gtk_label_set_attributes(GTK_LABEL(tab_lbl), attrs);
+
+ /* adds * instead of changing color - usable for gtk < 2.8 */
+ /*
+ char *found_lbl = xasprintf("*%s", gtk_label_get_text(GTK_LABEL(tab_lbl)));
+ gtk_label_set_text(GTK_LABEL(tab_lbl), found_lbl);
+ free(found_lbl);
+ */
}
}
return found;
@@ -2110,19 +2215,11 @@ static gboolean highligh_word_in_tabs(const char *search_word, int flags)
static void highlight_forbidden(void)
{
- gboolean found = false;
GList *forbidden_words = load_forbidden_words();
- GList *cur_word = forbidden_words;
- while (cur_word && ((char *)cur_word->data)[0])
- {
- if(highligh_word_in_tabs((char *)cur_word->data, 0))
- found = true;
- cur_word = g_list_next(cur_word);
- }
- if (found)
- {
+
+ if (highligh_words_in_tabs(forbidden_words, 0))
add_warning(_("Possible sensitive data detected, please review the highlighted tabs carefully."));
- }
+
list_free_with_free(forbidden_words);
}
@@ -2383,13 +2480,26 @@ static void unhighlight_widget(GtkWidget *widget, gpointer *user_data)
gtk_drag_unhighlight(widget);
}
+static void rehighlight_forbidden_words(int page, GtkTextView *tev)
+{
+ GList *forbidden_words = load_forbidden_words();
+ highligh_words_in_textview(page, tev, forbidden_words, CLEAR_PREVIOUS_RESULT);
+ list_free_with_free(forbidden_words);
+
+ /* Don't increment resp. decrement in search_down() resp. search_up() */
+ g_first_highlight = true;
+}
+
static void unhighlight_current_word(void)
{
search_item_t *word = NULL;
word = (search_item_t *)g_list_nth_data(g_search_result_list, g_current_highlighted_word);
if (word)
{
- gtk_text_buffer_remove_tag_by_name(word->buffer, "current_result_bg", &(word->start), &(word->end));
+ if (gtk_text_buffer_get_modified(word->buffer))
+ rehighlight_forbidden_words(word->page, word->tev);
+ else
+ gtk_text_buffer_remove_tag_by_name(word->buffer, "current_result_bg", &(word->start), &(word->end));
}
}
@@ -2399,6 +2509,13 @@ static void highlight_current_word(void)
word = (search_item_t *)g_list_nth_data(g_search_result_list, g_current_highlighted_word);
if (word)
{
+ if (gtk_text_buffer_get_modified(word->buffer))
+ {
+ rehighlight_forbidden_words(word->page, word->tev);
+ highlight_current_word();
+ return;
+ }
+
gtk_notebook_set_current_page(g_notebook, word->page);
gtk_text_buffer_apply_tag_by_name(word->buffer, "current_result_bg", &(word->start), &(word->end));
gtk_text_buffer_place_cursor(word->buffer, &(word->start));
@@ -2436,7 +2553,9 @@ static gboolean highlight_search(gpointer user_data)
VERB1 log("searching: '%s'", gtk_entry_get_text(entry));
- highligh_word_in_tabs(gtk_entry_get_text(entry), CLEAR_PREVIOUS_RESULT);
+ GList *words = g_list_append(NULL, (gpointer)gtk_entry_get_text(entry));
+ highligh_words_in_tabs(words, CLEAR_PREVIOUS_RESULT);
+ g_list_free(words);
/* returning false will make glib to remove this event */
return false;
--
1.7.11.4
11 years, 7 months
tests/runtests/dumpoops/examples.tar ?!
by Denys Vlasenko
Hi Marko,
In my opinion tests/runtests/dumpoops/examples.tar
file, which you added, should not exist. Reasons:
(1) It duplicates eaxmples/* files. Now anyone
adding/modifying an example oops file needs
to add/modify it in two places. This will inevitably
fall out of sync.
(2) tarball is a wrong format to store data
in a versioned data store (git). It's a binary file,
and change to any part of it isn't handled well
by git when user wants to see the history -
git just says that this binary file was changed.
--
vda
11 years, 7 months
[PATCH] fix oops jiffies time stamp counter removal code
by Denys Vlasenko
The check "(c2-c) < 8" which tests that seconds part of the stamp is not too big
was buggy: in https://bugzilla.redhat.com/show_bug.cgi?id=861985,
"[1462424.528377]" stamp has (c2-c) == 8.
The patch adds the example of mishandled oops, adds logic which makes
abrt-action-analyze-oops fail if we end up hashing "" (empty string),
and fixes memory leaks (w/o changing the logic) in oops hashing code.
--
vda
diff -x '*.po' -d -urpN abrt.6/examples/oops6.right abrt.7/examples/oops6.right
--- abrt.6/examples/oops6.right 1970-01-01 01:00:00.000000000 +0100
+++ abrt.7/examples/oops6.right 2012-10-02 14:44:04.342238672 +0200
@@ -0,0 +1,41 @@
+abrt-dump-oops: Found oopses: 1
+
+Version: 3.5.3-1.fc17.x86_64
+general protection fault: 0000 [#1] SMP
+CPU 1
+Modules linked in: vfat fat usb_storage fuse ebtable_nat ebtables ipt_MASQUERADE iptable_nat nf_nat xt_CHECKSUM iptable_mangle bridge stp llc rfcomm be2iscsi iscsi_boot_sysfs bnep bnx2i cnic uio cxgb4i cxgb4 cxgb3i cxgb3 mdio ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_filter ip6_tables libcxgbi ib_iser rdma_cm tpm_bios nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack ib_addr iw_cm ib_cm ib_sa ib_mad ib_core iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi nls_utf8 hfsplus snd_hda_codec_hdmi btusb bluetooth snd_hda_codec_cirrus b43 snd_hda_intel coretemp mac80211 snd_hda_codec cfg80211 rfkill ssb microcode snd_hwdep snd_pcm snd_page_alloc snd_timer snd lpc_ich mfd_core tg3 mei applesmc bcma
input_polldev shpchp i2c_i801 soundcore apple_gmux apple_bl vhost_net tun macvtap macvlan kvm_intel nfsd kvm nfs_acl auth_rpcgss uinput lockd sunrpc crc32c_intel ghash_clmulni_intel firewire_ohci firewire_core crc_itu_t sdhci_pci sdhci mmc_core i915 video i2c
+_algo_bit drm_kms_helper drm i2c_core [last unloaded: scsi_wait_scan]
+Pid: 1659, comm: rpm Not tainted 3.5.3-1.fc17.x86_64 #1 Apple Inc. Macmini5,1/Mac-8ED6AF5B48C039E1
+RIP: 0010:[<ffffffff812db222>] [<ffffffff812db222>] memcpy+0x12/0x110
+RSP: 0018:ffff880041c5dc30 EFLAGS: 00010202
+RAX: ffff880041c5dcc4 RBX: 0000000000000004 RCX: 0000000000000004
+RDX: 0000000000000004 RSI: 0005080000000800 RDI: ffff880041c5dcc4
+RBP: ffff880041c5dc98 R08: 0000000000000000 R09: ffff880076677e50
+R10: ffff880005dbc780 R11: 0000000000000069 R12: ffff880041c5dcc4
+R13: ffff880000000000 R14: 0000160000000000 R15: 0000000000000004
+FS: 00007fa354dc7800(0000) GS:ffff880100240000(0000) knlGS:0000000000000000
+CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
+CR2: 00007f838e0bd430 CR3: 000000003c8c3000 CR4: 00000000000407e0
+DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
+DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
+Process rpm (pid: 1659, threadinfo ffff880041c5c000, task ffff8800039a4530)
+Stack:
+ ffffffffa053f719 ffff880041c5dc98 ffffffff00000800 ffff880000000004
+ ffff880076677e50 ffff880041c5dcc8 00000069a0542980 ff7bffef00000000
+ 0000000000000001 ffff880041c5dd10 0000000000000003 0000000000000003
+Call Trace:
+ [<ffffffffa053f719>] ? hfsplus_bnode_read+0x89/0x100 [hfsplus]
+ [<ffffffffa0541e9e>] hfsplus_brec_find+0x7e/0x150 [hfsplus]
+ [<ffffffffa053d7ea>] hfsplus_delete_cat+0x7a/0x290 [hfsplus]
+ [<ffffffffa053e93b>] hfsplus_unlink+0x8b/0x1f0 [hfsplus]
+ [<ffffffff8127621c>] ? security_inode_permission+0x1c/0x30
+ [<ffffffff8119384e>] vfs_unlink+0x9e/0x110
+ [<ffffffff81196de3>] do_unlinkat+0x183/0x1c0
+ [<ffffffff810d358c>] ? __audit_syscall_entry+0xcc/0x300
+ [<ffffffff810d3bac>] ? __audit_syscall_exit+0x3ec/0x450
+ [<ffffffff811a416e>] ? mnt_want_write+0x3e/0x60
+ [<ffffffff81197b86>] sys_unlink+0x16/0x20
+ [<ffffffff81614ae9>] system_call_fastpath+0x16/0x1b
+Code: 4e 48 83 c4 08 5b 5d c3 90 e8 eb fb ff ff eb e6 90 90 90 90 90 90 90 90 90 48 89 f8 48 89 d1 48 c1 e9 03 83 e2 07 f3 48 a5 89 d1 <f3> a4 c3 20 4c 8b 06 4c 8b 4e 08 4c 8b 56 10 4c 8b 5e 18 48 8d
+RIP [<ffffffff812db222>] memcpy+0x12/0x110
+ RSP <ffff880041c5dc30>
diff -x '*.po' -d -urpN abrt.6/examples/oops6.test abrt.7/examples/oops6.test
--- abrt.6/examples/oops6.test 1970-01-01 01:00:00.000000000 +0100
+++ abrt.7/examples/oops6.test 2012-10-02 14:01:33.828569345 +0200
@@ -0,0 +1,40 @@
+[1462424.527379] general protection fault: 0000 [#1] SMP
+[1462424.527431] CPU 1
+[1462424.527448] Modules linked in: vfat fat usb_storage fuse ebtable_nat ebtables ipt_MASQUERADE iptable_nat nf_nat xt_CHECKSUM iptable_mangle bridge stp llc rfcomm be2iscsi iscsi_boot_sysfs bnep bnx2i cnic uio cxgb4i cxgb4 cxgb3i cxgb3 mdio ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_filter ip6_tables libcxgbi ib_iser rdma_cm tpm_bios nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack ib_addr iw_cm ib_cm ib_sa ib_mad ib_core iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi nls_utf8 hfsplus snd_hda_codec_hdmi btusb bluetooth snd_hda_codec_cirrus b43 snd_hda_intel coretemp mac80211 snd_hda_codec cfg80211 rfkill ssb microcode snd_hwdep snd_pcm snd_page_alloc snd_timer snd lpc_ich mfd_core tg3
mei applesmc bcma input_polldev shpchp i2c_i801 soundcore apple_gmux apple_bl vhost_net tun macvtap macvlan kvm_intel nfsd kvm nfs_acl auth_rpcgss uinput lockd sunrpc crc32c_intel ghash_clmulni_intel firewire_ohci firewire_core crc_itu_t sdhci_pci sdhci mmc_core i915 video i2c
+_algo_bit drm_kms_helper drm i2c_core [last unloaded: scsi_wait_scan]
+[1462424.528377]
+[1462424.528383] Pid: 1659, comm: rpm Not tainted 3.5.3-1.fc17.x86_64 #1 Apple Inc. Macmini5,1/Mac-8ED6AF5B48C039E1
+[1462424.528456] RIP: 0010:[<ffffffff812db222>] [<ffffffff812db222>] memcpy+0x12/0x110
+[1462424.528515] RSP: 0018:ffff880041c5dc30 EFLAGS: 00010202
+[1462424.528552] RAX: ffff880041c5dcc4 RBX: 0000000000000004 RCX: 0000000000000004
+[1462424.528600] RDX: 0000000000000004 RSI: 0005080000000800 RDI: ffff880041c5dcc4
+[1462424.528647] RBP: ffff880041c5dc98 R08: 0000000000000000 R09: ffff880076677e50
+[1462424.528695] R10: ffff880005dbc780 R11: 0000000000000069 R12: ffff880041c5dcc4
+[1462424.528742] R13: ffff880000000000 R14: 0000160000000000 R15: 0000000000000004
+[1462424.528791] FS: 00007fa354dc7800(0000) GS:ffff880100240000(0000) knlGS:0000000000000000
+[1462424.528844] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
+[1462424.528883] CR2: 00007f838e0bd430 CR3: 000000003c8c3000 CR4: 00000000000407e0
+[1462424.528930] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
+[1462424.528978] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
+[1462424.529026] Process rpm (pid: 1659, threadinfo ffff880041c5c000, task ffff8800039a4530)
+[1462424.529077] Stack:
+[1462424.529094] ffffffffa053f719 ffff880041c5dc98 ffffffff00000800 ffff880000000004
+[1462424.529154] ffff880076677e50 ffff880041c5dcc8 00000069a0542980 ff7bffef00000000
+[1462424.529213] 0000000000000001 ffff880041c5dd10 0000000000000003 0000000000000003
+[1462424.529272] Call Trace:
+[1462424.529302] [<ffffffffa053f719>] ? hfsplus_bnode_read+0x89/0x100 [hfsplus]
+[1462424.529355] [<ffffffffa0541e9e>] hfsplus_brec_find+0x7e/0x150 [hfsplus]
+[1462424.529406] [<ffffffffa053d7ea>] hfsplus_delete_cat+0x7a/0x290 [hfsplus]
+[1462424.529457] [<ffffffffa053e93b>] hfsplus_unlink+0x8b/0x1f0 [hfsplus]
+[1462424.529505] [<ffffffff8127621c>] ? security_inode_permission+0x1c/0x30
+[1462424.529554] [<ffffffff8119384e>] vfs_unlink+0x9e/0x110
+[1462424.529593] [<ffffffff81196de3>] do_unlinkat+0x183/0x1c0
+[1462424.529633] [<ffffffff810d358c>] ? __audit_syscall_entry+0xcc/0x300
+[1462424.529677] [<ffffffff810d3bac>] ? __audit_syscall_exit+0x3ec/0x450
+[1462424.532090] [<ffffffff811a416e>] ? mnt_want_write+0x3e/0x60
+[1462424.534494] [<ffffffff81197b86>] sys_unlink+0x16/0x20
+[1462424.536899] [<ffffffff81614ae9>] system_call_fastpath+0x16/0x1b
+[1462424.539450] Code: 4e 48 83 c4 08 5b 5d c3 90 e8 eb fb ff ff eb e6 90 90 90 90 90 90 90 90 90 48 89 f8 48 89 d1 48 c1 e9 03 83 e2 07 f3 48 a5 89 d1 <f3> a4 c3 20 4c 8b 06 4c 8b 4e 08 4c 8b 56 10 4c 8b 5e 18 48 8d
+[1462424.544800] RIP [<ffffffff812db222>] memcpy+0x12/0x110
+[1462424.547415] RSP <ffff880041c5dc30>
+[1462424.667311] ---[ end trace ca3a6cae6c998aca ]---
diff -x '*.po' -d -urpN abrt.6/src/include/libabrt.h abrt.7/src/include/libabrt.h
--- abrt.6/src/include/libabrt.h 2012-09-05 13:48:28.000000000 +0200
+++ abrt.7/src/include/libabrt.h 2012-10-02 14:36:43.739080493 +0200
@@ -83,7 +83,7 @@ char *kernel_tainted_short(const char *k
#define kernel_tainted_long abrt_kernel_tainted_long
char *kernel_tainted_long(const char *tainted_short);
#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);
+int koops_hash_str(char hash_str[SHA1_RESULT_LEN*2 + 1], const char *oops_buf);
#define koops_extract_oopses abrt_koops_extract_oopses
void koops_extract_oopses(GList **oops_list, char *buffer, size_t buflen);
#define koops_print_suspicious_strings abrt_koops_print_suspicious_strings
diff -x '*.po' -d -urpN abrt.6/src/lib/kernel.c abrt.7/src/lib/kernel.c
--- abrt.6/src/lib/kernel.c 2012-09-11 13:16:01.000000000 +0200
+++ abrt.7/src/lib/kernel.c 2012-10-02 14:39:38.029174289 +0200
@@ -17,6 +17,7 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#define _GNU_SOURCE 1 /* for strcasestr */
#include "libabrt.h"
/*
@@ -168,16 +169,17 @@ void koops_extract_oopses(GList **oops_l
}
/* remove jiffies time stamp counter if present
* jiffies are unsigned long, so it can be 2^64 long, which is
- * 20 decimal digits*/
+ * 20 decimal digits
+ */
if (*c == '[')
{
char *c2 = strchr(c, '.');
char *c3 = strchr(c, ']');
- if (c2 && c3 && (c2 < c3) && (c3-c) < 21 && (c2-c) < 8)
+ if (c2 && c3 && (c2 < c3) && (c3-c) < 21)
{
c = c3 + 1;
if (*c == ' ')
- c++;
+ c++;
}
}
if ((lines_info_size & 0xfff) == 0)
@@ -291,7 +293,7 @@ next_line:
/* a call trace starts with "Call Trace:" or with the " [<.......>] function+0xFF/0xAA" pattern */
if (oopsstart >= 0 && !inbacktrace)
{
- if (strstr(curline, "Call Trace:"))
+ if (strcasestr(curline, "Call Trace:")) /* yes, it must be case-insensitive */
inbacktrace = 1;
else
if (strnlen(curline, 9) > 8
@@ -387,8 +389,10 @@ next_line:
free(lines_info);
}
-void koops_hash_str(char hash_str[SHA1_RESULT_LEN*2 + 1], char *oops_buf, const char *oops_ptr)
+int koops_hash_str(char hash_str[SHA1_RESULT_LEN*2 + 1], const char *oops_buf)
{
+ struct strbuf *kernel_bt = strbuf_new();
+
// Example of call trace part of oops:
// Call Trace:
// [<f88e11c7>] ? radeon_cp_resume+0x7d/0xbc [radeon]
@@ -401,52 +405,48 @@ void koops_hash_str(char hash_str[SHA1_R
// [<c0403c76>] ? syscall_call+0x7/0xb
// Code:... <======== we should ignore everything which isn't call trace
// RIP ...
- struct strbuf *kernel_bt = strbuf_new();
- char *call_trace = strstr(oops_buf, "Call Trace");
+ char *call_trace = strcasestr(oops_buf, "Call Trace:"); /* yes, it must be case-insensitive */
if (call_trace)
{
- call_trace += sizeof("Call Trace\n");
- char *end_line = strchr(call_trace, '\n');
+ /* Different architectures have different case
+ * and different kind/amount of whitespace after ":" -
+ * don't assume there is a single "\n"!
+ */
+ call_trace += sizeof("Call Trace:")-1;
+ call_trace = skip_whitespace(call_trace);
int i = 0;
- while (end_line && end_line[0] != '\0')
+ for (;;)
{
+ char *end_line = strchr(call_trace, '\n');
+ if (!end_line)
+ break;
char *line = xstrndup(call_trace, end_line - call_trace);
char *p = skip_whitespace(line);
char *end_mem_block = strchr(p, ' ');
if (!end_mem_block)
- break; /* no memblock, we are done */
+ goto done; /* no memblock, we are done */
if (p[0] != '[' || p[1] != '<' || end_mem_block[-2] != '>' || end_mem_block[-1] != ']')
- break; /* no memblock, we are done */
+ goto done; /* no memblock, we are done */
+ /* skip symbols prefixed with "?" */
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);
+ /* strip out "+off/len" */
+ p = strchrnul(end_mem_block, '+');
+ /* append "func_name\n" */
+ strbuf_append_strf(kernel_bt, "%.*s\n", (int)(p - end_mem_block), end_mem_block);
if (i == 5)
+ {
+ done:
+ free(line);
break;
-
+ }
++i;
- skip_line:
- call_trace += end_line - call_trace + 1;
- end_line = strchr(call_trace, '\n');
- if (end_line)
- ++end_line; /* skip \n */
+ skip_line:
+ free(line);
+ call_trace = end_line + 1;
}
goto gen_hash;
}
@@ -455,20 +455,26 @@ void koops_hash_str(char hash_str[SHA1_R
* 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)
+ if (strncmp(oops_buf, "WARNING: at ", sizeof("WARNING: at ")-1) == 0)
{
- const char *p = oops_ptr + sizeof("WARNING: at ")-1;
+ const char *p = oops_buf + 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++);
+ oops_buf += sizeof("WARNING: at ")-1;
+ while (oops_buf < p)
+ strbuf_append_char(kernel_bt, *oops_buf++);
}
}
-gen_hash: ;
+ gen_hash: ;
+ VERB3 log("bt to hash: '%s'", kernel_bt->buf);
+
+ /* If we failed to find and process bt, we may end up hashing "".
+ * Not good. Let user know it via return value.
+ */
+ int bad = (kernel_bt->len == 0);
char hash_bytes[SHA1_RESULT_LEN];
sha1_ctx_t sha1ctx;
@@ -479,6 +485,8 @@ gen_hash: ;
bin2hex(hash_str, hash_bytes, SHA1_RESULT_LEN)[0] = '\0';
VERB3 log("hash: %s", hash_str);
+
+ return bad;
}
char *koops_extract_version(const char *linepointer)
diff -x '*.po' -d -urpN abrt.6/src/plugins/abrt-action-analyze-oops.c abrt.7/src/plugins/abrt-action-analyze-oops.c
--- abrt.6/src/plugins/abrt-action-analyze-oops.c 2012-08-20 16:04:41.000000000 +0200
+++ abrt.7/src/plugins/abrt-action-analyze-oops.c 2012-10-02 14:41:35.239214104 +0200
@@ -58,13 +58,18 @@ int main(int argc, char **argv)
char *oops = dd_load_text(dd, FILENAME_BACKTRACE);
char hash_str[SHA1_RESULT_LEN*2 + 1];
- koops_hash_str(hash_str, oops, oops);
+ int bad = koops_hash_str(hash_str, oops);
free(oops);
- dd_save_text(dd, FILENAME_UUID, hash_str);
- dd_save_text(dd, FILENAME_DUPHASH, hash_str);
+ if (bad)
+ error_msg("Can't find a meaningful backtrace for hashing in '%s'", dump_dir_name);
+ else
+ {
+ dd_save_text(dd, FILENAME_UUID, hash_str);
+ dd_save_text(dd, FILENAME_DUPHASH, hash_str);
+ }
dd_close(dd);
- return 0;
+ return bad;
}
diff -x '*.po' -d -urpN abrt.6/tests/koops-parser.at abrt.7/tests/koops-parser.at
--- abrt.6/tests/koops-parser.at 2012-08-20 16:04:41.000000000 +0200
+++ abrt.7/tests/koops-parser.at 2012-10-02 13:39:16.365840922 +0200
@@ -120,10 +120,10 @@ int run_test(const struct test_struct *t
char *oops2 = fread_full(test->expected_results);
char hash_oops1[SHA1_RESULT_LEN*2 + 1];
- koops_hash_str(hash_oops1, oops1, oops1);
+ koops_hash_str(hash_oops1, oops1);
char hash_oops2[SHA1_RESULT_LEN*2 + 1];
- koops_hash_str(hash_oops2, oops2, oops2);
+ koops_hash_str(hash_oops2, oops2);
if (!strcmp(hash_oops1, hash_oops2))
return 0;
11 years, 7 months
Re: [Automatic Bug Reporting Tool - ABRT] #721: Problems - Generate description
by fedora-badges
#721: Problems - Generate description
---------------------+----------------------------
Reporter: mtoman | Owner: rmarko
Type: defect | Status: closed
Priority: major | Milestone: ABRT_Server_R2
Component: faf | Version:
Resolution: fixed | Keywords:
Blocked By: | Blocking:
---------------------+----------------------------
Changes (by rmarko):
* resolution: => fixed
* status: assigned => closed
Comment:
Done for report names, will be extended for problems later.
commit e8535c35a8cd26f2281cac63d1c0fc126dc61b50
Author: Richard Marko <rmarko(a)redhat.com>
Date: Wed Sep 26 20:30:00 2012 +0200
hub: generate description for reports
--
Ticket URL: <https://fedorahosted.org/abrt/ticket/721#comment:2>
Automatic Bug Reporting Tool - ABRT <http://fedorahoted.org/abrt/>
Automatic bug reporting tool
11 years, 7 months
Re: [Automatic Bug Reporting Tool - ABRT] #754: alllow users to delete, change and add problem element over DBus
by fedora-badges
#754: alllow users to delete, change and add problem element over DBus
-----------------------+---------------------------------------
Reporter: jfilak | Owner: jfilak
Type: task | Status: new
Priority: major | Milestone: Remove_Directory_Stealing
Component: dbus-api | Version: 2.0
Resolution: | Keywords: ABRTF18
Blocked By: | Blocking:
-----------------------+---------------------------------------
Comment (by jfilak):
notes:
I've decided to disable delete/modify both the time element and the uid
element
- changing of uid element is different use case, this should be handled by
ChownProblemDir D-Bus method
- changing of time element doesn't make sense to me
The time element and the uid element should be created during filling of a
new problem.
--
Ticket URL: <https://fedorahosted.org/abrt/ticket/754#comment:4>
Automatic Bug Reporting Tool - ABRT <http://fedorahoted.org/abrt/>
Automatic bug reporting tool
11 years, 7 months