all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: pillowtrucker@proton.me
Cc: acm@muc.de, Eli Zaretskii <eliz@gnu.org>,
	Bob Weiner <rswgnu@gmail.com>,
	70423@debbugs.gnu.org
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	[thread overview]
Message-ID: <ZiOJcJRUGJLKtqYo@ACM> (raw)
In-Reply-To: <eOiJasWE0SvvPlztFVWAPINid_tx2_7gUknuj0VvlloNVZKKY66MgXssxnDwGtdiwbufBlMcJxUx1nPDV_U1urbiTIvKB26ahG7wusb62D0=@proton.me>

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).





  reply	other threads:[~2024-04-20  9:22 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-16 13:36 bug#70423: 29.3; cc-mode hang at 100% cpu and consuming all available memory 1stmil.eth via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-16 15:52 ` bug#70423: Possible workaround/culprit pillowtrucker--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-16 18:31   ` Dmitry Gutov
2024-04-16 16:22 ` bug#70423: 29.3; cc-mode hang at 100% cpu and consuming all available memory Eli Zaretskii
2024-04-16 17:05   ` Alan Mackenzie
2024-04-16 17:59 ` Alan Mackenzie
2024-04-16 19:51   ` pillowtrucker--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-18 18:39     ` Alan Mackenzie
2024-04-19 20:49       ` pillowtrucker--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-20  9:22         ` Alan Mackenzie [this message]
2024-04-20 13:14           ` Robert Weiner
2024-04-20 15:52             ` Robert Weiner
2024-05-02  8:40               ` Eli Zaretskii
2024-05-02 22:01                 ` Robert Weiner
2024-05-03  5:54                   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZiOJcJRUGJLKtqYo@ACM \
    --to=acm@muc.de \
    --cc=70423@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=pillowtrucker@proton.me \
    --cc=rswgnu@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.