From unknown Sun Sep 07 01:05:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#28233: CC Mode 5.33 (C/*l); Emacs may get stuck with 100% CPU Resent-From: Mohammed Sadiq Original-Sender: "Debbugs-submit" Resent-CC: bug-cc-mode@gnu.org Resent-Date: Fri, 25 Aug 2017 15:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 28233 X-GNU-PR-Package: cc-mode X-GNU-PR-Keywords: To: 28233@debbugs.gnu.org X-Debbugs-Original-To: submit@debbugs.gnu.org Received: via spool by submit@debbugs.gnu.org id=B.150367509115684 (code B ref -1); Fri, 25 Aug 2017 15:32:01 +0000 Received: (at submit) by debbugs.gnu.org; 25 Aug 2017 15:31:31 +0000 Received: from localhost ([127.0.0.1]:54637 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlGa3-00044t-9A for submit@debbugs.gnu.org; Fri, 25 Aug 2017 11:31:31 -0400 Received: from us2-ob2-5.mailhostbox.com ([162.210.70.34]:35167) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlGa1-00044k-DI for submit@debbugs.gnu.org; Fri, 25 Aug 2017 11:31:29 -0400 Received: from rose (unknown [117.246.75.122]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: sadiq@sadiqpk.org) by us2.outbound.mailhostbox.com (Postfix) with ESMTPSA id 683C3780E76 for ; Fri, 25 Aug 2017 15:31:20 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sadiqpk.org; s=20160628; t=1503675083; bh=fT9BiY6wOV4FBVi4YRLHQeT4VnHcscIj50QpNZvyhX8=; h=From:To:Subject:Date; b=T0en3lG28PkAF/n9K/YqN6z7tVOF74l1tvESqQfUABRnCk9PG/ee3XSlx6kR0Xjtj 6mCYrGhzbIp9zzulO/Apg+6hy1STaMmURtoGlDz/nBLjUBlHYPXbB1gmScS+Ohl0Xc 42Ejv4IF30sGR9xjj3/uZQGPCnuyrTG3t6aqeFQk= From: Mohammed Sadiq Date: Fri, 25 Aug 2017 21:00:52 +0530 Message-ID: <87zianu0k3.fsf@rose> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-CMAE-Score: 0 X-CMAE-Analysis: v=2.2 cv=LqTi8jVc c=1 sm=1 tr=0 a=dOLgxod41YkGJyPifcCeew==:117 a=dOLgxod41YkGJyPifcCeew==:17 a=IkcTkHD0fZMA:10 a=2F9q2Pgpgg23imZES14A:9 a=QEXdDO2ut3YA:10 X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Emacs always get stuck when writing some code (given below), using 100 % CP= U for (probably) limitless time: How to reproduce: 1. Open a new empty file: emacs -Q test.c 2. Write the following (| is where the point is) #include<| 3. Delete the content: C-a C-k 4. Try to write the same again: #include<| Result: At the 4th step, after typing #,GNU Emacs begins to use full CPU and does nothing. Though this can be cancelled using C-g. Emacs : GNU Emacs 26.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22= .11) of 2017-08-25 Package: CC Mode 5.33 (C/*l) Buffer Style: gnu c-emacs-features: (pps-extended-state col-0-paren posix-char-classes gen-st= ring-delim gen-comment-delim syntax-properties 1-bit) current state: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (setq c-basic-offset 2 c-comment-only-line-offset '(0 . 0) c-indent-comment-alist '((anchored-comment column . 0) (end-block space . = 1) (cpp-end-block space . 2)) c-indent-comments-syntactically-p nil c-block-comment-prefix "" c-comment-prefix-regexp '((pike-mode . "//+!?\\|\\**") (awk-mode . "#+") (other . "//+\\|\\**")) c-doc-comment-style '((java-mode . javadoc) (pike-mode . autodoc) (c-mode . gtkdoc)) c-cleanup-list '(scope-operator) c-hanging-braces-alist '((substatement-open before after) (arglist-cont-nonempty)) c-hanging-colons-alist nil c-hanging-semi&comma-criteria '(c-semi&comma-inside-parenlist) c-backslash-column 48 c-backslash-max-column 72 c-special-indent-hook '(c-gnu-impose-minimum) c-label-minimum-indentation 1 c-offsets-alist '((inexpr-class . +) (inexpr-statement . +) (lambda-intro-cont . +) (inlambda . c-lineup-inexpr-block) (template-args-cont c-lineup-template-args +) (incomposition . +) (inmodule . +) (innamespace . +) (inextern-lang . +) (composition-close . 0) (module-close . 0) (namespace-close . 0) (extern-lang-close . 0) (composition-open . 0) (module-open . 0) (namespace-open . 0) (extern-lang-open . 0) (objc-method-call-cont c-lineup-ObjC-method-call-colons c-lineup-ObjC-method-call + ) (objc-method-args-cont . c-lineup-ObjC-method-args) (objc-method-intro . [0]) (friend . 0) (cpp-define-intro c-lineup-cpp-define +) (cpp-macro-cont . +) (cpp-macro . [0]) (inclass . +) (stream-op . c-lineup-streamop) (arglist-cont-nonempty c-lineup-gcc-asm-reg c-lineup-arglist ) (arglist-cont c-lineup-gcc-asm-reg 0) (comment-intro c-lineup-knr-region-comment c-lineup-comment) (catch-clause . 0) (else-clause . 0) (do-while-closure . 0) (access-label . -) (case-label . 0) (substatement . +) (statement-case-intro . +) (statement . 0) (brace-entry-open . 0) (brace-list-entry . c-lineup-under-anchor) (brace-list-close . 0) (block-close . 0) (block-open . 0) (inher-cont . c-lineup-multi-inher) (inher-intro . +) (member-init-cont . c-lineup-multi-inher) (member-init-intro . +) (annotation-var-cont . +) (annotation-top-cont . 0) (topmost-intro . 0) (knr-argdecl . 0) (func-decl-cont . +) (inline-close . 0) (class-close . 0) (class-open . 0) (defun-block-intro . +) (defun-close . 0) (defun-open . 0) (c . c-lineup-C-comments) (string . c-lineup-dont-change) (topmost-intro-cont first c-lineup-topmost-intro-cont c-lineup-gnu-DEFUN-intro-cont ) (brace-list-intro . c-lineup-arglist-intro-after-paren) (brace-list-open . +) (inline-open . 0) (arglist-close . c-lineup-arglist) (arglist-intro . c-lineup-arglist-intro-after-paren) (statement-cont . +) (statement-case-open . +) (label . 0) (substatement-label . 0) (substatement-open . +) (knr-argdecl-intro . 5) (statement-block-intro . +) ) c-buffer-is-cc-mode 'c-mode c-tab-always-indent t c-syntactic-indentation t c-syntactic-indentation-in-macros t c-ignore-auto-fill '(string cpp code) c-auto-align-backslashes t c-backspace-function 'backward-delete-char-untabify c-delete-function 'delete-char c-electric-pound-behavior nil c-default-style '((java-mode . "java") (awk-mode . "awk") (other . "gnu")) c-enable-xemacs-performance-kludge-p nil c-old-style-variable-behavior nil defun-prompt-regexp nil tab-width 8 comment-column 32 parse-sexp-ignore-comments t parse-sexp-lookup-properties t auto-fill-function nil comment-multi-line t comment-start-skip "\\(//+\\|/\\*+\\)\\s *" fill-prefix nil fill-column 70 paragraph-start "[ ]*\\(//+\\|\\**\\)[ ]*$\\|^\f" adaptive-fill-mode t adaptive-fill-regexp "[ ]*\\(//+\\|\\**\\)[ ]*\\([ ]*\\([-=E2=80=93!|#%= ;>*=C2=B7=E2=80=A2=E2=80=A3=E2=81=83=E2=97=A6]+[ ]*\\)*\\)" ) From unknown Sun Sep 07 01:05:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#28233: CC Mode 5.33 (C/*l); Emacs may get stuck with 100% CPU Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-cc-mode@gnu.org Resent-Date: Sat, 26 Aug 2017 17:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28233 X-GNU-PR-Package: cc-mode X-GNU-PR-Keywords: To: Mohammed Sadiq Cc: 28233@debbugs.gnu.org Received: via spool by 28233-submit@debbugs.gnu.org id=B28233.1503768696410 (code B ref 28233); Sat, 26 Aug 2017 17:32:02 +0000 Received: (at 28233) by debbugs.gnu.org; 26 Aug 2017 17:31:36 +0000 Received: from localhost ([127.0.0.1]:56806 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlevn-00006Y-Q7 for submit@debbugs.gnu.org; Sat, 26 Aug 2017 13:31:36 -0400 Received: from ocolin.muc.de ([193.149.48.4]:52259 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1dlevm-00006Q-60 for 28233@debbugs.gnu.org; Sat, 26 Aug 2017 13:31:34 -0400 Received: (qmail 28045 invoked by uid 3782); 26 Aug 2017 17:31:33 -0000 Received: from acm.muc.de (p548C6583.dip0.t-ipconnect.de [84.140.101.131]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 26 Aug 2017 19:31:32 +0200 Received: (qmail 26841 invoked by uid 1000); 26 Aug 2017 17:29:06 -0000 Date: Sat, 26 Aug 2017 17:29:06 +0000 Message-ID: <20170826172906.GD5508@ACM> References: <87zianu0k3.fsf@rose> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87zianu0k3.fsf@rose> User-Agent: Mutt/1.7.2 (2016-11-26) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Hello, Mohammed. On Fri, Aug 25, 2017 at 21:00:52 +0530, Mohammed Sadiq wrote: > Emacs always get stuck when writing some code (given below), using 100 % CPU for > (probably) limitless time: > How to reproduce: > 1. Open a new empty file: emacs -Q test.c > 2. Write the following (| is where the point is) > #include<| > 3. Delete the content: C-a C-k > 4. Try to write the same again: > #include<| > Result: > At the 4th step, after typing #,GNU Emacs begins to use full CPU and > does nothing. Though this can be cancelled using C-g. Yes. There is a bug in some cache handling code for macros, which results in that cache thinking there's still a macro after it's been deleted. Thanks indeed for the bug report! Would you please apply the following patch, then confirm to me that it's fixed the problem, or else tell me what's still not working. Thanks! diff -r dbf1a31b3959 cc-engine.el --- a/cc-engine.el Tue Aug 22 16:38:44 2017 +0000 +++ b/cc-engine.el Sat Aug 26 17:24:49 2017 +0000 @@ -250,7 +250,7 @@ ;; Called from a before-change function. If the change region is before or ;; in the macro characterized by `c-macro-cache' etc., nullify it ;; appropriately. BEG and END are the standard before-change-functions - ;; parameters. END isn't used. + ;; parameters. (cond ((null c-macro-cache)) ((< beg (car c-macro-cache)) @@ -258,6 +258,12 @@ c-macro-cache-start-pos nil c-macro-cache-syntactic nil c-macro-cache-no-comment nil)) + ((and (= beg (car c-macro-cache)) + (> end beg)) + (setq c-macro-cache nil + c-macro-cache-start-pos nil + c-macro-cache-syntactic nil + c-macro-cache-no-comment nil)) ((and (cdr c-macro-cache) (< beg (cdr c-macro-cache))) (setcdr c-macro-cache nil) [ CC Mode configuration dump appreciated, but snipped. ] -- Alan Mackenzie (Nuremberg, Germany). From unknown Sun Sep 07 01:05:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#28233: CC Mode 5.33 (C/*l); Emacs may get stuck with 100% CPU Resent-From: Mohammed Sadiq Original-Sender: "Debbugs-submit" Resent-CC: bug-cc-mode@gnu.org Resent-Date: Sun, 27 Aug 2017 01:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28233 X-GNU-PR-Package: cc-mode X-GNU-PR-Keywords: To: Alan Mackenzie Cc: 28233@debbugs.gnu.org Received: via spool by 28233-submit@debbugs.gnu.org id=B28233.150379705616110 (code B ref 28233); Sun, 27 Aug 2017 01:25:01 +0000 Received: (at 28233) by debbugs.gnu.org; 27 Aug 2017 01:24:16 +0000 Received: from localhost ([127.0.0.1]:56926 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlmJD-0004Bl-KC for submit@debbugs.gnu.org; Sat, 26 Aug 2017 21:24:15 -0400 Received: from us2-ob2-2.mailhostbox.com ([162.210.70.54]:51264) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlmJA-0004Bc-O7 for 28233@debbugs.gnu.org; Sat, 26 Aug 2017 21:24:13 -0400 Received: from 172.16.214.18 (unknown [172.16.214.18]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: sadiq@sadiqpk.org) by us2.outbound.mailhostbox.com (Postfix) with ESMTPSA id 0E8F8780457; Sun, 27 Aug 2017 01:24:12 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sadiqpk.org; s=20160628; t=1503797052; bh=plraQU9oaY2bubrFl9ksNrwMktkdtxjA6E7HkEAcMNI=; h=Date:From:To:Cc:In-Reply-To:References:Subject; b=Z7yKSOk3+sE+8mofojmkVP5SBj4oWU2EM7enot1PEfnpuEtHMLV8KtUwABiefnzas mbvGEZHn8/nWgIII6tlGPEb5UFB7ddP8cRP4c8/QdumCzhSEpuH9pxATp8Vre1FDjq W4B1EpAe1M6rO0Qsobpq2wgqoxolOLMoP3uPrWDA= Date: Sun, 27 Aug 2017 06:54:11 +0530 (IST) From: Mohammed Sadiq Message-ID: <685795841.1652.1503797052004@webmail.mailhostbox.com> In-Reply-To: <20170826172906.GD5508@ACM> References: <87zianu0k3.fsf@rose> <20170826172906.GD5508@ACM> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Medium X-Mailer: Open-Xchange Mailer v7.8.3-Rev22 X-Originating-Client: open-xchange-appsuite X-CMAE-Score: 0 X-CMAE-Analysis: v=2.2 cv=LqTi8jVc c=1 sm=1 tr=0 a=GlHdamnDIlsbq1OOjikDKg==:117 a=IkcTkHD0fZMA:10 a=mihs5PoCAHu94vDl7FcA:9 a=QEXdDO2ut3YA:10 X-Spam-Score: 1.5 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: > On August 26, 2017 at 10:59 PM Alan Mackenzie wrote: > > > Hello, Mohammed. > Hi > Yes. There is a bug in some cache handling code for macros, which > results in that cache thinking there's still a macro after it's been > deleted. > > Thanks indeed for the bug report! > > Would you please apply the following patch, then confirm to me that it's > fixed the problem, or else tell me what's still not working. Thanks! > [...] Content analysis details: (1.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [162.210.70.54 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid 1.5 FSL_HELO_BARE_IP_2 No description available. X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) > On August 26, 2017 at 10:59 PM Alan Mackenzie wrote: > > > Hello, Mohammed. > Hi > Yes. There is a bug in some cache handling code for macros, which > results in that cache thinking there's still a macro after it's been > deleted. > > Thanks indeed for the bug report! > > Would you please apply the following patch, then confirm to me that it's > fixed the problem, or else tell me what's still not working. Thanks! > The patch surely fixed the issue. Thanks By the way, the patch wasn't applying to the current HEAD of emacs git. I had to manually add those lines it. Is it built from some other source? Alternatively, can I say patch to skip some n lines (positive or negative) than the ones said in diff and try to apply? From unknown Sun Sep 07 01:05:49 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Mohammed Sadiq Subject: bug#28233: closed (Re: bug#28233: CC Mode 5.33 (C/*l); Emacs may get stuck with 100% CPU) Message-ID: References: <20170827104716.GB3520@ACM> <87zianu0k3.fsf@rose> X-Gnu-PR-Message: they-closed 28233 X-Gnu-PR-Package: cc-mode Reply-To: 28233@debbugs.gnu.org Date: Sun, 27 Aug 2017 10:50:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1503831002-1248-1" This is a multi-part message in MIME format... ------------=_1503831002-1248-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #28233: CC Mode 5.33 (C/*l); Emacs may get stuck with 100% CPU which was filed against the cc-mode package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 28233@debbugs.gnu.org. --=20 28233: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D28233 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1503831002-1248-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 28233-done) by debbugs.gnu.org; 27 Aug 2017 10:49:53 +0000 Received: from localhost ([127.0.0.1]:57050 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlv8b-0000Jj-E1 for submit@debbugs.gnu.org; Sun, 27 Aug 2017 06:49:53 -0400 Received: from ocolin.muc.de ([193.149.48.4]:42566 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1dlv8Z-0000Ja-DD for 28233-done@debbugs.gnu.org; Sun, 27 Aug 2017 06:49:52 -0400 Received: (qmail 392 invoked by uid 3782); 27 Aug 2017 10:49:50 -0000 Received: from acm.muc.de (p548C7E25.dip0.t-ipconnect.de [84.140.126.37]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 27 Aug 2017 12:49:49 +0200 Received: (qmail 5633 invoked by uid 1000); 27 Aug 2017 10:47:16 -0000 Date: Sun, 27 Aug 2017 10:47:16 +0000 To: Mohammed Sadiq Subject: Re: bug#28233: CC Mode 5.33 (C/*l); Emacs may get stuck with 100% CPU Message-ID: <20170827104716.GB3520@ACM> References: <87zianu0k3.fsf@rose> <20170826172906.GD5508@ACM> <685795841.1652.1503797052004@webmail.mailhostbox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <685795841.1652.1503797052004@webmail.mailhostbox.com> User-Agent: Mutt/1.7.2 (2016-11-26) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 28233-done Cc: 28233-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Hello, Mohammed. On Sun, Aug 27, 2017 at 06:54:11 +0530, Mohammed Sadiq wrote: > > On August 26, 2017 at 10:59 PM Alan Mackenzie wrote: > > Hello, Mohammed. > Hi > > Yes. There is a bug in some cache handling code for macros, which > > results in that cache thinking there's still a macro after it's been > > deleted. > > Thanks indeed for the bug report! > > Would you please apply the following patch, then confirm to me that it's > > fixed the problem, or else tell me what's still not working. Thanks! > > The patch surely fixed the issue. Thanks I actually committed a rather simpler patch. The problem was "merely" an off-by-1 bug, but in the same function. [ .... ] -- Alan Mackenzie (Nuremberg, Germany). ------------=_1503831002-1248-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 25 Aug 2017 15:31:31 +0000 Received: from localhost ([127.0.0.1]:54637 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlGa3-00044t-9A for submit@debbugs.gnu.org; Fri, 25 Aug 2017 11:31:31 -0400 Received: from us2-ob2-5.mailhostbox.com ([162.210.70.34]:35167) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlGa1-00044k-DI for submit@debbugs.gnu.org; Fri, 25 Aug 2017 11:31:29 -0400 Received: from rose (unknown [117.246.75.122]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: sadiq@sadiqpk.org) by us2.outbound.mailhostbox.com (Postfix) with ESMTPSA id 683C3780E76 for ; Fri, 25 Aug 2017 15:31:20 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sadiqpk.org; s=20160628; t=1503675083; bh=fT9BiY6wOV4FBVi4YRLHQeT4VnHcscIj50QpNZvyhX8=; h=From:To:Subject:Date; b=T0en3lG28PkAF/n9K/YqN6z7tVOF74l1tvESqQfUABRnCk9PG/ee3XSlx6kR0Xjtj 6mCYrGhzbIp9zzulO/Apg+6hy1STaMmURtoGlDz/nBLjUBlHYPXbB1gmScS+Ohl0Xc 42Ejv4IF30sGR9xjj3/uZQGPCnuyrTG3t6aqeFQk= From: Mohammed Sadiq To: submit@debbugs.gnu.org Subject: CC Mode 5.33 (C/*l); Emacs may get stuck with 100% CPU X-Debbugs-Package: cc-mode Date: Fri, 25 Aug 2017 21:00:52 +0530 Message-ID: <87zianu0k3.fsf@rose> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-CMAE-Score: 0 X-CMAE-Analysis: v=2.2 cv=LqTi8jVc c=1 sm=1 tr=0 a=dOLgxod41YkGJyPifcCeew==:117 a=dOLgxod41YkGJyPifcCeew==:17 a=IkcTkHD0fZMA:10 a=2F9q2Pgpgg23imZES14A:9 a=QEXdDO2ut3YA:10 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Emacs always get stuck when writing some code (given below), using 100 % CP= U for (probably) limitless time: How to reproduce: 1. Open a new empty file: emacs -Q test.c 2. Write the following (| is where the point is) #include<| 3. Delete the content: C-a C-k 4. Try to write the same again: #include<| Result: At the 4th step, after typing #,GNU Emacs begins to use full CPU and does nothing. Though this can be cancelled using C-g. Emacs : GNU Emacs 26.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22= .11) of 2017-08-25 Package: CC Mode 5.33 (C/*l) Buffer Style: gnu c-emacs-features: (pps-extended-state col-0-paren posix-char-classes gen-st= ring-delim gen-comment-delim syntax-properties 1-bit) current state: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (setq c-basic-offset 2 c-comment-only-line-offset '(0 . 0) c-indent-comment-alist '((anchored-comment column . 0) (end-block space . = 1) (cpp-end-block space . 2)) c-indent-comments-syntactically-p nil c-block-comment-prefix "" c-comment-prefix-regexp '((pike-mode . "//+!?\\|\\**") (awk-mode . "#+") (other . "//+\\|\\**")) c-doc-comment-style '((java-mode . javadoc) (pike-mode . autodoc) (c-mode . gtkdoc)) c-cleanup-list '(scope-operator) c-hanging-braces-alist '((substatement-open before after) (arglist-cont-nonempty)) c-hanging-colons-alist nil c-hanging-semi&comma-criteria '(c-semi&comma-inside-parenlist) c-backslash-column 48 c-backslash-max-column 72 c-special-indent-hook '(c-gnu-impose-minimum) c-label-minimum-indentation 1 c-offsets-alist '((inexpr-class . +) (inexpr-statement . +) (lambda-intro-cont . +) (inlambda . c-lineup-inexpr-block) (template-args-cont c-lineup-template-args +) (incomposition . +) (inmodule . +) (innamespace . +) (inextern-lang . +) (composition-close . 0) (module-close . 0) (namespace-close . 0) (extern-lang-close . 0) (composition-open . 0) (module-open . 0) (namespace-open . 0) (extern-lang-open . 0) (objc-method-call-cont c-lineup-ObjC-method-call-colons c-lineup-ObjC-method-call + ) (objc-method-args-cont . c-lineup-ObjC-method-args) (objc-method-intro . [0]) (friend . 0) (cpp-define-intro c-lineup-cpp-define +) (cpp-macro-cont . +) (cpp-macro . [0]) (inclass . +) (stream-op . c-lineup-streamop) (arglist-cont-nonempty c-lineup-gcc-asm-reg c-lineup-arglist ) (arglist-cont c-lineup-gcc-asm-reg 0) (comment-intro c-lineup-knr-region-comment c-lineup-comment) (catch-clause . 0) (else-clause . 0) (do-while-closure . 0) (access-label . -) (case-label . 0) (substatement . +) (statement-case-intro . +) (statement . 0) (brace-entry-open . 0) (brace-list-entry . c-lineup-under-anchor) (brace-list-close . 0) (block-close . 0) (block-open . 0) (inher-cont . c-lineup-multi-inher) (inher-intro . +) (member-init-cont . c-lineup-multi-inher) (member-init-intro . +) (annotation-var-cont . +) (annotation-top-cont . 0) (topmost-intro . 0) (knr-argdecl . 0) (func-decl-cont . +) (inline-close . 0) (class-close . 0) (class-open . 0) (defun-block-intro . +) (defun-close . 0) (defun-open . 0) (c . c-lineup-C-comments) (string . c-lineup-dont-change) (topmost-intro-cont first c-lineup-topmost-intro-cont c-lineup-gnu-DEFUN-intro-cont ) (brace-list-intro . c-lineup-arglist-intro-after-paren) (brace-list-open . +) (inline-open . 0) (arglist-close . c-lineup-arglist) (arglist-intro . c-lineup-arglist-intro-after-paren) (statement-cont . +) (statement-case-open . +) (label . 0) (substatement-label . 0) (substatement-open . +) (knr-argdecl-intro . 5) (statement-block-intro . +) ) c-buffer-is-cc-mode 'c-mode c-tab-always-indent t c-syntactic-indentation t c-syntactic-indentation-in-macros t c-ignore-auto-fill '(string cpp code) c-auto-align-backslashes t c-backspace-function 'backward-delete-char-untabify c-delete-function 'delete-char c-electric-pound-behavior nil c-default-style '((java-mode . "java") (awk-mode . "awk") (other . "gnu")) c-enable-xemacs-performance-kludge-p nil c-old-style-variable-behavior nil defun-prompt-regexp nil tab-width 8 comment-column 32 parse-sexp-ignore-comments t parse-sexp-lookup-properties t auto-fill-function nil comment-multi-line t comment-start-skip "\\(//+\\|/\\*+\\)\\s *" fill-prefix nil fill-column 70 paragraph-start "[ ]*\\(//+\\|\\**\\)[ ]*$\\|^\f" adaptive-fill-mode t adaptive-fill-regexp "[ ]*\\(//+\\|\\**\\)[ ]*\\([ ]*\\([-=E2=80=93!|#%= ;>*=C2=B7=E2=80=A2=E2=80=A3=E2=81=83=E2=97=A6]+[ ]*\\)*\\)" ) ------------=_1503831002-1248-1-- From unknown Sun Sep 07 01:05:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#28233: CC Mode 5.33 (C/*l); Emacs may get stuck with 100% CPU Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-cc-mode@gnu.org Resent-Date: Sun, 27 Aug 2017 11:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28233 X-GNU-PR-Package: cc-mode X-GNU-PR-Keywords: To: Mohammed Sadiq Cc: 28233@debbugs.gnu.org Received: via spool by 28233-submit@debbugs.gnu.org id=B28233.15038316082210 (code B ref 28233); Sun, 27 Aug 2017 11:01:02 +0000 Received: (at 28233) by debbugs.gnu.org; 27 Aug 2017 11:00:08 +0000 Received: from localhost ([127.0.0.1]:57068 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlvIW-0000ZZ-GI for submit@debbugs.gnu.org; Sun, 27 Aug 2017 07:00:08 -0400 Received: from ocolin.muc.de ([193.149.48.4]:42711 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1dlvIV-0000ZS-7Z for 28233@debbugs.gnu.org; Sun, 27 Aug 2017 07:00:07 -0400 Received: (qmail 5257 invoked by uid 3782); 27 Aug 2017 11:00:06 -0000 Received: from acm.muc.de (p548C7E25.dip0.t-ipconnect.de [84.140.126.37]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 27 Aug 2017 13:00:05 +0200 Received: (qmail 5665 invoked by uid 1000); 27 Aug 2017 10:57:32 -0000 Date: Sun, 27 Aug 2017 10:57:32 +0000 Message-ID: <20170827105732.GC3520@ACM> References: <87zianu0k3.fsf@rose> <20170826172906.GD5508@ACM> <685795841.1652.1503797052004@webmail.mailhostbox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <685795841.1652.1503797052004@webmail.mailhostbox.com> User-Agent: Mutt/1.7.2 (2016-11-26) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Hello again, Mohammed. On Sun, Aug 27, 2017 at 06:54:11 +0530, Mohammed Sadiq wrote: [ .... ] > The patch surely fixed the issue. Thanks > By the way, the patch wasn't applying to the current HEAD of emacs git. > I had to manually add those lines it. Is it built from some other > source? Alternatively, can I say patch to skip some n lines (positive > or negative) than the ones said in diff and try to apply? Sorry about that. I fixed the bug, and created the patch in standalone CC Mode, so the line numbers do differ a bit. However, I checked that the patch would apply to the Emacs sources before sending it to you, by: $ patch --dry-run < ~/path/to/diff.20170826.diff in the Emacs .../lisp/progmodes directory. This `patch' is the standard GNU utility, with $ patch --version returning: GNU patch 2.7.5 Copyright (C) 2003, 2009-2012 Free Software Foundation, Inc. Copyright (C) 1988 Larry Wall . It copes fine with the line numbers in the patch and the target file being a little adrift, or with there being extraneous text present (such as when patch is presented with an entire email as a patch file). Which patch utility are you using? -- Alan Mackenzie (Nuremberg, Germany). From unknown Sun Sep 07 01:05:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#28233: CC Mode 5.33 (C/*l); Emacs may get stuck with 100% CPU Resent-From: Mohammed Sadiq Original-Sender: "Debbugs-submit" Resent-CC: bug-cc-mode@gnu.org Resent-Date: Sun, 27 Aug 2017 16:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28233 X-GNU-PR-Package: cc-mode X-GNU-PR-Keywords: To: Alan Mackenzie Cc: 28233@debbugs.gnu.org Received: via spool by 28233-submit@debbugs.gnu.org id=B28233.15038510306555 (code B ref 28233); Sun, 27 Aug 2017 16:24:01 +0000 Received: (at 28233) by debbugs.gnu.org; 27 Aug 2017 16:23:50 +0000 Received: from localhost ([127.0.0.1]:58017 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dm0Lm-0001hf-5z for submit@debbugs.gnu.org; Sun, 27 Aug 2017 12:23:50 -0400 Received: from us2-ob1-1.mailhostbox.com ([162.210.70.52]:51671) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dm0Lk-0001hW-1b for 28233@debbugs.gnu.org; Sun, 27 Aug 2017 12:23:48 -0400 Received: from 172.16.214.65 (unknown [172.16.214.65]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: sadiq@sadiqpk.org) by us2.outbound.mailhostbox.com (Postfix) with ESMTPSA id 0E28F1808B3; Sun, 27 Aug 2017 16:23:42 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sadiqpk.org; s=20160628; t=1503851022; bh=haaex84Ac+FxhOOJYp4N0j2zsLgGCLAV1t06oSfMOhE=; h=Date:From:To:Cc:In-Reply-To:References:Subject; b=KMiWl8c2QuiOsU1x/CQsVIRk/9y7TAxpa1xK058e/sBPYp9UCZVMQ8sSjZLApcX5d p0Sl7smoQDReUbTmnEuqlMgBt/T7ZyHX1fK30z4IhGCh6PWx8YylwgpQzQQhFVXhE7 JnKhlKtAMRoMUoG1bhRDPx3BaBxbNbTwp1OmQurg= Date: Sun, 27 Aug 2017 21:53:41 +0530 (IST) From: Mohammed Sadiq Message-ID: <994511887.15432.1503851022002@webmail.mailhostbox.com> In-Reply-To: <20170827105732.GC3520@ACM> References: <87zianu0k3.fsf@rose> <20170826172906.GD5508@ACM> <685795841.1652.1503797052004@webmail.mailhostbox.com> <20170827105732.GC3520@ACM> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Medium X-Mailer: Open-Xchange Mailer v7.8.3-Rev22 X-Originating-Client: open-xchange-appsuite X-CMAE-Score: 0 X-CMAE-Analysis: v=2.2 cv=Z6GcJDZA c=1 sm=1 tr=0 a=nf9kGWJ/Yk0yo5ZsUxXxOw==:117 a=IkcTkHD0fZMA:10 a=mJU03NFyoCqrVdkJTeQA:9 a=QEXdDO2ut3YA:10 X-Spam-Score: 1.5 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: > On August 27, 2017 at 4:27 PM Alan Mackenzie wrote: > > > Hello again, Mohammed. Hello > Which patch utility are you using? [...] Content analysis details: (1.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [162.210.70.52 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [162.210.70.52 listed in wl.mailspike.net] 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 1.5 FSL_HELO_BARE_IP_2 No description available. X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) > On August 27, 2017 at 4:27 PM Alan Mackenzie wrote: > > > Hello again, Mohammed. Hello > Which patch utility are you using? Just like most other tools, I'm using the GNU project's patch with version 2.7.5 It seems like my mail client have mangled the spaces in the patch given. Sorry for the noise. -- Mohammed Sadiq