From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Nicholas Drozd Newsgroups: gmane.emacs.bugs Subject: bug#36484: c-mode hangs on macro with comment Date: Tue, 2 Jul 2019 19:36:52 -0500 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="256393"; mail-complaints-to="usenet@blaine.gmane.org" To: 36484@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jul 03 02:40:35 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 1hiTK7-0014bX-Jv for geb-bug-gnu-emacs@m.gmane.org; Wed, 03 Jul 2019 02:40:35 +0200 Original-Received: from localhost ([::1]:58430 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hiTK6-0003y1-Il for geb-bug-gnu-emacs@m.gmane.org; Tue, 02 Jul 2019 20:40:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36886) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hiTHp-00031M-7i for bug-gnu-emacs@gnu.org; Tue, 02 Jul 2019 20:38:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hiTHm-00011F-3g for bug-gnu-emacs@gnu.org; Tue, 02 Jul 2019 20:38:12 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39354) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hiTHe-0000vg-IK for bug-gnu-emacs@gnu.org; Tue, 02 Jul 2019 20:38:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hiTHe-0001T3-DY for bug-gnu-emacs@gnu.org; Tue, 02 Jul 2019 20:38:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Nicholas Drozd Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 03 Jul 2019 00:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 36484 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.15621142465594 (code B ref -1); Wed, 03 Jul 2019 00:38:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 3 Jul 2019 00:37:26 +0000 Original-Received: from localhost ([127.0.0.1]:48175 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hiTH4-0001S9-CA for submit@debbugs.gnu.org; Tue, 02 Jul 2019 20:37:26 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:59616) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hiTGz-0001Rz-IA for submit@debbugs.gnu.org; Tue, 02 Jul 2019 20:37:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35731) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hiTGy-0002a4-9u for bug-gnu-emacs@gnu.org; Tue, 02 Jul 2019 20:37:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hiTGv-00085z-00 for bug-gnu-emacs@gnu.org; Tue, 02 Jul 2019 20:37:19 -0400 Original-Received: from mail-oi1-x22f.google.com ([2607:f8b0:4864:20::22f]:45300) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hiTGu-0007zi-PE for bug-gnu-emacs@gnu.org; Tue, 02 Jul 2019 20:37:16 -0400 Original-Received: by mail-oi1-x22f.google.com with SMTP id m206so534640oib.12 for ; Tue, 02 Jul 2019 17:37:06 -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=GbM6JIckpt1IBArIEIJsLiP1hwpVAwWB/L0manjxiW0=; b=eRtsFm58zkTc83vPmBuwJNV5+9UpRXi05DMRKRnv1x1oG8yA4LhN1OiZlafp8UsLv2 RgFnm7CBxbcgTectMdU94Q4leMhT4+CCUMy1+I4y0JcoxuaFd275Dz90BFnbs9v/7MrW sAgXppz466TcskqqI5ByrbcBg4qrq0jN7bNai3GQ1+QgzoEn6Zu8YTnaE2+ZIVKQsMX0 hIK4zVTWVu5bCxgrl1dv43IHFoGhhJTPHuEaUK1yRxjfgYXdk/ICfGovrX67Zw7Clr4P y/WuvSBQpLybvFP4pgP9SygplpuES46b5JgqslgGpQWZxkOU3ekD7eWWUKlZQk3myJCN gwvA== 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=GbM6JIckpt1IBArIEIJsLiP1hwpVAwWB/L0manjxiW0=; b=dCHmMcTII0a+sHqcFS6g1xaO+qWs9oyT6N5ft2iHnRFNxUFBhVvgmYYILxafhhFOOr Ajqe5BTOezw+GeD2+GFPWAuaQPVA5+NzVw/yw08Asz1UEiRJBiG5+k619lryzf3sU0jn Ks06HBpmDaXt9bR4Jd8Lrm4Zky/bE8PEASFl4Y7PcifGwMGxT/L1+jei8OgFCcWEcNCS jSogxaKFaqB8w1/QqAQdi/+GBhdH3ApWeIzW1NXW90dTH4Y3RfOMLU6rMm2ojh+jSz5C LlBedoGY5+erWIO4Kcraidj+roT7cvfKWdc49YPHh1MdrvN/hXTjToYiwzZ/VoAFI6I1 Ga0w== X-Gm-Message-State: APjAAAWb4jrquZxhwAV62jGXFKjyMtrwZhx6ENlMkjs6JMG3pVRiGyjB JYXaWnob15XjzjBN/SpoHv20WmyGWjUke5wR3G+HNrEGjiI= X-Google-Smtp-Source: APXvYqxTZghKtkGgpIVJly6kH7evR61K65bejT8OVNjD+8xhM7Hlpa4OEz+ujFbmDXFjwQiueWm17nfYPv85EOMK0Lc= X-Received: by 2002:aca:ba02:: with SMTP id k2mr4529359oif.70.1562114225081; Tue, 02 Jul 2019 17:37:05 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. 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:161997 Archived-At: Here's a simple C program: #define x /***/5 int main(void) { return x; } `gcc -Wall` compiles it without any warnings, but opening it causes Emacs to hang, and sometimes even to freeze hard. It has something to do with the macro, but I haven't been able to figure out exactly what's going on. Here's a test function with an even smaller reproducing example: (defun c-mode-hang () (interactive) (with-temp-buffer (insert "#define /***/5") (c-mode))) Running that function under the profiler suggests that the problem is in `c-end-of-macro`: - c-extend-region-for-CPP 13869 98% - c-end-of-macro 10470 74% c-forward-single-comment 2759 19% This may have something to do with commit 39acaf, or maybe 6b5388. GNU Emacs 27.0.50 (build 6, x86_64-pc-linux-gnu, GTK+ Version 3.22.30) of 2019-06-30