* Strange hangs when visiting .el and .html files
@ 2024-02-07 19:28 Eric S. Raymond
2024-02-07 19:33 ` Eli Zaretskii
2024-02-08 9:14 ` Andreas Schwab
0 siblings, 2 replies; 13+ messages in thread
From: Eric S. Raymond @ 2024-02-07 19:28 UTC (permalink / raw)
To: emacs-devel
About a week ago I noticed that my Emacs was hanging when I attempted
to visit my init.el file. Then I saw the same hang when visiting an
HTML file. Other modes, such as text and C modes, are working normally.
I have seen this problem under a released 1.27 and a repository head
version (30.0.50 build 11) built about 20 minutes ago.
Running emacs with -q does not evade the hang.
OS is Pop!_OS 22.04 LTS, not that I think that matters.
Any suggestions on how to troubleshoot this?
--
<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Strange hangs when visiting .el and .html files
2024-02-07 19:28 Strange hangs when visiting .el and .html files Eric S. Raymond
@ 2024-02-07 19:33 ` Eli Zaretskii
2024-02-07 19:55 ` Eric S. Raymond
2024-02-08 9:14 ` Andreas Schwab
1 sibling, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2024-02-07 19:33 UTC (permalink / raw)
To: Eric S. Raymond; +Cc: emacs-devel
> From: "Eric S. Raymond" <esr@thyrsus.com>
> Date: Wed, 7 Feb 2024 14:28:29 -0500 (EST)
>
> About a week ago I noticed that my Emacs was hanging when I attempted
> to visit my init.el file. Then I saw the same hang when visiting an
> HTML file. Other modes, such as text and C modes, are working normally.
>
> I have seen this problem under a released 1.27 and a repository head
> version (30.0.50 build 11) built about 20 minutes ago.
What's "1.27"? did you mean Emacs 27.1? or something else?
If it's indeed Emacs 27, then the first suspect is something you've
changed on your system recently that is not Emacs, but maybe some
library or driver.
> Running emacs with -q does not evade the hang.
>
> OS is Pop!_OS 22.04 LTS, not that I think that matters.
>
> Any suggestions on how to troubleshoot this?
Attach the debugger to a hung Emacs and produce a backtrace from all
the threads?
Btw, it is netter to discuss this on the bug tracker, so please use
"M-x report-emacs-bug" to submit a report with all the details.
Thanks.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Strange hangs when visiting .el and .html files
2024-02-07 19:33 ` Eli Zaretskii
@ 2024-02-07 19:55 ` Eric S. Raymond
2024-02-07 20:13 ` Eli Zaretskii
0 siblings, 1 reply; 13+ messages in thread
From: Eric S. Raymond @ 2024-02-07 19:55 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel
Eli Zaretskii <eliz@gnu.org>:
> What's "1.27"? did you mean Emacs 27.1? or something else?
Sorry, yes, I did mean 27.1
> If it's indeed Emacs 27, then the first suspect is something you've
> changed on your system recently that is not Emacs, but maybe some
> library or driver.
My first guess was a dodgy .el file in my load path, but I've
eliminated that possibility.
> Attach the debugger to a hung Emacs and produce a backtrace from all
> the threads?
Is this procedure documented anywhere?
> Btw, it is netter to discuss this on the bug tracker, so please use
> "M-x report-emacs-bug" to submit a report with all the details.
Will do.
--
<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Strange hangs when visiting .el and .html files
2024-02-07 19:55 ` Eric S. Raymond
@ 2024-02-07 20:13 ` Eli Zaretskii
2024-02-07 21:00 ` Eric S. Raymond
0 siblings, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2024-02-07 20:13 UTC (permalink / raw)
To: esr; +Cc: emacs-devel
> Date: Wed, 7 Feb 2024 14:55:31 -0500
> From: "Eric S. Raymond" <esr@thyrsus.com>
> Cc: emacs-devel@gnu.org
>
> Eli Zaretskii <eliz@gnu.org>:
>
> > Attach the debugger to a hung Emacs and produce a backtrace from all
> > the threads?
>
> Is this procedure documented anywhere?
Possibly etc/DEBUG, but I can give instructions, if that's what you
need.
Basically, "gdb -p PID", where PID is the Emacs' process ID,
preferably from the src directory of the tree from which Emacs was
built (there's a .gdbinit file there that can help), then, when GDB
shows it prompt "(gdb)", type "thread apply all bt", which will
produce backtrace from every thread in the process.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Strange hangs when visiting .el and .html files
2024-02-07 20:13 ` Eli Zaretskii
@ 2024-02-07 21:00 ` Eric S. Raymond
0 siblings, 0 replies; 13+ messages in thread
From: Eric S. Raymond @ 2024-02-07 21:00 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel
Eli Zaretskii <eliz@gnu.org>:
> > Is this procedure documented anywhere?
>
> Possibly etc/DEBUG, but I can give instructions, if that's what you
> need.
>
> Basically, "gdb -p PID", where PID is the Emacs' process ID,
> preferably from the src directory of the tree from which Emacs was
> built (there's a .gdbinit file there that can help), then, when GDB
> shows it prompt "(gdb)", type "thread apply all bt", which will
> produce backtrace from every thread in the process.
I can budget time to work on thuis after the 15th. When I do, I will
make notes on what I learn and feed them back into etc/DEBUG.
--
<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Strange hangs when visiting .el and .html files
2024-02-07 19:28 Strange hangs when visiting .el and .html files Eric S. Raymond
2024-02-07 19:33 ` Eli Zaretskii
@ 2024-02-08 9:14 ` Andreas Schwab
2024-02-09 18:09 ` Eric S. Raymond
1 sibling, 1 reply; 13+ messages in thread
From: Andreas Schwab @ 2024-02-08 9:14 UTC (permalink / raw)
To: Eric S. Raymond; +Cc: emacs-devel
On Feb 07 2024, Eric S. Raymond wrote:
> About a week ago I noticed that my Emacs was hanging when I attempted
> to visit my init.el file. Then I saw the same hang when visiting an
> HTML file. Other modes, such as text and C modes, are working normally.
Is it interruptable? Then you can enable debug-on-quit to see where it
hangs.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Strange hangs when visiting .el and .html files
2024-02-08 9:14 ` Andreas Schwab
@ 2024-02-09 18:09 ` Eric S. Raymond
2024-02-09 18:50 ` Adam Porter
2024-02-10 6:57 ` Eli Zaretskii
0 siblings, 2 replies; 13+ messages in thread
From: Eric S. Raymond @ 2024-02-09 18:09 UTC (permalink / raw)
To: Andreas Schwab; +Cc: emacs-devel
Andreas Schwab <schwab@suse.de>:
> On Feb 07 2024, Eric S. Raymond wrote:
>
> > About a week ago I noticed that my Emacs was hanging when I attempted
> > to visit my init.el file. Then I saw the same hang when visiting an
> > HTML file. Other modes, such as text and C modes, are working normally.
>
> Is it interruptable? Then you can enable debug-on-quit to see where it
> hangs.
I tried that first thing.
Ctl-G after the hang does interrupt it, but doesn't yield a trace.
It's a weird bug because it's so specific. Most Lisp modes are
completely unaffected.
--
<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Strange hangs when visiting .el and .html files
2024-02-09 18:09 ` Eric S. Raymond
@ 2024-02-09 18:50 ` Adam Porter
2024-02-09 21:06 ` Eric S. Raymond
2024-02-10 6:59 ` Eli Zaretskii
2024-02-10 6:57 ` Eli Zaretskii
1 sibling, 2 replies; 13+ messages in thread
From: Adam Porter @ 2024-02-09 18:50 UTC (permalink / raw)
To: esr; +Cc: emacs-devel, schwab
> Andreas Schwab <schwab@suse.de>:
>> On Feb 07 2024, Eric S. Raymond wrote:
>>
>> > About a week ago I noticed that my Emacs was hanging when I attempted
>> > to visit my init.el file. Then I saw the same hang when visiting an
>> > HTML file. Other modes, such as text and C modes, are working normally.
>>
>> Is it interruptable? Then you can enable debug-on-quit to see where it
>> hangs.
>
> I tried that first thing.
>
> Ctl-G after the hang does interrupt it, but doesn't yield a trace.
>
> It's a weird bug because it's so specific. Most Lisp modes are
> completely unaffected.
This sounds like a weird behavior that I've observed ever since Emacs
28, but I've never been able to pin it down well enough to file a report
about it.
Basically, what I observe is that:
1. Certain actions (like calling certain commands, perhaps including
ones that activate a major mode) cause Emacs to spin with 100% CPU usage
for some time, tens of seconds or even a couple of minutes sometimes.
2. It only happens when such an action happens for the first time in a
session.
3. If I interrupt with C-g, everything appears normal; no errors, no
partially initialized state, no weird behavior. It's as if whatever I
interrupted was "optional."
4. Over time (3 or 4 versions now), the actions that trigger this
behavior have not been consistent. I might even venture to say that,
between different builds of the same version, the actions might not be
consistent.
5. It seems to happen less now, on Emacs 29.1 (I still need to upgrade)
than it did on builds of 28.0 and 28.1.
6. Without being able to verify it, I have the impression or intuition
that it happens when Emacs loads a library for the first time in a
session (I don't mean when it loads any library, just a certain one or
ones, but I haven't been able to pin it down).
Over the past couple of years, I've heard a few other users mention
observing similar behavior at times, but again, always being difficult
to nail down.
If this seems like the same behavior you're seeing, maybe it's time we
give this problem a name and an real bug report.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Strange hangs when visiting .el and .html files
2024-02-09 18:50 ` Adam Porter
@ 2024-02-09 21:06 ` Eric S. Raymond
2024-02-10 0:19 ` T.V Raman
2024-02-10 6:59 ` Eli Zaretskii
1 sibling, 1 reply; 13+ messages in thread
From: Eric S. Raymond @ 2024-02-09 21:06 UTC (permalink / raw)
To: Adam Porter; +Cc: emacs-devel, schwab
Adam Porter <adam@alphapapa.net>:
> This sounds like a weird behavior that I've observed ever since Emacs 28,
> but I've never been able to pin it down well enough to file a report about
> it.
>
> Basically, what I observe is that:
>
> 1. Certain actions (like calling certain commands, perhaps including ones
> that activate a major mode) cause Emacs to spin with 100% CPU usage for some
> time, tens of seconds or even a couple of minutes sometimes.
>
> 2. It only happens when such an action happens for the first time in a
> session.
>
> 3. If I interrupt with C-g, everything appears normal; no errors, no
> partially initialized state, no weird behavior. It's as if whatever I
> interrupted was "optional."
>
> 4. Over time (3 or 4 versions now), the actions that trigger this behavior
> have not been consistent. I might even venture to say that, between
> different builds of the same version, the actions might not be consistent.
>
> 5. It seems to happen less now, on Emacs 29.1 (I still need to upgrade) than
> it did on builds of 28.0 and 28.1.
>
> 6. Without being able to verify it, I have the impression or intuition that
> it happens when Emacs loads a library for the first time in a session (I
> don't mean when it loads any library, just a certain one or ones, but I
> haven't been able to pin it down).
>
> Over the past couple of years, I've heard a few other users mention
> observing similar behavior at times, but again, always being difficult to
> nail down.
>
> If this seems like the same behavior you're seeing, maybe it's time we give
> this problem a name and an real bug report.
OK, I tested your theory by visiting my HTML home page, interrupting the resulting
hang, and then visiting the page again.
It didn't hang, and now seems to be operating normally.
So I think we are in fact looking at the same bug. Nice to know I
wasn't hallucinating, and I'm guessing you're feeling the same relief
on reading this.
Proposed title: "Repeatable hang on first load of certain major modes".
I'd file the bug now, but it sounds like you've experienced it over more
versions and contexts than I have, so you can add more detail than I could.
The only thing I can add to your report is that the problem goes back past
version 28, at least as far as 27.1.
You can add to the report that I have seen this hang consistently in
27.1 and a recent repo head version, 30.0.50. And the modes I've seen
hang are elisp mode and whatever is invoked for HTML files.
If you reply with an issue URL I'll look it over and probably
comment.
--
<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Strange hangs when visiting .el and .html files
2024-02-09 21:06 ` Eric S. Raymond
@ 2024-02-10 0:19 ` T.V Raman
0 siblings, 0 replies; 13+ messages in thread
From: T.V Raman @ 2024-02-10 0:19 UTC (permalink / raw)
To: Eric S. Raymond; +Cc: Adam Porter, emacs-devel, schwab
profile with profiler-start and friends?
--
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Strange hangs when visiting .el and .html files
2024-02-09 18:09 ` Eric S. Raymond
2024-02-09 18:50 ` Adam Porter
@ 2024-02-10 6:57 ` Eli Zaretskii
2024-02-11 18:05 ` Eric S. Raymond
1 sibling, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2024-02-10 6:57 UTC (permalink / raw)
To: esr; +Cc: schwab, emacs-devel
> Date: Fri, 9 Feb 2024 13:09:21 -0500
> From: "Eric S. Raymond" <esr@thyrsus.com>
> Cc: emacs-devel@gnu.org
>
> Andreas Schwab <schwab@suse.de>:
> > On Feb 07 2024, Eric S. Raymond wrote:
> >
> > > About a week ago I noticed that my Emacs was hanging when I attempted
> > > to visit my init.el file. Then I saw the same hang when visiting an
> > > HTML file. Other modes, such as text and C modes, are working normally.
> >
> > Is it interruptable? Then you can enable debug-on-quit to see where it
> > hangs.
>
> I tried that first thing.
>
> Ctl-G after the hang does interrupt it, but doesn't yield a trace.
Do you see something in *Messages* after that C-g interrupt?
Anyway, I still suggest the "attach GDB and produce backtrace" method,
it will give us more data to work with.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Strange hangs when visiting .el and .html files
2024-02-09 18:50 ` Adam Porter
2024-02-09 21:06 ` Eric S. Raymond
@ 2024-02-10 6:59 ` Eli Zaretskii
1 sibling, 0 replies; 13+ messages in thread
From: Eli Zaretskii @ 2024-02-10 6:59 UTC (permalink / raw)
To: Adam Porter; +Cc: esr, emacs-devel, schwab
> Date: Fri, 9 Feb 2024 12:50:54 -0600
> Cc: emacs-devel@gnu.org, schwab@suse.de
> From: Adam Porter <adam@alphapapa.net>
>
> > Andreas Schwab <schwab@suse.de>:
> >> On Feb 07 2024, Eric S. Raymond wrote:
> >>
> >> > About a week ago I noticed that my Emacs was hanging when I attempted
> >> > to visit my init.el file. Then I saw the same hang when visiting an
> >> > HTML file. Other modes, such as text and C modes, are working normally.
> >>
> >> Is it interruptable? Then you can enable debug-on-quit to see where it
> >> hangs.
> >
> > I tried that first thing.
> >
> > Ctl-G after the hang does interrupt it, but doesn't yield a trace.
> >
> > It's a weird bug because it's so specific. Most Lisp modes are
> > completely unaffected.
>
> This sounds like a weird behavior that I've observed ever since Emacs
> 28, but I've never been able to pin it down well enough to file a report
> about it.
May I suggest that you, too, attach GDB to Emacs when it hangs like
that, and post the backtrace?
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Strange hangs when visiting .el and .html files
2024-02-10 6:57 ` Eli Zaretskii
@ 2024-02-11 18:05 ` Eric S. Raymond
0 siblings, 0 replies; 13+ messages in thread
From: Eric S. Raymond @ 2024-02-11 18:05 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: schwab, emacs-devel
Eli Zaretskii <eliz@gnu.org>:
> > Ctl-G after the hang does interrupt it, but doesn't yield a trace.
>
> Do you see something in *Messages* after that C-g interrupt?
Messages is clean.
> Anyway, I still suggest the "attach GDB and produce backtrace" method,
> it will give us more data to work with.
After I make by dealine on the 15th.
--
<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2024-02-11 18:05 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-07 19:28 Strange hangs when visiting .el and .html files Eric S. Raymond
2024-02-07 19:33 ` Eli Zaretskii
2024-02-07 19:55 ` Eric S. Raymond
2024-02-07 20:13 ` Eli Zaretskii
2024-02-07 21:00 ` Eric S. Raymond
2024-02-08 9:14 ` Andreas Schwab
2024-02-09 18:09 ` Eric S. Raymond
2024-02-09 18:50 ` Adam Porter
2024-02-09 21:06 ` Eric S. Raymond
2024-02-10 0:19 ` T.V Raman
2024-02-10 6:59 ` Eli Zaretskii
2024-02-10 6:57 ` Eli Zaretskii
2024-02-11 18:05 ` Eric S. Raymond
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.