* diagnosing emacs hangs
@ 2010-06-22 1:18 Matt Price
2010-06-22 2:44 ` Qiang Guo
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Matt Price @ 2010-06-22 1:18 UTC (permalink / raw
To: help-gnu-emacs; +Cc: emacs-orgmode
Hi all,
I'm now using emacs for almost everything and of course that's great,
except that it is essentially a single-threaded OS that currently
HANGS with some frequency (100% CPU usgte that will continue for hours
if you let it go. I think this probably has something to do with
wanderlust or possibly org-mode (and/or misconfigurations i've made to
both of these); but at present i cna't be sure since i have no idea
how to diagnose these hangs. Can someone give me some general
directions on how to proceed with the diagnosis, and if you have them,
some pointers on how you fixed a similar problem that you used to
have? Right now it's very frustrating -- I find myself losing
substantial amounts of work when I kill emacs & maybe more
importantly, i'm constantly losing my train of thought.
This is all under Ubuntu Lucid with emacs-snapshot 20090909,
wanderlust=wl-beta 2.15.9+0.20100303, org-mode 6.34c (some of htese
are debian sid packages).
Thanks much in advance,
matt
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: diagnosing emacs hangs
2010-06-22 1:18 diagnosing emacs hangs Matt Price
@ 2010-06-22 2:44 ` Qiang Guo
2010-06-22 6:04 ` Ian Barton
` (2 subsequent siblings)
3 siblings, 0 replies; 9+ messages in thread
From: Qiang Guo @ 2010-06-22 2:44 UTC (permalink / raw
To: Matt Price; +Cc: help-gnu-emacs, emacs-orgmode
Hi Matt
I run into the same problem some time ago. I guess it's
probably the cause of wanderlust. After some idle time,
emacs will hang unless I restart the program. Try to set
'elmo-network-session-idle-timeout' variable to a reasonable
value (thanks to somebody on wanderlust's mailinglist :-)).
Hope it helps
Qiang
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: diagnosing emacs hangs
2010-06-22 1:18 diagnosing emacs hangs Matt Price
@ 2010-06-22 6:04 ` Ian Barton
2010-06-22 6:04 ` Ian Barton
` (2 subsequent siblings)
3 siblings, 0 replies; 9+ messages in thread
From: Ian Barton @ 2010-06-22 6:04 UTC (permalink / raw
To: Matt Price; +Cc: help-gnu-emacs, emacs-orgmode
On 22/06/10 02:18, Matt Price wrote:
> Hi all,
>
> I'm now using emacs for almost everything and of course that's great,
> except that it is essentially a single-threaded OS that currently
> HANGS with some frequency (100% CPU usgte that will continue for hours
> if you let it go. I think this probably has something to do with
> wanderlust or possibly org-mode (and/or misconfigurations i've made to
> both of these); but at present i cna't be sure since i have no idea
> how to diagnose these hangs. Can someone give me some general
> directions on how to proceed with the diagnosis, and if you have them,
> some pointers on how you fixed a similar problem that you used to
> have? Right now it's very frustrating -- I find myself losing
> substantial amounts of work when I kill emacs& maybe more
> importantly, i'm constantly losing my train of thought.
>
> This is all under Ubuntu Lucid with emacs-snapshot 20090909,
> wanderlust=wl-beta 2.15.9+0.20100303, org-mode 6.34c (some of htese
> are debian sid packages).
>
Have you tried starting Emacs from a terminal? That might give you some
better idea of the error.
Ian.
_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: diagnosing emacs hangs
@ 2010-06-22 6:04 ` Ian Barton
0 siblings, 0 replies; 9+ messages in thread
From: Ian Barton @ 2010-06-22 6:04 UTC (permalink / raw
To: Matt Price; +Cc: help-gnu-emacs, emacs-orgmode
On 22/06/10 02:18, Matt Price wrote:
> Hi all,
>
> I'm now using emacs for almost everything and of course that's great,
> except that it is essentially a single-threaded OS that currently
> HANGS with some frequency (100% CPU usgte that will continue for hours
> if you let it go. I think this probably has something to do with
> wanderlust or possibly org-mode (and/or misconfigurations i've made to
> both of these); but at present i cna't be sure since i have no idea
> how to diagnose these hangs. Can someone give me some general
> directions on how to proceed with the diagnosis, and if you have them,
> some pointers on how you fixed a similar problem that you used to
> have? Right now it's very frustrating -- I find myself losing
> substantial amounts of work when I kill emacs& maybe more
> importantly, i'm constantly losing my train of thought.
>
> This is all under Ubuntu Lucid with emacs-snapshot 20090909,
> wanderlust=wl-beta 2.15.9+0.20100303, org-mode 6.34c (some of htese
> are debian sid packages).
>
Have you tried starting Emacs from a terminal? That might give you some
better idea of the error.
Ian.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: diagnosing emacs hangs
[not found] <mailman.9.1277169501.9916.help-gnu-emacs@gnu.org>
@ 2010-06-22 8:58 ` Uday S Reddy
2010-06-22 9:44 ` Cecil Westerhof
0 siblings, 1 reply; 9+ messages in thread
From: Uday S Reddy @ 2010-06-22 8:58 UTC (permalink / raw
To: help-gnu-emacs
Emacs "hangs" means that, when you type C-g and it doesn't respond. Is that
what you mean? That kind of thing almost never happens in my experience. You
will need to investigate the circumstances that cause the hanging and file a
detailed bug report.
If it does respond to C-g, then you are in luck. Set the variable
debug-on-quit to t ahead of time. When type C-g, it produces a backtrace of
all the functions it was trying to run when it went into a hang. You should
investigate it or post the backtrace here if you need further help.
Cheers,
Uday
On 6/22/2010 2:18 AM, Matt Price wrote:
> Hi all,
>
> I'm now using emacs for almost everything and of course that's great,
> except that it is essentially a single-threaded OS that currently
> HANGS with some frequency (100% CPU usgte that will continue for hours
> if you let it go. I think this probably has something to do with
> wanderlust or possibly org-mode (and/or misconfigurations i've made to
> both of these); but at present i cna't be sure since i have no idea
> how to diagnose these hangs. Can someone give me some general
> directions on how to proceed with the diagnosis, and if you have them,
> some pointers on how you fixed a similar problem that you used to
> have? Right now it's very frustrating -- I find myself losing
> substantial amounts of work when I kill emacs& maybe more
> importantly, i'm constantly losing my train of thought.
>
> This is all under Ubuntu Lucid with emacs-snapshot 20090909,
> wanderlust=wl-beta 2.15.9+0.20100303, org-mode 6.34c (some of htese
> are debian sid packages).
>
> Thanks much in advance,
>
> matt
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: diagnosing emacs hangs
2010-06-22 8:58 ` Uday S Reddy
@ 2010-06-22 9:44 ` Cecil Westerhof
0 siblings, 0 replies; 9+ messages in thread
From: Cecil Westerhof @ 2010-06-22 9:44 UTC (permalink / raw
To: help-gnu-emacs
Op dinsdag 22 jun 2010 10:58 CEST schreef Uday S. Reddy:
> Emacs "hangs" means that, when you type C-g and it doesn't respond. Is
> that what you mean? That kind of thing almost never happens in my
> experience.
I have had one case. I once opened a file of 163 MB to look at it. Then
the file changed and I had auto-revert-mode on. But that was my fault. I
should have made sure that auto-revert-mode should not work on large
files. At the moment I can not remember another instance. ;-}
By the way: what is the best way to implement this and what would be a
good cut of point?
--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: diagnosing emacs hangs
2010-06-22 1:18 diagnosing emacs hangs Matt Price
2010-06-22 2:44 ` Qiang Guo
2010-06-22 6:04 ` Ian Barton
@ 2010-06-22 10:05 ` Tassilo Horn
2010-06-22 14:23 ` Nick Dokos
3 siblings, 0 replies; 9+ messages in thread
From: Tassilo Horn @ 2010-06-22 10:05 UTC (permalink / raw
To: help-gnu-emacs; +Cc: emacs-orgmode
Hi!
Usually, you debug hangs by doing `M-x toggle-debug-on-quit' and hitting
`C-g' when it hangs. Then you'll get a backtrace, which should point
you to the infinte loop or something like that.
Bye,
Tassilo
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: diagnosing emacs hangs
2010-06-22 1:18 diagnosing emacs hangs Matt Price
@ 2010-06-22 14:23 ` Nick Dokos
2010-06-22 6:04 ` Ian Barton
` (2 subsequent siblings)
3 siblings, 0 replies; 9+ messages in thread
From: Nick Dokos @ 2010-06-22 14:23 UTC (permalink / raw
To: Matt Price; +Cc: help-gnu-emacs, nicholas.dokos, emacs-orgmode
Matt Price <moptop99@gmail.com> wrote:
> I'm now using emacs for almost everything and of course that's great,
> except that it is essentially a single-threaded OS that currently
> HANGS with some frequency (100% CPU usgte that will continue for hours
> if you let it go. I think this probably has something to do with
> wanderlust or possibly org-mode (and/or misconfigurations i've made to
> both of these); but at present i cna't be sure since i have no idea
> how to diagnose these hangs. Can someone give me some general
> directions on how to proceed with the diagnosis, and if you have them,
> some pointers on how you fixed a similar problem that you used to
> have? Right now it's very frustrating -- I find myself losing
> substantial amounts of work when I kill emacs & maybe more
> importantly, i'm constantly losing my train of thought.
>
> This is all under Ubuntu Lucid with emacs-snapshot 20090909,
> wanderlust=wl-beta 2.15.9+0.20100303, org-mode 6.34c (some of htese
> are debian sid packages).
>
I assume only emacs is stuck, so you can open an xterm: what does ``ps
awlx | grep emacs'' say? In particular, the state and the wchan are of
interest: normally, it should be in S state and waiting on select: idle
and waiting for input. If it's persistently in D state, it's stuck
somewhere in the kernel - the wchan gives an idea where. Do it a few times
to make sure that things are not changing.
The next step is to do ``strace -p<emacs_pid>'' to see whether it's going
in and out of the kernel (perhaps in an infinite loop).
If it is *not* going into the kernel, but accumulates CPU runtime (check
the ps awlx output a few times), then it's stuck in a loop in user
space. Attaching to it with ``gdb -p<emacs_pid>'' and getting a
backtrace should give an idea of where it's stuck. But if the loop is in
lisp code, the backtrace is not going to tell you where: it'll just be
in eval. If that's the case, then bisecting through your .emacs setup is
probably the best idea (maybe start by commenting out the org/wanderlust
stuff, particularly if you started getting these problems recently,
after making changes to their configuration.)
It's always a good idea to do these things with a working emacs first, so
that you learn what "normal" looks like. Then you have a better idea
of what's wrong when you try them on the stuck emacs.
This only scratches the surface but...
HTH,
Nick
_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: diagnosing emacs hangs
@ 2010-06-22 14:23 ` Nick Dokos
0 siblings, 0 replies; 9+ messages in thread
From: Nick Dokos @ 2010-06-22 14:23 UTC (permalink / raw
To: Matt Price; +Cc: help-gnu-emacs, nicholas.dokos, emacs-orgmode
Matt Price <moptop99@gmail.com> wrote:
> I'm now using emacs for almost everything and of course that's great,
> except that it is essentially a single-threaded OS that currently
> HANGS with some frequency (100% CPU usgte that will continue for hours
> if you let it go. I think this probably has something to do with
> wanderlust or possibly org-mode (and/or misconfigurations i've made to
> both of these); but at present i cna't be sure since i have no idea
> how to diagnose these hangs. Can someone give me some general
> directions on how to proceed with the diagnosis, and if you have them,
> some pointers on how you fixed a similar problem that you used to
> have? Right now it's very frustrating -- I find myself losing
> substantial amounts of work when I kill emacs & maybe more
> importantly, i'm constantly losing my train of thought.
>
> This is all under Ubuntu Lucid with emacs-snapshot 20090909,
> wanderlust=wl-beta 2.15.9+0.20100303, org-mode 6.34c (some of htese
> are debian sid packages).
>
I assume only emacs is stuck, so you can open an xterm: what does ``ps
awlx | grep emacs'' say? In particular, the state and the wchan are of
interest: normally, it should be in S state and waiting on select: idle
and waiting for input. If it's persistently in D state, it's stuck
somewhere in the kernel - the wchan gives an idea where. Do it a few times
to make sure that things are not changing.
The next step is to do ``strace -p<emacs_pid>'' to see whether it's going
in and out of the kernel (perhaps in an infinite loop).
If it is *not* going into the kernel, but accumulates CPU runtime (check
the ps awlx output a few times), then it's stuck in a loop in user
space. Attaching to it with ``gdb -p<emacs_pid>'' and getting a
backtrace should give an idea of where it's stuck. But if the loop is in
lisp code, the backtrace is not going to tell you where: it'll just be
in eval. If that's the case, then bisecting through your .emacs setup is
probably the best idea (maybe start by commenting out the org/wanderlust
stuff, particularly if you started getting these problems recently,
after making changes to their configuration.)
It's always a good idea to do these things with a working emacs first, so
that you learn what "normal" looks like. Then you have a better idea
of what's wrong when you try them on the stuck emacs.
This only scratches the surface but...
HTH,
Nick
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2010-06-22 14:23 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-22 1:18 diagnosing emacs hangs Matt Price
2010-06-22 2:44 ` Qiang Guo
2010-06-22 6:04 ` Ian Barton
2010-06-22 6:04 ` Ian Barton
2010-06-22 10:05 ` Tassilo Horn
2010-06-22 14:23 ` Nick Dokos
2010-06-22 14:23 ` Nick Dokos
[not found] <mailman.9.1277169501.9916.help-gnu-emacs@gnu.org>
2010-06-22 8:58 ` Uday S Reddy
2010-06-22 9:44 ` Cecil Westerhof
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.