From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Zachary Napier Newsgroups: gmane.emacs.bugs Subject: bug#37137: Setting font-lock-case-fold-search to t causes hangs on certain types in c-mode Date: Wed, 21 Aug 2019 15:20:20 -0700 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000002b6eca0590a7fbf6" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="184965"; mail-complaints-to="usenet@blaine.gmane.org" To: 37137@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 22 01:11:18 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1i0Zl8-000m0g-42 for geb-bug-gnu-emacs@m.gmane.org; Thu, 22 Aug 2019 01:11:18 +0200 Original-Received: from localhost ([::1]:36964 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0Zl6-0008A1-Ho for geb-bug-gnu-emacs@m.gmane.org; Wed, 21 Aug 2019 19:11:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47259) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0Zkt-00086O-Gs for bug-gnu-emacs@gnu.org; Wed, 21 Aug 2019 19:11:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0Zks-0007WZ-Gg for bug-gnu-emacs@gnu.org; Wed, 21 Aug 2019 19:11:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56197) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0Zks-0007WR-Dp for bug-gnu-emacs@gnu.org; Wed, 21 Aug 2019 19:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1i0Zks-0006Vk-6S for bug-gnu-emacs@gnu.org; Wed, 21 Aug 2019 19:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Zachary Napier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 21 Aug 2019 23:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 37137 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.156642902724977 (code B ref -1); Wed, 21 Aug 2019 23:11:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 21 Aug 2019 23:10:27 +0000 Original-Received: from localhost ([127.0.0.1]:36785 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i0ZkI-0006Ul-HH for submit@debbugs.gnu.org; Wed, 21 Aug 2019 19:10:27 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:47212) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i0Yy3-00012T-FP for submit@debbugs.gnu.org; Wed, 21 Aug 2019 18:20:35 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38949) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0Yy2-0001gA-6X for bug-gnu-emacs@gnu.org; Wed, 21 Aug 2019 18:20:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0Yy1-0001Ji-3F for bug-gnu-emacs@gnu.org; Wed, 21 Aug 2019 18:20:34 -0400 Original-Received: from mail-io1-xd35.google.com ([2607:f8b0:4864:20::d35]:41554) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0Yy0-0001JA-TI for bug-gnu-emacs@gnu.org; Wed, 21 Aug 2019 18:20:33 -0400 Original-Received: by mail-io1-xd35.google.com with SMTP id j5so7859144ioj.8 for ; Wed, 21 Aug 2019 15:20:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=iARbKtPn2BqYoX5XJwjWwKcuH+OPlkmRYOvtnRfZ4v0=; b=sHs1/xBCrjvM+ZPOPVw2gSQ184N54hcqxBUZ4QnN/Zn61nZtVAtuToRKqJqmIiP16L +b8ZeIHQJJu2YNxtKGU01A8mqRqRa6pB5L17XL1IS2HG3SHXTbwWJZsm+pFwAblrO1I8 Yq1Ss1hAlHig+PlzN0tNrIIhhBNvsMBJocgY9IazhdipHmn3v8qAv9LMWbcsGoznu2uC S10PU8D4zPOGxkNceCoh1N1oFmXQwtxquMUAHMYqdW8LDsD0B0nmJFAC9Ne9D0gpoZox MWeqIXdPjbKaCqobnRfWPyC6xu/kpoE47gP3HyvNaG5hqHtkBMAoBaG9sLWpoVsO3XYv WzmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=iARbKtPn2BqYoX5XJwjWwKcuH+OPlkmRYOvtnRfZ4v0=; b=f3HH5A/p95f9Dc38siFeDsVXgr4YU2PSpLdCg9o0iLEbEWXuL1HkhuMFcmkBLJoxR/ tw1nOfWHBoDXchkivXs4BPA0AjhryecbyFNWQndvXnOzLHZh0XQ+j4zUENB7fxMb3+yT 7OflYyGB/Ad/dhPItiJAVP/nInOM9TlmoHwopWDsydNd0Cristpin/oBsSEn+dN2QDhZ QkC1X6urc/yRLHa+VKPrEhxMA5hDiQhwa8zM0UmtF9LwjDvaT9kB4u3SUdmXXiGJMQbt 1bN5c8cxGfSdv21rvVfWFRNjM3b4KY4kl5xK53Mn2M2yFGBaTiwztFE8WzGAlhWtbJZL SwLw== X-Gm-Message-State: APjAAAVpUKrUorIglWE7tXGTpsXa1aucPXW71i05Jov2riXkHLTJzoxQ 3cDhyG7xUMTtuIWSgy8BsAKkEgaNSiTVgBvfnPgjaUo8dAg= X-Google-Smtp-Source: APXvYqyawlSfG5kQ9Uqr+4KFa+9cglzy0JuSvIuJTx9d7IS4moCyMK4gVWhlWSgevmDmxKihjI0qzbtcjhGV+irFXts= X-Received: by 2002:a6b:3ed4:: with SMTP id l203mr40958725ioa.275.1566426031417; Wed, 21 Aug 2019 15:20:31 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Mailman-Approved-At: Wed, 21 Aug 2019 19:10:24 -0400 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: 209.51.188.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:165539 Archived-At: --0000000000002b6eca0590a7fbf6 Content-Type: text/plain; charset="UTF-8" I have in my .emacs file only these two lines: (custom-set-variables '(font-lock-keywords-case-fold-search t)) Then if I visit an empty or nonexistent C file and just type "LONG" (in all caps or with at least one letter being capital), Emacs will hang after typing the final G but before the G appears on screen. Typing C-g a couple of times gets Emacs unstuck until I continue to type. The same behavior also happens if I type "SHORT". This happens in both Emacs 26.1 in text mode on a Linux machine and in Emacs 25.3 in GUI mode on Windows. After messing with GDB a bit, I am pretty sure the hang is at the while loop in c-forward-type at cc-engine.el:7657 and its getting stuck because looking-at matches LONG because its case insensitive, but the c-forward-keyword-clause doesn't move forward because the first thing it does is try to find "LONG" in c-keywords-obarray via `intern-soft` and immediately returns because it doesn't find it there. Here is the while loop: (while (progn (setq safe-pos (point)) (looking-at c-opt-type-component-key)) (when (and c-record-type-identifiers (looking-at c-primitive-type-key)) (c-record-type-id (cons (match-beginning 1) (match-end 1)))) (c-forward-keyword-clause 1)) --0000000000002b6eca0590a7fbf6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I have in my .emacs file only these two lines:

=C2= =A0 =C2=A0 (custom-set-variables
=C2=A0 =C2=A0 =C2=A0'(font-lock-key= words-case-fold-search t))

Then if I visit an empty or nonexistent C= file and just type "LONG"
(in all caps or with at least one l= etter being capital), Emacs will
hang after typing the final G but befor= e the G appears on
screen. Typing C-g a couple of times gets Emacs unstu= ck until I
continue to type. The same behavior also happens if I type &q= uot;SHORT".

This happens in both Emacs 26.1 in text mode on a L= inux machine and in
Emacs 25.3 in GUI mode on Windows.

After mess= ing with GDB a bit, I am pretty sure the hang is at the
while loop in c-= forward-type at cc-engine.el:7657 and its getting
stuck because looking-= at matches LONG because its case insensitive,
but the c-forward-keyword-= clause doesn't move forward because the
first thing it does is try t= o find "LONG" in c-keywords-obarray via
`intern-soft` and imme= diately returns because it doesn't find it
there. Here is the while = loop:

=C2=A0 =C2=A0 (while (progn
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0(setq safe-pos (point))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0(looking-at c-opt-type-component-key))
=C2=A0 =C2=A0 = =C2=A0 (when (and c-record-type-identifiers
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(looking-at c-primitive-type-key))
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 (c-record-type-id (cons (match-beginning 1)
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (match-end 1))))
=C2=A0 =C2=A0 =C2=A0= (c-forward-keyword-clause 1))
--0000000000002b6eca0590a7fbf6--