From: Eli Zaretskii <eliz@gnu.org>
To: "ISHIKAWA,chiaki" <ishikawa@yk.rim.or.jp>
Cc: 66096@debbugs.gnu.org, ishikawa@yk.rim.or.jp
Subject: bug#66096: High CPU usage, basically runaway emacs with visit to bidi_cache_search on and off?
Date: Tue, 19 Sep 2023 14:04:08 +0300 [thread overview]
Message-ID: <834jjqe85z.fsf@gnu.org> (raw)
In-Reply-To: <1808d5a1-3ee6-d675-3ad3-c6bcc2fe5e36@yk.rim.or.jp> (ishikawa@yk.rim.or.jp)
> Cc: "ishikawa, chiaki" <ishikawa@yk.rim.or.jp>
> Date: Tue, 19 Sep 2023 13:12:33 +0900
> From: "ISHIKAWA,chiaki" <ishikawa@yk.rim.or.jp>
>
> High CPU usage, basically runaway emacs with visit to bidi_cache_search
> on and off?
>
> Hi,
>
> Environment:
> OS GNU/Debian Linux X86_64
> Emacs version
> GNU Emacs 29.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38,
> cairo version 1.16.0) of 2023-08-01
> I compiled emacs using gcc.
>
> Has anyone seen emacs 29.1 spending CPU way too high, basically went
> into an infinite loop of some sort, and could not be interrupted by
> Control-G? Basically it is in a runaway state.
> I found that the stacktraces show that bidi_cache_search
> and friends are visited now and then. It is not the recursive blowup
> probably since the stack depth is quite limited during my observation.
>
>
> I have experienced this issue this morning. Observing the stack
> backtrace by monitoring the runaway emacs using gdb, I was surprised
> to see many appearances of bidi_cache_search that were observed from
> time to time while I do control-C to stop emacs and monitor
> stacktrace, and the continue for a few seconds, and interrupt it again
> with control-C. After letting emacs run in this manner for about 5
> minutes, I had tp kill emacs. I had to edit the file by a deadline and
> could not continue debugging. :-(
>
> At the end is a single stacktrace with bidi_cache_search at the top.
> I have seen this occurring multiple times. My hitting control-C to emacs
> to enter gdb interaction means that the chance of hitting a particular
> stacktrace pattern is small and seeing the same pattern multiple times
> means that that pattern happens quite often.
The backtrace shows we were resizing the mini-window, but it doesn't
tell where and why we were looping.
(The bidi_cache_search part is probably a red herring: that function
is indeed called very frequently when Emacs performs display and
layout calculations -- which is not surprising, since that's why the
bidi cache exists: to provide cache hits whenever possible.)
So it is important to have a file and the sequence of commands that
trigger this. Please try to produce such a file and a recipe to
reproduce the problem.
Alternatively, you can use the technique described in etc/DEBUG for
finding where Emacs loops, see there under "If the symptom of the bug
is that Emacs fails to respond". I think even if you do discover
where it loops, we'd need an example file to see why, though.
> I have a dozen or so more different stacktraces during gdb monitoring.
> If someone wants to see the log, I can post it.
> What is the preferred URL where I can paste the whole gdb session?
You can post them here, perhaps compressed. However, if they are all
of the same kind, i.e. start with resize_echo_area_exactly, then I
don't think more backtraces alone will help.
Thanks.
next prev parent reply other threads:[~2023-09-19 11:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-19 4:12 bug#66096: High CPU usage, basically runaway emacs with visit to bidi_cache_search on and off? ISHIKAWA,chiaki
2023-09-19 11:04 ` Eli Zaretskii [this message]
2023-09-20 7:09 ` ISHIKAWA,chiaki
2023-09-20 7:16 ` ISHIKAWA,chiaki
2023-09-20 13:24 ` Eli Zaretskii
2023-09-21 1:36 ` ISHIKAWA,chiaki
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=834jjqe85z.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=66096@debbugs.gnu.org \
--cc=ishikawa@yk.rim.or.jp \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).