GNU bug report logs - #25875
26.0.50; Hang logging out of MS-Windows

Previous Next

Package: emacs;

Reported by: Richard Copley <rcopley <at> gmail.com>

Date: Sat, 25 Feb 2017 19:37:01 UTC

Severity: normal

Found in version 26.0.50

Done: Ken Brown <kbrown <at> cornell.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Richard Copley <rcopley <at> gmail.com>, Ken Brown <kbrown <at> cornell.edu>
Cc: 25875 <at> debbugs.gnu.org
Subject: bug#25875: 26.0.50; Hang logging out of MS-Windows
Date: Sun, 26 Feb 2017 17:44:51 +0200
> From: Richard Copley <rcopley <at> gmail.com>
> Date: Sat, 25 Feb 2017 21:07:51 +0000
> Cc: 25875 <at> debbugs.gnu.org
> 
> On 25 February 2017 at 20:33, Eli Zaretskii <eliz <at> gnu.org> wrote:
> >> From: Richard Copley <rcopley <at> gmail.com>
> >> Date: Sat, 25 Feb 2017 19:35:28 +0000
> >>
> >> On MS Windows, Emacs sometimes hangs when shutting down or logging out.
> >
> > How did you shut it down in this case?  This part:
> >
> >> #2  0x0000000400266caf in sys_sleep (seconds=1000)
> >>     at ../../repo/src/w32.c:3075
> >> No locals.
> >> #3  0x0000000400238225 in w32_wnd_proc (hwnd=0x1f076a, msg=22, wParam=1,
> >>     lParam=0) at ../../repo/src/w32fns.c:4805
> >
> > seems to indicate that you shut down your Windows session or
> > something?
> 
> Yes indeed. Hence "when shutting down or logging out". In this
> case shutting down the computer.

OK, supporting that is a relatively new feature, so it's little
surprise it needs more work.  Ken, could you please take a look?

As I understand it, this happens because when the input thread gets
the WM_ENDSESSION message, it posts it to the main thread and goes on
to sleep for 1000 sec, to avoid ending the Emacs process before it
finishes orderly shutdown.  But if the main thread happens to be
inside redisplay, it could invoke one of the function that send
messages to the input thread via SendMessage, which waits for the
input thread to respond.  So we do have a kind of deadlock.

One possible idea is to use SendMessageTimeout instead, with some
suitably chosen timeout.




This bug report was last modified 8 years and 85 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.