From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#18022: 24.3; Emacs hard locks when attempting to do a replacement with ^M in it. Date: Wed, 16 Jul 2014 21:41:44 +0000 Message-ID: <20140716214144.GA4052@acm.acm> References: <83ha2i901p.fsf@gnu.org> <8338e28t9r.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1405547257 28360 80.91.229.3 (16 Jul 2014 21:47:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 16 Jul 2014 21:47:37 +0000 (UTC) Cc: Marty Rosenberg , 18022@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jul 16 23:47:29 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1X7X2u-0007h7-R7 for geb-bug-gnu-emacs@m.gmane.org; Wed, 16 Jul 2014 23:47:28 +0200 Original-Received: from localhost ([::1]:41449 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7X2u-0008KI-FS for geb-bug-gnu-emacs@m.gmane.org; Wed, 16 Jul 2014 17:47:28 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34792) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7X2k-0008GY-Bi for bug-gnu-emacs@gnu.org; Wed, 16 Jul 2014 17:47:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X7X2d-0004Rk-Lb for bug-gnu-emacs@gnu.org; Wed, 16 Jul 2014 17:47:18 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:33397) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7X2V-0004D5-57; Wed, 16 Jul 2014 17:47:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1X7X2U-0000Tb-GG; Wed, 16 Jul 2014 17:47:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Wed, 16 Jul 2014 21:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18022 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: Original-Received: via spool by 18022-submit@debbugs.gnu.org id=B18022.14055471941732 (code B ref 18022); Wed, 16 Jul 2014 21:47:02 +0000 Original-Received: (at 18022) by debbugs.gnu.org; 16 Jul 2014 21:46:34 +0000 Original-Received: from localhost ([127.0.0.1]:56896 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X7X21-0000Rr-RW for submit@debbugs.gnu.org; Wed, 16 Jul 2014 17:46:34 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:55073 helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X7X1y-0000RW-4j for 18022@debbugs.gnu.org; Wed, 16 Jul 2014 17:46:31 -0400 Original-Received: (qmail 51217 invoked by uid 3782); 16 Jul 2014 21:46:28 -0000 Original-Received: from acm.muc.de (pD9519120.dip0.t-ipconnect.de [217.81.145.32]) by colin.muc.de (tmda-ofmipd) with ESMTP; Wed, 16 Jul 2014 23:46:27 +0200 Original-Received: (qmail 4122 invoked by uid 1000); 16 Jul 2014 21:41:44 -0000 Content-Disposition: inline In-Reply-To: <8338e28t9r.fsf@gnu.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:91601 Archived-At: Hello, Marty and Eli. On Tue, Jul 15, 2014 at 07:46:08PM +0300, Eli Zaretskii wrote: > > Date: Tue, 15 Jul 2014 12:28:10 -0400 > > From: Marty Rosenberg > > Oh. I also opened a new file called "test.cc". I think that cc-mode is part > > of the issue. > Yes, that makes the difference. > Alan, can you take a look? OK, I've made some progress. Just to be specific what the problem is: When in 64-bit Gnu/Linux, a C++ file is exactly this (where ^M is a carriage return) template ^MSimulatorBase::foobar() (there being no newline at EOB), font-locking hangs, though hitting a frame changing command followed by C-g often enough will switch frames. With the help of elp-instrument-package RET c- RET, it is apparent that c-beginning-of-macro is being called in a loop. By putting this at the start of c-beginning-of-macro: (message "1. %s" (backtrace-frame 1)) (message "2. %s" (backtrace-frame 2)) (message "3. %s" (backtrace-frame 3)) (message "4. %s" (backtrace-frame 4)) (message "5. %s" (backtrace-frame 5)) (message "6. %s" (backtrace-frame 6)) (message "7. %s" (backtrace-frame 7)) (message "8. %s" (backtrace-frame 8)) (message "9. %s" (backtrace-frame 9)) (message "a. %s" (backtrace-frame 10)) (message "b. %s" (backtrace-frame 11)) (message "c. %s" (backtrace-frame 12)) , it becomes clear that the looping is in c-backward-sws, the function generated by macro c-backward-syntactic-ws, which is being called from c-font-lock-<>-arglists. I don't know c-backward-sws very well, but it looks like that's about to change. ;-) Marty, thanks for such a high quality bug report. -- Alan Mackenzie (Nuremberg, Germany).