public inbox for bunsen@sourceware.org
 help / color / mirror / Atom feed
From: "Serhei Makarov" <me@serhei.io>
To: "Keith Seitz" <keiths@redhat.com>, Bunsen <bunsen@sourceware.org>
Subject: Re: [PATCH] When importing results from a full GDB test run,  bunsen will throw a TypeError:
Date: Thu, 05 Aug 2021 15:39:45 -0400	[thread overview]
Message-ID: <02e91f33-8277-4380-bac6-cae9c7749862@www.fastmail.com> (raw)
In-Reply-To: <20210805190333.11594-1-keiths@redhat.com>



On Thu, Aug 5, 2021, at 3:03 PM, Keith Seitz via Bunsen wrote:
> $ ./bunsen-add.py <!-- arguments -->
> bunsen-upload received a payload:
> * gdb.log.xz (1177912 bytes, file)
> * gdb.sum.xz (287264 bytes, file)
> * README.txt (96 bytes, file)
> will decompress /tmp/tmp72zejz8o/gdb.log.xz
> will decompress /tmp/tmp72zejz8o/gdb.sum.xz
> Traceback (most recent call last):
>   File "/home/keiths/work/bunsen/virgin/bunsen/./bunsen-add.py", line 
> 80, in <module>
>     commit_id = _commit_logs.commit_logs(b, wd, tar, tarfile=tar,
>   File 
> "/home/keiths/work/bunsen/virgin/bunsen/scripts-main/gdb/commit_logs.py", line 224, in commit_logs
>     testrun = annotate_dejagnu_log(testrun, gdb_log, all_cases, 
> verbose=False)
>   File 
> "/home/keiths/work/bunsen/virgin/bunsen/scripts-main/gdb/parse_dejagnu.py", line 221, in annotate_dejagnu_log
>     outcome, expname, subtest = get_expname_subtest(outcome_lines[j])
> TypeError: cannot unpack non-iterable NoneType object
> 
> This happens in annotate_dejagnu_log, where the code attempts to map
> outcome lines:
> 
>     for j in range(len(outcome_lines)):
>         outcome, expname, subtest = get_expname_subtest(outcome_lines[j])
>         if expname not in testcase_line_start:
>             testcase_line_start[expname] = j
> 
> The problem is that get_expname_subtest can return None whenever it
> encounters a line that doesn't fit the "OUTCOME: TESTFILE: TESTNAME"
> pattern. In log files, this happens all the time, e.g., "Running TESTFILE..."
Hmm, I could have sworn I dealt with this before...
If outcome_lines contains a malformed line, that's actually a bug.
The previous parser function (parse_dejagnu_log) contains a variable
called all_cases, which should accumulate lines of the form 
"OUTCOME: TESTFILE: TESTNAME" only.

In the latest code it's populated like this
https://sourceware.org/git/?p=bunsen.git;a=blob;f=scripts-main/gdb/parse_dejagnu.py;h=b56ed3c3e5cfbfb33e6fa38fa710e5a7096071b0;hb=HEAD#l143

all_cases is then passed as outcome_lines to annotate_dejagnu_log here
https://sourceware.org/git/?p=bunsen.git;a=blob;f=scripts-main/gdb/commit_logs.py;h=a8edb14b7c28975e9b9a8ffa3141ccdbe547e18b;hb=HEAD#l223

Could I have a copy of the input data that was triggering the issue?
It seems like the best way to solve this is with a bit of debugging on my part.

All the best,
      Serhei

  reply	other threads:[~2021-08-05 19:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-05 19:03 Keith Seitz
2021-08-05 19:39 ` Serhei Makarov [this message]
2021-08-05 19:45   ` Keith Seitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=02e91f33-8277-4380-bac6-cae9c7749862@www.fastmail.com \
    --to=me@serhei.io \
    --cc=bunsen@sourceware.org \
    --cc=keiths@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).