From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47103) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIaKv-0000ML-Sh for qemu-devel@nongnu.org; Tue, 03 Feb 2015 05:04:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YIaKr-0008Kl-Oz for qemu-devel@nongnu.org; Tue, 03 Feb 2015 05:04:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45140) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIaKr-0008Kd-H9 for qemu-devel@nongnu.org; Tue, 03 Feb 2015 05:03:57 -0500 Date: Tue, 3 Feb 2015 10:03:50 +0000 From: "Dr. David Alan Gilbert" Message-ID: <20150203100350.GA2332@work-vm> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] This patch hunk will hang scripts/checkpatch.pl... List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Developers * 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 > 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