qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] This patch hunk will hang scripts/checkpatch.pl...
Date: Tue, 3 Feb 2015 10:03:50 +0000	[thread overview]
Message-ID: <20150203100350.GA2332@work-vm> (raw)
In-Reply-To: <CAFEAcA9dvehzeL1T+BT3N+_GJtGoL4ig_opv7rVT-0eJekLAvg@mail.gmail.com>

* Peter Maydell (peter.maydell@linaro.org) wrote:
> The following patch file (a cut down lump of an actual change
> I was making) seems to cause scripts/checkpatch.pl to hang.
> I find that script too opaque to try to debug, but I post the
> offending input here in case anybody else wishes to investigate.

That's entertaining; observations:
   1) The kernel's checkpatch doesn't hang on it (latest 3.19-rc6)
   2) Ours hangs in the annotate_values function, repeatedly going
around:
main::annotate_values(scripts/checkpatch.pl:859):
859:                    @av_paren_type = ('E') if ($#av_paren_type < 0);
  DB<2> 
main::annotate_values(scripts/checkpatch.pl:860):
860:                    print " <" . join('', @av_paren_type) .
861:                                    "> <$type> <$av_pending>" if ($dbg_values > 1);
  DB<2> 
main::annotate_values(scripts/checkpatch.pl:862):
862:                    if ($cur =~ /^(\s+)/o) {
  DB<2> 
main::annotate_values(scripts/checkpatch.pl:879):
879:                            print "MODIFIER($1)\n" if ($dbg_values > 1);
  DB<2> 
main::annotate_values(scripts/checkpatch.pl:880):
880:                            $type = 'T';
  DB<2> 
main::annotate_values(scripts/checkpatch.pl:1040):
1040:                   if (defined $1) {
  DB<2> 
main::annotate_values(scripts/checkpatch.pl:1041):
1041:                           $cur = substr($cur, length($1));
  DB<2> 
main::annotate_values(scripts/checkpatch.pl:1042):
1042:                           $res .= $type x length($1);

$1=
$cur=float ## s ## _compare_quiet(float ## s a, float ## s b,                 \
$type=T
$res=ETTTT

    3) our annotate_values function is the same as the kernels except
       for one char difference in the 'cast' part, which doesn't fix it.

Dave

> ====begin====
> commit 4b3cf48c7fa455eb3b31dc844c959964e750a025
> Author: Peter Maydell <peter.maydell@linaro.org>
> Date:   Mon Feb 2 18:47:16 2015 +0000
> 
>     This patch will hang checkpatch.pl.
> 
> diff --git a/fpu/softfloat.c b/fpu/softfloat.c
> index 1110a7e..ab6a93c 100644
> @@ -7218,13 +7325,13 @@ static inline int float ## s ##
> _compare_internal(float ## s a, float ## s b,\
>                                                                               \
>  int float ## s ## _compare(float ## s a, float ## s b, float_status *status) \
>  {                                                                            \
> -    return float ## s ## _compare_internal(a, b, 0 STATUS_VAR);              \
> +    return float ## s ## _compare_internal(a, b, 0, status);              \
>  }                                                                            \
>                                                                               \
>  int float ## s ## _compare_quiet(float ## s a, float ## s b,                 \
>                                   float_status *status)                       \
>  {                                                                            \
> -    return float ## s ## _compare_internal(a, b, 1 STATUS_VAR);              \
> +    return float ## s ## _compare_internal(a, b, 1, status);              \
>  }
> 
>  COMPARE(32, 0xff)
> ====endit====
> 
> thanks
> -- PMM
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

  reply	other threads:[~2015-02-03 10:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-02 20:22 [Qemu-devel] This patch hunk will hang scripts/checkpatch.pl Peter Maydell
2015-02-03 10:03 ` Dr. David Alan Gilbert [this message]
2015-02-09 12:18 ` [Qemu-devel] [PATCH] checkpatch: port fix from kernel "## is not a valid modifier" Christian Borntraeger
2015-02-09 14:31   ` Paolo Bonzini
2015-02-09 15:08     ` Christian Borntraeger
2015-02-09 15:59       ` Don Slutz

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=20150203100350.GA2332@work-vm \
    --to=dgilbert@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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 NNTP newsgroup(s).