From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.bugs Subject: bug#25679: 26.0.50; Emacs hangs for nested generics Date: Mon, 13 Feb 2017 09:30:14 +0000 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=94eb2c03c8ceeb11260548661834 X-Trace: blaine.gmane.org 1486978281 6780 195.159.176.226 (13 Feb 2017 09:31:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 13 Feb 2017 09:31:21 +0000 (UTC) To: 25679@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Feb 13 10:31:17 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cdCya-0001R1-2s for geb-bug-gnu-emacs@m.gmane.org; Mon, 13 Feb 2017 10:31:16 +0100 Original-Received: from localhost ([::1]:55336 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cdCyf-0001Pi-PX for geb-bug-gnu-emacs@m.gmane.org; Mon, 13 Feb 2017 04:31:21 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45414) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cdCyU-0001OI-53 for bug-gnu-emacs@gnu.org; Mon, 13 Feb 2017 04:31:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cdCyS-0006JT-6f for bug-gnu-emacs@gnu.org; Mon, 13 Feb 2017 04:31:10 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:39625) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cdCyM-0006J0-Fq; Mon, 13 Feb 2017 04:31:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cdCyM-00014O-49; Mon, 13 Feb 2017 04:31:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Philipp Stephani Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Mon, 13 Feb 2017 09:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25679 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: Original-Received: via spool by 25679-submit@debbugs.gnu.org id=B25679.14869782344069 (code B ref 25679); Mon, 13 Feb 2017 09:31:02 +0000 Original-Received: (at 25679) by debbugs.gnu.org; 13 Feb 2017 09:30:34 +0000 Original-Received: from localhost ([127.0.0.1]:37824 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cdCxu-00013Z-7C for submit@debbugs.gnu.org; Mon, 13 Feb 2017 04:30:34 -0500 Original-Received: from mail-ot0-f170.google.com ([74.125.82.170]:32970) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cdCxr-00013J-Es for 25679@debbugs.gnu.org; Mon, 13 Feb 2017 04:30:32 -0500 Original-Received: by mail-ot0-f170.google.com with SMTP id 73so63356265otj.0 for <25679@debbugs.gnu.org>; Mon, 13 Feb 2017 01:30:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=STDYE/0gBBjvaZBeXK5Bb6kkKXAylGmm+idPZAflpWU=; b=En8lfOLwby0HwmKQghaoNevyb25BwCMKrH9eoSwkm6dGbkDYgeb+fec9ZqvTJi26NV 3nGYDHV5smNaZ2tJkGUhK+Or2kkBnuNShIwp+cfJrcQL9zQHqYu3cijLaIz9UE4+tRAy fesBoBeRzIFsa09RNV7MGZsJ+hobCnsUntx4aUMoA4nptp/7eA/zHUsBYf/FzjWjjvLm u5y6uzAhOO6Y5HXjYk3zGx58zofDTQHvrVwuMg9hhzrGN1hn0wttbJUzXC0pxF7PE7AT Szkd1x/myP5LPeFGpTt5BVyNJKiX24K1uQrEfstjyjsgwK/xvcCYiyCPfjbAJnsUHqM7 b6Qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=STDYE/0gBBjvaZBeXK5Bb6kkKXAylGmm+idPZAflpWU=; b=iFa5DUJYz73MtUDOy5USM3NjUJJyGoHzsgS44uPix25M10aZnQYPSBaob7CgOjqkWA JtDcivYwCrkS+GYb6a42PhTCd+6pGCqt9GeKj/JJMhNuRZZD9MLl88IsbgSRi+KjtemW 2EEW963DrBSMCJrVHhoP+jvi8vSwUxg3Fho3h+QRf4Ykx3qkA6AgFyDXIraDMYruUr7K 5DqMeMBolSkkKV8MJOTZbnsn+BqtihxDLmSNeIEIEQh+uECF3Q4YCXnXN/IgA6788GU6 wIS1nEHpOdLgCfFPB7S1tF/rZYKFd/mugcvNqotHT5VhsoBfMEuv2mHpOLc1zqM8xzhH IELg== X-Gm-Message-State: AMke39k18ZMugEEwXG2+RLDD5XaiGP4WkLQMspATAGBolNd+14370UDRerAFlwlaxf7TyA9wjfoAd00kToGpZw== X-Received: by 10.157.3.209 with SMTP id f75mr11033915otf.261.1486978225473; Mon, 13 Feb 2017 01:30:25 -0800 (PST) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:129308 Archived-At: --94eb2c03c8ceeb11260548661834 Content-Type: text/plain; charset=UTF-8 Philipp Stephani schrieb am Fr., 10. Feb. 2017 um 20:28 Uhr: > > Create a file /tmp/Foo.java with the following content: > > class Foo { > void func(A>> a, A>> b, A>> c, A>> d, A>> e, > A>> f, A>> g, A>> h, A>> i, A>> j, A>> k) {} > } > > Then open that file: > > emacs -Q /tmp/Foo.java > > Emacs hangs. C-g also doesn't work. GDB shows the culprit is a > recursive invocation of > > "c-forward-<>-arglist-recur" (0x29dd1f00) > "c-forward-<>-arglist" (0x29dd2530) > "c-forward-name" (0x29dd2d40) > "c-forward-type" (0x29dd3750) > > The actual top of the stack is often GC or a regex match. > Seems the parsing of generic arguments has some exponential behavior. > This is a regression since 24.3, where editing such files has no > noticeable delay. > > > I've tried lowering font-lock-maximum-decoration, it also doesn't appear to help. Even at level 1 Emacs hangs. In general I've got quite a few reports about hangs and slowness in newer versions of CC-Mode. Please make sure it never hangs, if necessary by removing the more complex parsing algorithms and adding hard timeouts to font locking. --94eb2c03c8ceeb11260548661834 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


Philip= p Stephani <p.stephani2@gmail.c= om> schrieb am Fr., 10. Feb. 2017 um 20:28=C2=A0Uhr:

Create a file /tmp/Foo.java with the following content:

class Foo {
=C2=A0 =C2=A0 void func(A<B<C>>> a, A<B<C>>> = b, A<B<C>>> c, A<B<C>>> d, A<B<C>>= ;> e, A<B<C>>> f, A<B<C>>> g, A<B<C&= gt;>> h, A<B<C>>> i, A<B<C>>> j, A<B= <C>>> k) {}
}

Then open that file:

emacs -Q /tmp/Foo.java

Emacs hangs.=C2=A0 C-g also doesn't work.=C2=A0 GDB shows the culprit i= s a
recursive invocation of

"c-forward-<>-arglist-recur" (0x29dd1f00)
"c-forward-<>-arglist" (0x29dd2530)
"c-forward-name" (0x29dd2d40)
"c-forward-type" (0x29dd3750)

The actual top of the stack is often GC or a regex match.
Seems the parsing of generic arguments has some exponential behavior.
This is a regression since 24.3, where editing such files has no
noticeable delay.



I've tried lowering font-lock-maximum-decoration, it also doesn&#= 39;t appear to help. Even at level 1 Emacs hangs.

= In general I've got quite a few reports about hangs and slowness in new= er versions of CC-Mode. Please make sure it never hangs, if necessary by re= moving the more complex parsing algorithms and adding hard timeouts to font= locking.
--94eb2c03c8ceeb11260548661834--