From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#70423: 29.3; cc-mode hang at 100% cpu and consuming all available memory Date: Sat, 20 Apr 2024 09:22:56 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29019"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acm@muc.de, Eli Zaretskii , Bob Weiner , 70423@debbugs.gnu.org To: pillowtrucker@proton.me Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Apr 20 11:24:16 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ry6xE-0007MH-Tu for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 20 Apr 2024 11:24:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ry6wv-0003xU-PK; Sat, 20 Apr 2024 05:23:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ry6ws-0003xI-22 for bug-gnu-emacs@gnu.org; Sat, 20 Apr 2024 05:23:54 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ry6wr-0006vt-QL for bug-gnu-emacs@gnu.org; Sat, 20 Apr 2024 05:23:53 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ry6x5-0001td-Sd for bug-gnu-emacs@gnu.org; Sat, 20 Apr 2024 05:24:07 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 20 Apr 2024 09:24:07 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70423 X-GNU-PR-Package: emacs Original-Received: via spool by 70423-submit@debbugs.gnu.org id=B70423.17136050087041 (code B ref 70423); Sat, 20 Apr 2024 09:24:07 +0000 Original-Received: (at 70423) by debbugs.gnu.org; 20 Apr 2024 09:23:28 +0000 Original-Received: from localhost ([127.0.0.1]:35334 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ry6wQ-0001pN-BV for submit@debbugs.gnu.org; Sat, 20 Apr 2024 05:23:28 -0400 Original-Received: from mail.muc.de ([193.149.48.3]:40550) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ry6wI-0001nK-S3 for 70423@debbugs.gnu.org; Sat, 20 Apr 2024 05:23:23 -0400 Original-Received: (qmail 81669 invoked by uid 3782); 20 Apr 2024 11:22:57 +0200 Original-Received: from muc.de (pd953a265.dip0.t-ipconnect.de [217.83.162.101]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 20 Apr 2024 11:22:57 +0200 Original-Received: (qmail 6270 invoked by uid 1000); 20 Apr 2024 09:22:56 -0000 Content-Disposition: inline In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:283728 Archived-At: Hello, M. On Fri, Apr 19, 2024 at 20:49:20 +0000, pillowtrucker@proton.me wrote: > Hello again, Alan! > I've been using a git revision of hyperbole with the regex removed > while Bob works on the new regex. I've hit a few other small glitches > while using it, but nothing anywhere as major as the main issue at > hand, and they're most definitely unrelated. That's good to know, thanks. So it seems that the C++ value of defun-prompt-regexp is indeed the cause of the immediate problem. What should have occurred to me immediately is that in c-beginning-of-defun-1, I should bind defun-prompt-regexp to nil. That macro is intended to move to the beginning of the defun in the most vanilla fashion possible, and for this it binds beginning-of-defun-function, etc., to nil. It needs to do the same to defun-prompt-regexp. This will likely speed it up, too. > I also had a look in the other bug report and it seemed like there was > also some kind of patch on the cc-mode side in emacs 30/trunk ? Or did > I misunderstand that conversation ? I could try running an emacs git > build if that's the case, although I'm not sure how many of my other > packages will remain compatible, so it's not really a priority. We're talking about bug#61436: Emacs Freezing With Java Files, I think. There hasn't been any patch to CC Mode for this, though I think there probably should be. The CC Mode position is that java-defun-prompt-regexp is unsupported and unmaintained; it is not used at all in CC Mode. But it is there for the convenience of other modes (such as hyperbole) that want to copy it and use it at their own risk, and also as an illustration of the limits of regular expressions. The recommendation is to use "other methods" of finding starts of defuns. > My init.el script is really innocent, although I've later asked some > friends and they agree that they would also probably never run > something like that. Yes, I see that now. But I still don't really want to install these packages into my Emacs, and I'm too lazy to set up an alternative init.el. ;-) > I just thought it would be a fun challenge to do everything to > reproduce the issue in one init script. The base64-encoded string is > just a gzipped copy of the .cpp file with which I could reproduce the > issue. You should get the same string by running "gzip --stdout > drm_formats.cpp|base64" on the attached .cpp file. (However, I don't > know if all gzip versions produce the same output given the same input, > and it will make me look even more suspicious if the strings don't > match.) Yes, I got the C++ file without too much trouble, thanks. I was expecting it to be "extreme", triggering the problems in C++ Mode, but it was just a perfectly normal C++ file. It was on noticing hyperbole mode that I thought about bug#61436. > Regardless, I've been productively working on other C++ code with the > regexp turned off and it's been a great relief not to have to struggle > with having to restart my workspace/desktop so often. Yes, I can understand that. As I said, I'll fix c-beginning-of-defun-1 so that that can't possibly happen again, regardless of what happens to these regexps. > Thank you for both of yours work! And good luck with the new regexp! > If you put it in some git tag/branch that I can pull easily, I could > maybe assist with testing it ? Let me know if that's an option. That's more up to Bob that me. Alternatively, I could send you a copy of the new C++ regexp which you could edit into the pertinent hyperbole source file. > Kind regards, > M [ .... ] -- Alan Mackenzie (Nuremberg, Germany).