diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-02-04 16:36:01 +0100 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-02-04 16:36:01 +0100 |
| commit | b634e1a482f6871bb4e128f3bc23456f09f85547 (patch) | |
| tree | 9f26e4db8ff0033d3ba24fe4190b90d7b4889564 /src/Backtrace | |
| parent | c45047c5414d2b24b6d1182179509a1efc55846e (diff) | |
| parent | f42baa45204bfb1df7219242d7ebcc102ad494be (diff) | |
Merge branch 'master' into rhel6
Diffstat (limited to 'src/Backtrace')
| -rwxr-xr-x | src/Backtrace/abrt-bz-dupchecker | 18 | ||||
| -rwxr-xr-x | src/Backtrace/check-bt-parsability | 3 | ||||
| -rw-r--r-- | src/Backtrace/main.c | 22 | ||||
| -rw-r--r-- | src/Backtrace/parser.y | 25 |
4 files changed, 58 insertions, 10 deletions
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") 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." diff --git a/src/Backtrace/main.c b/src/Backtrace/main.c index 5e69338..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,8 +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; + char *empty_line = btnoheader; + 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"))) diff --git a/src/Backtrace/parser.y b/src/Backtrace/parser.y index 76dd7de..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 | '"' | '(' | ')' | '\\' | '+' | '-' | '<' | '>' | '/' | '.' | '[' | ']' | '?' | '\'' | '`' | ',' | '=' | '{' | '}' | '^' | '&' | '$' - | ':' | ';' | '\\' | '!' | '@' | '*' + | ':' | ';' | '!' | '@' | '*' | '%' | '|' | '~' ; @@ -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 @@ -312,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 @@ -328,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); } ; @@ -407,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); |
