Subject: bug#14333: 24.3.50; Emacs hangs when trying to exit

From: Dani Moncayo <[email-masked]>
Date: Mon, 30 Jun 2014 18:33:42 +0200

I still keep getting hung sessions while trying to exit.  For example
just now, with a recent version of Emacs under MS-Windows:

In GNU Emacs 24.4.50.1 (i686-pc-mingw32)
 of 2014-06-15 on LEG570
Repository revision: 117347 [email-masked]
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --enable-checking 'CFLAGS=-O0 -g3' CPPFLAGS=-DGLYPH_DEBUG=1'.

I've been able to attach gdb to the hung process, and get a full
backtrace (see below).

I will leave the session open, in case you need me to print some values.

(gdb) thread apply all bt full

Thread 5 (Thread 4356.0x1b1c):
#0  0x7720000d in ntdll!DbgBreakPoint () from C:\Windows\SysWOW64\ntdll.dll
No symbol table info available.
#1  0x7728f8ee in ntdll!DbgUiRemoteBreakin () from C:\Windows\SysWOW64\ntdll.dll
No symbol table info available.
#2  0x7ea7cdd7 in ?? ()
No symbol table info available.
#3  0x00000000 in ?? ()
No symbol table info available.

Thread 4 (Thread 4356.0x17b0):
#0  0x7720f8d1 in ntdll!ZwWaitForSingleObject () from
C:\Windows\SysWOW64\ntdll.dll
No symbol table info available.
#1  0x7720f8d1 in ntdll!ZwWaitForSingleObject () from
C:\Windows\SysWOW64\ntdll.dll
No symbol table info available.
#2  0x7722b4b4 in ntdll!RtlIntegerToUnicodeString () from
C:\Windows\SysWOW64\ntdll.dll
No symbol table info available.
#3  0x7722b398 in ntdll!RtlIntegerToUnicodeString () from
C:\Windows\SysWOW64\ntdll.dll
No symbol table info available.
#4  0x7724650d in ntdll!LdrShutdownThread () from C:\Windows\SysWOW64\ntdll.dll
No symbol table info available.
#5  0x772f20c0 in ntdll!NlsAnsiCodePage () from C:\Windows\SysWOW64\ntdll.dll
No symbol table info available.
#6  0x7213cd27 in ?? ()
No symbol table info available.
#7  0x00000000 in ?? ()
No symbol table info available.

Thread 3 (Thread 4356.0x1798):
#0  0x758778d7 in USER32!DispatchMessageW () from C:\Windows\syswow64\user32.dll
No symbol table info available.
#1  0x011f62d6 in w32_msg_pump (msg_buf=0x73dff28) at
c:/msys/home/Dani/emacs/trunk/src/w32fns.c:2449
        msg = {hwnd = 0x50ad8, message = 275, wParam = 1, lParam = 0,
time = 34482460, pt = {x = 223,
            y = 444}}
        result = 0
        focus_window = 0x403
#2  0x011f6514 in w32_msg_worker@4 (arg=0x0) at
c:/msys/home/Dani/emacs/trunk/src/w32fns.c:2675
        msg = {hwnd = 0x0, message = 0, wParam = 0, lParam = 0, time =
0, pt = {x = 0, y = 0}}
        dummy_buf = {next = 0x0, w32msg = {msg = {hwnd = 0x0, message
= 0, wParam = 0, lParam = 0,
              time = 0, pt = {x = 0, y = 0}}, dwModifiers = 0, rect =
{left = 0, top = 0, right = 0,
              bottom = 0}}, result = 0, completed = 0}
#3  0x751b338a in KERNEL32!BaseThreadInitThunk () from
C:\Windows\syswow64\kernel32.dll
No symbol table info available.
#4  0x7722bf32 in ntdll!RtlInitializeExceptionChain () from
C:\Windows\SysWOW64\ntdll.dll
No symbol table info available.
#5  0x7722bf05 in ntdll!RtlInitializeExceptionChain () from
C:\Windows\SysWOW64\ntdll.dll
No symbol table info available.
#6  0x00000000 in ?? ()
No symbol table info available.

Thread 2 (Thread 4356.0xacc):
#0  0x7721015d in ntdll!ZwWaitForMultipleObjects () from
C:\Windows\SysWOW64\ntdll.dll
No symbol table info available.
#1  0x7721015d in ntdll!ZwWaitForMultipleObjects () from
C:\Windows\SysWOW64\ntdll.dll
No symbol table info available.
#2  0x7722c6c5 in ntdll!RtlRegisterThreadWithCsrss () from
C:\Windows\SysWOW64\ntdll.dll
No symbol table info available.
#3  0x751b338a in KERNEL32!BaseThreadInitThunk () from
C:\Windows\syswow64\kernel32.dll
No symbol table info available.
#4  0x7722bf32 in ntdll!RtlInitializeExceptionChain () from
C:\Windows\SysWOW64\ntdll.dll
No symbol table info available.
#5  0x7722bf05 in ntdll!RtlInitializeExceptionChain () from
C:\Windows\SysWOW64\ntdll.dll
No symbol table info available.
#6  0x00000000 in ?? ()
No symbol table info available.

Thread 1 (Thread 4356.0x1e00):
#0  0x7720f8d1 in ntdll!ZwWaitForSingleObject () from
C:\Windows\SysWOW64\ntdll.dll
No symbol table info available.
#1  0x7720f8d1 in ntdll!ZwWaitForSingleObject () from
C:\Windows\SysWOW64\ntdll.dll
No symbol table info available.
#2  0x7722b4b4 in ntdll!RtlIntegerToUnicodeString () from
C:\Windows\SysWOW64\ntdll.dll
No symbol table info available.
#3  0x7722b398 in ntdll!RtlIntegerToUnicodeString () from
C:\Windows\SysWOW64\ntdll.dll
No symbol table info available.
#4  0x77233ab8 in ntdll!LdrUnloadDll () from C:\Windows\SysWOW64\ntdll.dll
No symbol table info available.
#5  0x772f20c0 in ntdll!NlsAnsiCodePage () from C:\Windows\SysWOW64\ntdll.dll
No symbol table info available.
#6  0x772fdb73 in ?? ()
No symbol table info available.
#7  0x087c0878 in ?? ()
No symbol table info available.
#8  0x76a62d2c in KERNELBASE!FreeLibrary () from
C:\Windows\syswow64\KernelBase.dll
No symbol table info available.
#9  0x6e52c1ad in NSPStartup () from C:\Windows\System32\mswsock.dll
No symbol table info available.
#10 0x6e52c207 in NSPStartup () from C:\Windows\System32\mswsock.dll
No symbol table info available.
#11 0x76aaaf4c in WahEnumerateHandleContexts () from
C:\Windows\syswow64\ws2_32.dll
No symbol table info available.
#12 0x76aaae54 in WahEnumerateHandleContexts () from
C:\Windows\syswow64\ws2_32.dll
No symbol table info available.
#13 0x76aa659e in WSACloseEvent () from C:\Windows\syswow64\ws2_32.dll
No symbol table info available.
#14 0x00000000 in ?? ()
No symbol table info available.

-- 
Dani Moncayo