From 412ebc00ca3ccbbb6a60094a67d1402376298c85 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 3 Feb 2010 15:55:00 +0100 Subject: CCpp analyzer: change duphash calculation to group minor versions together Signed-off-by: Denys Vlasenko --- src/Daemon/PluginManager.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/Daemon/PluginManager.cpp b/src/Daemon/PluginManager.cpp index c552880..273cceb 100644 --- a/src/Daemon/PluginManager.cpp +++ b/src/Daemon/PluginManager.cpp @@ -159,16 +159,15 @@ void CPluginManager::UnLoadPlugins() CPlugin* CPluginManager::LoadPlugin(const char *pName, bool enabled_only) { - map_string_t plugin_info; - - plugin_info["Name"] = pName; - map_plugin_t::iterator it_plugin = m_mapPlugins.find(pName); if (it_plugin != m_mapPlugins.end()) { return it_plugin->second; /* ok */ } + map_string_t plugin_info; + plugin_info["Name"] = pName; + const char *conf_name = pName; if (strncmp(pName, "Kerneloops", sizeof("Kerneloops")-1) == 0) { -- cgit From fabdf82b7487b193225e971507a34a2096928b69 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 3 Feb 2010 18:02:40 +0100 Subject: GUI: fix rhbz#560971 "Don't show empty 'Not loaded plugins' section" also fix bad plugin descr for TicketUploader Signed-off-by: Denys Vlasenko --- src/Gui/PluginsSettingsDialog.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Gui/PluginsSettingsDialog.py b/src/Gui/PluginsSettingsDialog.py index 611a8c5..0ba390d 100644 --- a/src/Gui/PluginsSettingsDialog.py +++ b/src/Gui/PluginsSettingsDialog.py @@ -97,22 +97,34 @@ class PluginsSettingsDialog: # don't force refresh as it will overwrite settings if g-k is not available pluginlist = getPluginInfoList(self.ccdaemon) except Exception, e: - print e + log("Error while loading plugins info: %s", e) #gui_error_message("Error while loading plugins info, please check if abrt daemon is running\n %s" % e) return plugin_rows = {} + group_empty = {} for plugin_type in PluginInfo.types.keys(): it = self.pluginsListStore.append(None, + # cell_text, toggle_active, toggle_visible, group_name_visible, color, plugin ["%s" % PluginInfo.types[plugin_type], 0, 0, 1, "gray", None]) plugin_rows[plugin_type] = it + group_empty[plugin_type] = 1 for entry in pluginlist: if entry.Description: text = "%s\n%s" % (entry.getName(), entry.Description) else: # non-loaded plugins have empty description text = "%s" % entry.getName() - self.pluginsListStore.append(plugin_rows[entry.getType()], + plugin_type = entry.getType() + self.pluginsListStore.append(plugin_rows[plugin_type], + # cell_text, toggle_active, toggle_visible, group_name_visible, color, plugin [text, entry.Enabled == "yes", 1, 0, "white", entry]) + group_empty[plugin_type] = 0 + # rhbz#560971 "Don't show empty 'Not loaded plugins' section" + for plugin_type in group_empty.keys(): + if group_empty[plugin_type]: + self.pluginsListStore.append(plugin_rows[plugin_type], + # cell_text, toggle_active, toggle_visible, group_name_visible, color, plugin + ["(none)", 0, 1, 0, "white", None]) self.pluginlist.expand_all() def dehydrate(self): -- cgit From 84234fa714e176255bb5fc89f5a7baa54ae0fdbe Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 3 Feb 2010 19:36:56 +0100 Subject: cli: fix the problem of not showing oops text in editor Signed-off-by: Denys Vlasenko --- src/CLI/report.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/CLI/report.cpp b/src/CLI/report.cpp index 76cd3d5..2bcd52a 100644 --- a/src/CLI/report.cpp +++ b/src/CLI/report.cpp @@ -38,26 +38,25 @@ * Trims whitespace characters both from left and right side of a string. * Modifies the string in-place. Returns the trimmed string. */ -char *trim(char *str) +static char *trim(char *str) { if (!str) return NULL; // Remove leading spaces. char *ibuf; - for (ibuf = str; *ibuf && isspace(*ibuf); ++ibuf) - continue; + ibuf = skip_whitespace(str); + int i = strlen(ibuf); if (str != ibuf) - memmove(str, ibuf, ibuf - str); + memmove(str, ibuf, i + 1); // Remove trailing spaces. - int i = strlen(str); while (--i >= 0) { if (!isspace(str[i])) break; } - str[++i] = NULL; + str[++i] = '\0'; return str; } @@ -198,6 +197,8 @@ static void write_crash_report(const map_crash_data_t &report, FILE *fp) _("# How to reproduce the crash?")); write_crash_report_field(fp, report, FILENAME_BACKTRACE, _("# Stack trace: a list of active stack frames at the time the crash occurred\n# Check that it does not contain any sensitive data such as passwords.")); + write_crash_report_field(fp, report, FILENAME_KERNELOOPS, + _("# Kernel oops: kernel log snippet\n# Check that it does not contain any sensitive data such as passwords.")); write_crash_report_field(fp, report, CD_DUPHASH, "# DUPHASH"); write_crash_report_field(fp, report, FILENAME_ARCHITECTURE, _("# Architecture")); write_crash_report_field(fp, report, FILENAME_CMDLINE, _("# Command line")); @@ -221,7 +222,7 @@ static void write_crash_report(const map_crash_data_t &report, FILE *fp) static int read_crash_report_field(const char *text, map_crash_data_t &report, const char *field) { - char separator[strlen("\n" FIELD_SEP) + strlen(field) + 2]; // 2 = '\n\0' + char separator[sizeof("\n" FIELD_SEP)-1 + strlen(field) + 2]; // 2 = '\n\0' sprintf(separator, "\n%s%s\n", FIELD_SEP, field); const char *textfield = strstr(text, separator); if (!textfield) @@ -285,6 +286,7 @@ static int read_crash_report(map_crash_data_t &report, const char *text) result |= read_crash_report_field(text, report, FILENAME_COMMENT); result |= read_crash_report_field(text, report, FILENAME_REPRODUCE); result |= read_crash_report_field(text, report, FILENAME_BACKTRACE); + result |= read_crash_report_field(text, report, FILENAME_KERNELOOPS); result |= read_crash_report_field(text, report, CD_DUPHASH); result |= read_crash_report_field(text, report, FILENAME_ARCHITECTURE); result |= read_crash_report_field(text, report, FILENAME_CMDLINE); -- cgit From 432df42f6036da0e2425a1369ad19e5527e7d5b5 Mon Sep 17 00:00:00 2001 From: Karel Klic Date: Wed, 3 Feb 2010 21:43:15 +0100 Subject: Fix to successfully parse a backtrace from rhbz#550642 --- src/Backtrace/parser.y | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/Backtrace/parser.y b/src/Backtrace/parser.y index 76dd7de..36a8e34 100644 --- a/src/Backtrace/parser.y +++ b/src/Backtrace/parser.y @@ -300,6 +300,7 @@ function_args : '(' wsa ')' function_args_sequence : function_args_char | function_args_sequence wsa '(' wsa ')' + | function_args_sequence wsa '(' wsa function_args_string wsa ')' | function_args_sequence wsa '(' wsa function_args_sequence wsa ')' | function_args_sequence wsa function_args_char | function_args_sequence wsa function_args_string -- cgit From fca632faa0c0ce211a74787d688be7cd6627cd30 Mon Sep 17 00:00:00 2001 From: Jiri Moskovcak Date: Wed, 3 Feb 2010 22:06:07 +0100 Subject: GUI: fixed windows icons and titles rhbz#537240, rhbz#560964 --- src/Gui/ccgui.glade | 2 ++ src/Gui/settings.glade | 11 +++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/Gui/ccgui.glade b/src/Gui/ccgui.glade index 65ad9fe..237f23a 100644 --- a/src/Gui/ccgui.glade +++ b/src/Gui/ccgui.glade @@ -9,6 +9,7 @@ True center-on-parent 470 + /usr/share/pixmaps/abrt.png main_window3 @@ -76,6 +77,7 @@ About ABRT False center-on-parent + /usr/share/pixmaps/abrt.png dialog False ABRT diff --git a/src/Gui/settings.glade b/src/Gui/settings.glade index 655c15b..a9a14f4 100644 --- a/src/Gui/settings.glade +++ b/src/Gui/settings.glade @@ -3,11 +3,12 @@ - Settings + Plugins True center-on-parent 450 400 + /usr/share/pixmaps/abrt.png True @@ -254,11 +255,12 @@ - Global Settings + Preferences True center-on-parent 450 400 + /usr/share/pixmaps/abrt.png True @@ -706,7 +708,7 @@ end - gtk-cancel + gtk-cancel True True True @@ -720,7 +722,7 @@ - gtk-ok + gtk-ok True False True @@ -753,6 +755,7 @@ center-on-parent 400 400 + /usr/share/pixmaps/abrt.png wGlobalSettings -- cgit From ac9988a068b184689228dfaf18759cc2f67464ae Mon Sep 17 00:00:00 2001 From: Jiri Moskovcak Date: Wed, 3 Feb 2010 23:01:20 +0100 Subject: GUI: fixed scrolling in reporter dialog rhbz#559687 --- src/Gui/report.glade | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/Gui/report.glade b/src/Gui/report.glade index 13e4c14..e7f37ec 100644 --- a/src/Gui/report.glade +++ b/src/Gui/report.glade @@ -374,16 +374,10 @@ automatic automatic - + True - queue - - - True - True - word-char - - + True + word-char @@ -417,16 +411,10 @@ automatic automatic - + True - queue - - - True - True - word-char - - + True + word-char -- cgit From 80f3d6ddc8ed631e463c80c5d7c98d03c7b74f57 Mon Sep 17 00:00:00 2001 From: Jiri Moskovcak Date: Wed, 3 Feb 2010 23:05:11 +0100 Subject: swapped lines, iterator is not defined after erase() is called - and this makes valgrind unhappy --- src/Daemon/PluginManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/Daemon/PluginManager.cpp b/src/Daemon/PluginManager.cpp index 273cceb..15e9bee 100644 --- a/src/Daemon/PluginManager.cpp +++ b/src/Daemon/PluginManager.cpp @@ -261,8 +261,8 @@ void CPluginManager::UnLoadPlugin(const char *pName) m_mapPlugins.erase(it_plugin); } log("UnRegistered %s plugin %s", plugin_type_str[it_module->second->GetType()], pName); - m_mapLoadedModules.erase(it_module); delete it_module->second; + m_mapLoadedModules.erase(it_module); } } -- cgit From eb7483e262e29fdebb676c18453447247f3c0545 Mon Sep 17 00:00:00 2001 From: Karel Klic Date: Wed, 3 Feb 2010 23:50:50 +0100 Subject: Fixed parsing backtrace from rhbz#549293 --- src/Backtrace/parser.y | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/Backtrace/parser.y b/src/Backtrace/parser.y index 36a8e34..1903282 100644 --- a/src/Backtrace/parser.y +++ b/src/Backtrace/parser.y @@ -267,12 +267,12 @@ variables_line : variables_char_no_framestart variables_char : '#' | variables_char_no_framestart ; -/* Manually synchronized with function_args_char, except the first line. */ -variables_char_no_framestart : digit | nondigit | '"' | '(' | ')' +/* Manually synchronized with function_args_char_base, except the first line. */ +variables_char_no_framestart : digit | nondigit | '"' | '(' | ')' | '\\' | '+' | '-' | '<' | '>' | '/' | '.' | '[' | ']' | '?' | '\'' | '`' | ',' | '=' | '{' | '}' | '^' | '&' | '$' - | ':' | ';' | '\\' | '!' | '@' | '*' + | ':' | ';' | '!' | '@' | '*' | '%' | '|' | '~' ; @@ -313,13 +313,21 @@ function_args_string : '"' wsa function_args_string_sequence wsa '"' /* Manually synchronized with variables_char_no_framestart, * except the first line. */ -function_args_char : digit | nondigit | '#' +function_args_char_base : digit | nondigit | '#' | '+' | '-' | '<' | '>' | '/' | '.' | '[' | ']' | '?' | '\'' | '`' | ',' | '=' | '{' | '}' | '^' | '&' | '$' - | ':' | ';' | '\\' | '!' | '@' | '*' + | ':' | ';' | '!' | '@' | '*' | '%' | '|' | '~' ; +function_args_escaped_char : '\\' function_args_char_base + | '\\' '\\' + | '\\' '"' +; +function_args_char : function_args_char_base + | function_args_escaped_char +; + function_args_string_sequence : function_args_string_char | function_args_string_sequence function_args_string_char @@ -329,7 +337,6 @@ function_args_string_sequence : function_args_string_char function_args_string_char : function_args_char | '(' | ')' ; - file_name : file_name_char { $$ = strbuf_new(); strbuf_append_char($$, $1); } | file_name file_name_char { $$ = strbuf_append_char($1, $2); } ; @@ -408,6 +415,11 @@ identifier_braces_inside : identifier_braces_inside_char %dprec 1 strbuf_free($3); $$ = strbuf_append_char($1, $4); } + | identifier_braces_inside '(' ')' %dprec 1 + { + $$ = strbuf_append_char($1, $2); + $$ = strbuf_append_char($1, $3); + } | identifier_braces_inside identifier_template %dprec 2 { $$ = strbuf_append_str($1, $2->buf); -- cgit From abf9af670cd605ec2fb631219e9493f619773db3 Mon Sep 17 00:00:00 2001 From: Karel Klic Date: Thu, 4 Feb 2010 10:11:40 +0100 Subject: Skip bugs without backtrace; +some notes; run ./abrt-backtrace instead of system one --- src/Backtrace/abrt-bz-dupchecker | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Backtrace/abrt-bz-dupchecker b/src/Backtrace/abrt-bz-dupchecker index 01cafa0..4484d39 100755 --- a/src/Backtrace/abrt-bz-dupchecker +++ b/src/Backtrace/abrt-bz-dupchecker @@ -10,6 +10,14 @@ # # Please do not run this script unless it's neccessary to do so. # It forces Bugzilla to send data related to thousands of bug reports. +# +# +# Useful text to be pasted to Bugzilla: +""" +This bug appears to have been filled using a buggy version of ABRT, because +it contains unusable backtrace. Sorry for the inconvenience. +Closing as INSUFFICIENT_DATA. +""" from bugzilla import RHBugzilla from optparse import OptionParser @@ -62,16 +70,24 @@ for buginfo in buginfos: else: # Get backtrace from bug and store it as a file. bug = bz.getbug(buginfo.bug_id) + downloaded = False for attachment in bug.attachments: if attachment['filename'] == 'backtrace': data = bz.openattachment(attachment['id']) f = open(filename, 'w') f.write(data.read()) f.close() + downloaded = True if options.verbose: print "Attachment {0} downloaded.".format(filename) + + # Silently skip bugs without backtrace. + # Those are usually duplicates of bugs; the duplication copies + # abrt_hash, but it does not copy the attachment. + if not downloaded: + continue - command = ["/usr/bin/abrt-backtrace"] + command = ["./abrt-backtrace"] command.append(filename) command.append("--single-thread") command.append("--frame-depth=5") -- cgit From 823b800110c01df95085a7d19e815ed441611dd1 Mon Sep 17 00:00:00 2001 From: Karel Klic Date: Thu, 4 Feb 2010 10:12:44 +0100 Subject: Show abrt-btrc stderr; show stats at the end --- src/Backtrace/check-bt-parsability | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Backtrace/check-bt-parsability b/src/Backtrace/check-bt-parsability index 39913fe..a5018bf 100755 --- a/src/Backtrace/check-bt-parsability +++ b/src/Backtrace/check-bt-parsability @@ -6,7 +6,7 @@ FAIL=0 for file in *.bt do #echo "$file" - ./abrt-backtrace $file &> /dev/null + ./abrt-backtrace $file 1> /dev/null if [ "$?" -eq "0" ] then echo -n "." @@ -17,3 +17,4 @@ do fi done echo "" +echo "Passed $PASS and failed $FAIL." -- cgit From 148e19105577984a7fa3b6da97ec9ba565a9cfa7 Mon Sep 17 00:00:00 2001 From: Karel Klic Date: Thu, 4 Feb 2010 10:13:31 +0100 Subject: comments --- src/Daemon/Daemon.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Daemon/Daemon.cpp b/src/Daemon/Daemon.cpp index 5bcbe23..185ff7f 100644 --- a/src/Daemon/Daemon.cpp +++ b/src/Daemon/Daemon.cpp @@ -294,7 +294,7 @@ static void FindNewDumps(const char* pPath) struct stat stats; DIR *dp; vector_string_t dirs; - // get potential unsaved debugdumps + /* Get all debugdump directories in the pPath directory. */ dp = opendir(pPath); if (dp == NULL) { @@ -305,7 +305,7 @@ static void FindNewDumps(const char* pPath) while ((ep = readdir(dp))) { if (dot_or_dotdot(ep->d_name)) - continue; + continue; /* skip "." and ".." */ std::string dname = ssprintf("%s/%s", pPath, ep->d_name); if (lstat(dname.c_str(), &stats) == 0) { @@ -317,6 +317,7 @@ static void FindNewDumps(const char* pPath) } closedir(dp); + // get potential unsaved debugdumps vector_string_t::iterator itt = dirs.begin(); for (; itt != dirs.end(); ++itt) { -- cgit From 766273aebc09766eb40be905180242db94aabdda Mon Sep 17 00:00:00 2001 From: Karel Klic Date: Thu, 4 Feb 2010 10:14:29 +0100 Subject: TODO mark --- src/Backtrace/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Backtrace/main.c b/src/Backtrace/main.c index 5e69338..f2fe1ba 100644 --- a/src/Backtrace/main.c +++ b/src/Backtrace/main.c @@ -249,7 +249,9 @@ int main(int argc, char **argv) * #2 0x0000000000423e6b in refresh_folder (stub=0x1b77f10 [MailStubExchange], * ... */ - char *empty_line = btnoheader; + char *empty_line = btnoheader; +/* TODO SPACES ON LINES AS WELL, rhbz#555251 !!!!!!!! +/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */ while ((empty_line = strstr(empty_line, "\n\n")) != NULL) { if (0 != strncmp(empty_line, "\n\nThread", strlen("\n\nThread"))) -- cgit