From: Eli Zaretskii <eliz@gnu.org>
To: Andy Moreton <andrewjmoreton@gmail.com>
Cc: fni@missioncriticalit.com, 12832@debbugs.gnu.org
Subject: bug#12832: 24.3.50; Emacs lockup when idle
Date: Tue, 13 Nov 2012 19:20:07 +0200 [thread overview]
Message-ID: <83d2zhv2rc.fsf@gnu.org> (raw)
In-Reply-To: <50A277FD.4030200@gmail.com>
> Date: Tue, 13 Nov 2012 16:40:29 +0000
> From: Andy Moreton <andrewjmoreton@gmail.com>
> CC: dmoncayo@gmail.com, fni@missioncriticalit.com, 12832@debbugs.gnu.org
>
> On 13/11/2012 16:35, Eli Zaretskii wrote:
> >> Date: Tue, 13 Nov 2012 16:00:30 +0000
> >> From: Andy Moreton <andrewjmoreton@gmail.com>
> >> CC: dmoncayo@gmail.com, fni@missioncriticalit.com, 12832@debbugs.gnu.org
> >>
> >> The fact that thread 236140 is at ThreadStartRoutine makes me wonder if this
> >> is related to the perils of DllMain (i.e. the loader lock).
> >
> > Sorry, I don't follow. Can you say more about this problem, or point
> > me to some accessible documentation about it?
>
> The DllMain notifications for process and thread create/destroy are called
> with the (system internal) loader lock held. This means that anything called
> from these routines should not use locks, or deadlock is possible. So I was
> wondering if the thread manipulation for timer handling is interacting with
> those mechanisms.
Thanks for the explanation.
> Of course I don't know nearly enough about Win32 to actually say much useful
> here, so the actual problem is probably something else entirely.
Don't assume I know more than you do ;-)
Anyway, I actually don't understand why some thread is at
ThreadStartRoutine, if that fact really means that a thread is being
created. The timer thread is created during startup, and is not shut
down until Emacs shuts down. And we don't create any other threads in
the middle of a session (unless the user invokes profiler).
So the only way I can understand this ThreadStartRoutine business is
that somehow the timer thread exited due to an error (look for a line
saying "return 2;" in timer_loop), and then the next time Emacs sets
up the 2-sec atimer, a new thread will be started.
So could you please set a breakpoint at line 575 in w32proc.c, which
is this:
/* Start a new thread. */
itimer->terminate = 0;
itimer->type = which; <<<<<<<<<<<<<<<<<<<<<<<<<<<
run Emacs under GDB, and see if this breakpoint breaks more than once
when you run Emacs as usual? It should break one time during startup,
and never thereafter. To make sure you don't disrupt the timers,
define commands for this breakpoint that simply continue, like this:
(gdb) break w32proc.c:575
(gdb) commands
> continue
> end
next prev parent reply other threads:[~2012-11-13 17:20 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-08 12:57 bug#12832: 24.3.50; Emacs lockup when idle Andy Moreton
2012-11-08 16:28 ` Eli Zaretskii
2012-11-08 18:33 ` Andy Moreton
2012-11-09 9:56 ` Eli Zaretskii
2012-11-09 10:48 ` Andy Moreton
2012-11-09 11:14 ` Eli Zaretskii
2012-11-09 18:11 ` Eli Zaretskii
2012-11-09 18:38 ` Andy Moreton
2012-11-09 19:12 ` Eli Zaretskii
2012-11-09 19:15 ` Eli Zaretskii
2012-11-13 12:59 ` Eli Zaretskii
[not found] ` <509BAC2E.2000702-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-11-13 13:13 ` Fabrice Niessen
2012-11-13 13:39 ` Dani Moncayo
2012-11-13 14:07 ` Eli Zaretskii
2012-11-13 14:25 ` Andy Moreton
2012-11-13 15:16 ` Eli Zaretskii
2012-11-13 16:00 ` Andy Moreton
2012-11-13 16:35 ` Eli Zaretskii
2012-11-13 16:40 ` Andy Moreton
2012-11-13 17:20 ` Eli Zaretskii [this message]
2012-11-13 17:04 ` Eli Zaretskii
2012-11-14 12:44 ` Andy Moreton
2012-11-14 16:29 ` Andy Moreton
2012-11-14 16:48 ` Lennart Borgman
2012-11-14 17:41 ` Eli Zaretskii
2012-11-14 17:49 ` Lennart Borgman
2012-11-14 17:53 ` Eli Zaretskii
2012-11-14 16:51 ` Eli Zaretskii
2012-11-14 20:17 ` Andy Moreton
2012-11-15 19:26 ` Andy Moreton
2012-11-15 20:22 ` 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=83d2zhv2rc.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=12832@debbugs.gnu.org \
--cc=andrewjmoreton@gmail.com \
--cc=fni@missioncriticalit.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.