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/Backtrace') 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 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/Backtrace') 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/Backtrace') 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/Backtrace') 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 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/Backtrace') 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 From 7c7be9f40f84a685975536f3b8e8bbe620dde398 Mon Sep 17 00:00:00 2001 From: Karel Klic Date: Thu, 4 Feb 2010 11:53:47 +0100 Subject: Remove lines containing only spaces from backtrace. --- src/Backtrace/main.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'src/Backtrace') diff --git a/src/Backtrace/main.c b/src/Backtrace/main.c index f2fe1ba..6683aa9 100644 --- a/src/Backtrace/main.c +++ b/src/Backtrace/main.c @@ -232,7 +232,7 @@ int main(int argc, char **argv) ++thread_fixer; } - /* Bug fixing hack for GDB. + /* Bug fixing hack for GDB - remove wrongly placed newlines from the backtrace. * Sometimes there is a newline in the local variable section. * This is caused by some GDB hooks. * Example: rhbz#538440 @@ -248,10 +248,26 @@ int main(int argc, char **argv) * __PRETTY_FUNCTION__ = "sync_deletions" * #2 0x0000000000423e6b in refresh_folder (stub=0x1b77f10 [MailStubExchange], * ... + * + * The code removes every empty line (also those containing only spaces), + * which is not followed by a new Thread section. + * + * rhbz#555251 contains empty lines with spaces */ char *empty_line = btnoheader; -/* TODO SPACES ON LINES AS WELL, rhbz#555251 !!!!!!!! -/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */ + char *c = btnoheader; + while (*c) + { + if (*c == '\n') + { + char *cend = c + 1; + while (*cend == ' ' || *cend == '\t') + ++cend; + if (*cend == '\n' && 0 != strncmp(cend, "\nThread", strlen("\nThread"))) + memmove(c, cend, strlen(cend) + 1); + } + ++c; + } while ((empty_line = strstr(empty_line, "\n\n")) != NULL) { if (0 != strncmp(empty_line, "\n\nThread", strlen("\n\nThread"))) -- cgit