Am 16.04.2019 um 17:36 schrieb Jakub Jelinek:
> On Tue, Apr 16, 2019 at 03:44:44PM +0200, Jakub Jelinek wrote:
>> I can't reproduce this on my Fedora 29 x86_64-linux bootstrap box though,
>> the *.log files are complete there.
>>
>> And I have no idea if it was introduced with your change or earlier.
> 
> Actually, I managed to reproduce in a Fedora 31 chroot, in which I don't
> have /usr/bin/python installed (I think in Fedora 30+ there is
> /usr/bin/python2 and /usr/bin/python3 but not /usr/bin/python, at least not
> in the default buildroot).
On msys2 there is no python executable but /usr/bin/python2.
Optionally you may install python3.


> 
> The changes to contrib/dg-extract-results.sh look wrong to me:
> --- contrib/dg-extract-results.sh     2018-04-25 09:40:40.139659386 +0200
> +++ contrib/dg-extract-results.sh     2019-03-05 21:49:34.471573434 +0100
> @@ -298,6 +298,8 @@ BEGIN {
>    cnt=0
>    print_using=0
>    need_close=0
> +  has_timeout=0
> +  timeout_cnt=0
>  }
>  /^EXPFILE: / {
>    expfiles[expfileno] = \$2
> @@ -329,16 +331,37 @@ BEGIN {
>    # Ugly hack for gfortran.dg/dg.exp
>    if ("$TOOL" == "gfortran" && testname ~ /^gfortran.dg\/g77\//)
>      testname="h"testname
> +  if (\$1 == "WARNING:" && \$2 == "program" && \$3 == "timed" && (\$4 == 
> "out" || \$4 == "out.")) {
> +        has_timeout=1
> +        timeout_cnt=cnt
> +  } else {
> +  # Prepare timeout replacement message in case it's needed
> +    timeout_msg=\$0
> +    sub(\$1, "WARNING:", timeout_msg)
> +  }
>  }
>  /^$/ { if ("$MODE" == "sum") next }
>  { if (variant == curvar && curfile) {
>      if ("$MODE" == "sum") {
> -      printf "%s %08d|", testname, cnt >> curfile
> -      cnt = cnt + 1
> +      # Do not print anything if the current line is a timeout
> +      if (has_timeout == 0) {
> +        # If the previous line was a timeout,
> +        # insert the full current message without keyword
> +        if (timeout_cnt != 0) {
> +          printf "%s %08d|%s program timed out.\n", testname, timeout_cnt, 
> timeout_msg >> curfile
> +          timeout_cnt = 0
> +          cnt = cnt + 1
> +        }
> +        printf "%s %08d|", testname, cnt >> curfile
> +        cnt = cnt + 1
> +        filewritten[curfile]=1
> +        need_close=1
> +        if (timeout_cnt == 0)
> +          print >> curfile
> +      }
> +
> +      has_timeout=0
>      }
> -    filewritten[curfile]=1
> -    need_close=1
> -    print >> curfile
>    } else
>      next
>  }
> First of all, I don't see why the WARNING: program timed out
> stuff should be handled in any way specially in -L mode, there is no sorting
> at all and all the lines go together.  But more importantly, the above
> changes broke completely the -L mode, previously the filewritten, need_close
> and print lines were done for both sum and log modes, but now they are done
> only in the sum mode (and in that case only if has_timeout is 0, which is
> desirable).
> 
> I believe the following patch should fix it, but I don't actually have any
> WARNING: program timed out
> lines in my *.sep files in any of the last 12 bootstraps I have around.
I do have several "program timed out" in libgomp, so I may test this.


> 
> Additionally, perhaps we should change dg-extract-results.sh, so that it
> doesn't try just python, but also python3?  I think in some distros
> /usr/bin/python even warns users that they should decide if they mean
> python2 or python3.
As explained above I vote for this change.


Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to