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

From: Dani Moncayo <[email-masked]>
Date: Mon, 21 Jul 2014 14:35:01 +0200

>> The backtrace looks similar to the ones already reported:
>
> Actually, it's not similar, it's quite different.
>
> However, I suspect that GDB lies to us about the backtrace, and at the
> very least conceals part of the stack frames.  Could you please
> produce the stack traces from Process Explorer, as you did in the
> past?

See below.  These stack traces come from the pre-release version
24.3.92, with just the change you told me:

> If you comment out the call to term_winsock in term_ntproc, does the
> problem go away?

TID: 888
State: Wait:WrUserRequest
<stack>
wow64win.dll+0x3fe3a
wow64win.dll+0x1aeac
wow64.dll!Wow64SystemServiceEx+0xd7
wow64cpu.dll!TurboDispatchJumpAddressEnd+0x2d
wow64.dll!Wow64SystemServiceEx+0x1ce
wow64.dll!Wow64LdrpInitialize+0x42a
ntdll.dll!TpAlpcRegisterCompletionList+0x7f8b
ntdll.dll!LdrInitializeThunk+0xe
USER32.dll!DispatchMessageW+0x5c
emacs.exe+0x1f5a6c: w32_msg_pump at w32fns.c:2450
emacs.exe+0x1f5caa: w32_msg_worker@4 at w32fns.c:2678
ntdll.dll!RtlInitializeExceptionChain+0x63
ntdll.dll!RtlInitializeExceptionChain+0x36
</stack>

TID: 3012
State: Wait:UserRequest
<stack>
wow64cpu.dll!TurboDispatchJumpAddressEnd+0x6c0
wow64cpu.dll!TurboDispatchJumpAddressEnd+0xf5
wow64.dll!Wow64SystemServiceEx+0x1ce
wow64.dll!Wow64LdrpInitialize+0x42a
ntdll.dll!TpAlpcRegisterCompletionList+0x7f8b
ntdll.dll!LdrInitializeThunk+0xe
ntdll.dll!NtWaitForMultipleObjects+0x15
kernel32.dll!BaseThreadInitThunk+0x12
ntdll.dll!RtlInitializeExceptionChain+0x63
ntdll.dll!RtlInitializeExceptionChain+0x36
</stack>

TID: 6792
State: Wait:UserRequest
<stack>
wow64cpu.dll!TurboDispatchJumpAddressEnd+0x6c0
wow64cpu.dll!TurboDispatchJumpAddressEnd+0x4a8
wow64.dll!Wow64SystemServiceEx+0x1ce
wow64.dll!Wow64LdrpInitialize+0x42a
ntdll.dll!RtlUniform+0x6e6
ntdll.dll!MD5Final+0x21e83
ntdll.dll!LdrInitializeThunk+0xe
ntdll.dll!NtWaitForSingleObject+0x15
ntdll.dll!RtlIntegerToUnicodeString+0x20b
ntdll.dll!LdrGetDllHandleEx+0x29b
ntdll.dll!LdrGetDllHandle+0x18
ntdll.dll!RtlDetermineDosPathNameType_U+0x1fa
KERNELBASE.dll!GetModuleFileNameW+0x3bd
KERNELBASE.dll!GetModuleHandleW+0x29
KERNELBASE.dll!GetModuleHandleA+0x34
emacs.exe+0x135a: ?? at cygming-crtbegin.c:0
emacs.exe+0xf60bf: shut_down_emacs at emacs.c:1991
emacs.exe+0xf1ad0: SUBRP at lisp.h:2471
emacs.exe+0xf0375: XSUBR at lisp.h:914
emacs.exe+0x18546f: Ffuncall at eval.c:2815
emacs.exe+0x1c6094: exec_byte_code at bytecode.c:916
emacs.exe+0x185c51: funcall_lambda at eval.c:2983
emacs.exe+0x1856ab: Ffuncall at eval.c:2864
emacs.exe+0x1c6094: exec_byte_code at bytecode.c:916
emacs.exe+0x185c51: funcall_lambda at eval.c:2983
emacs.exe+0x1856ab: Ffuncall at eval.c:2864
emacs.exe+0x17ec53: Fcall_interactively at callint.c:836
emacs.exe+0x1854c4: Ffuncall at eval.c:2822
emacs.exe+0x1c6094: exec_byte_code at bytecode.c:916
emacs.exe+0x185c51: funcall_lambda at eval.c:2983
emacs.exe+0x1856ab: Ffuncall at eval.c:2864
emacs.exe+0x184f5a: call1 at eval.c:2614
emacs.exe+0xf8899: command_loop_1 at keyboard.c:1567
emacs.exe+0x1823cf: internal_condition_case at eval.c:1354
emacs.exe+0xf7eea: command_loop_2 at keyboard.c:1177
emacs.exe+0x18197c: internal_catch at eval.c:1118
emacs.exe+0xf7ea2: command_loop at keyboard.c:1157
emacs.exe+0xf7638: recursive_edit_1 at keyboard.c:777
emacs.exe+0xf77f4: Frecursive_edit at keyboard.c:849
emacs.exe+0xf59f7: main at emacs.c:1648
emacs.exe+0x10b9: __mingw_CRTStartup at crt1.c:244
emacs.exe+0x1284: WinMainCRTStartup at crt1.c:274
emacs.exe+0x1c3a64: _start at unexw32.c:125
kernel32.dll!BaseThreadInitThunk+0x12
ntdll.dll!RtlInitializeExceptionChain+0x63
ntdll.dll!RtlInitializeExceptionChain+0x36
</stack>

TID: 6956
State: Wait:UserRequest
<stack>
wow64cpu.dll!TurboDispatchJumpAddressEnd+0x6c0
wow64cpu.dll!TurboDispatchJumpAddressEnd+0x4a8
wow64.dll!Wow64SystemServiceEx+0x1ce
wow64.dll!Wow64LdrpInitialize+0x42a
ntdll.dll!TpAlpcRegisterCompletionList+0x7f8b
ntdll.dll!LdrInitializeThunk+0xe
ntdll.dll!NtWaitForSingleObject+0x15
ntdll.dll!RtlIntegerToUnicodeString+0x20b
ntdll.dll!LdrShutdownThread+0x50
ntdll.dll!RtlExitUserThread+0x2a
kernel32.dll!BaseThreadInitThunk+0x19
ntdll.dll!RtlInitializeExceptionChain+0x63
ntdll.dll!RtlInitializeExceptionChain+0x36
</stack>

-- 
Dani Moncayo