Subject: bug#12587: 24.2; Delayed startup, unresponsive Emacs in MS Windows when netlogon services is running in a domain

From: Mohammed Imaduddin Humayun <[email-masked]>
Date: Mon, 08 Oct 2012 16:34:18 +0200

On 10/8/2012 11:15 AM, Eli Zaretskii wrote:
>
> Is this with the latest development snapshot?  If not, please try with
> that, a lot has changed in that area lately.
>
> Also, what happens when w32-get-true-file-attributes is set to t?  Is
> the behavior closer to the default value or to nil?
Yes, it uses the latest alpha build.
When the atrribute's set to t, the behaviour's closer to default or in 
other words slow.

> OK.  If you don't already have GDB for Windows, please install it
> from here:
>
>    http://sourceforge.net/projects/mingw/files/MinGW/Extension/gdb/GDB-7.5/
>
> (If you are not an experienced MinGW user, you might be better off
> installing GDB with mingw-get utility, which is mentioned on the above
> page, because mingw-get will automatically install any dependencies
> needed by GDB.)
>
> Once GDB is installed, please follow these steps:
>
>    . Invoke Emacs
>
>    . Use the Task Manager or some equivalent to find out the process ID
>      of emacs.exe (not of runemacs.exe!), which is a number.  Since you
>      say the startup takes minutes, it shouldn't be a problem to do
>      this and the next step while Emacs is still stuck in whatever it's
>      doing at this stage.
>
>    . Type from the cmd prompt "gdb -p PID" where PID is the process ID
>      of emacs.exe, and hit Enter.  GDB will attach to the running
>      Emacs, stop it wherever it is, and show its prompt "(gdb)".
>
>    . Type at GDB's prompt "thread apply all backtrace", and post here
>      everything that GDB reports in response.
>
>    . If you can, try these steps both before and after the welcome
>      screen comes up, because it's possible that there's more than one
>      place that is holding the startup.
>
> Thanks.

GDB LOGS
(FYI ,  w32-get-true-file-attribute is default here, but changing this 
does not affect the startup time as mentioned earlier )
========================
Before Welcome Screen
=======================

Thread 3 (Thread 6444.0x212c):
#0  0x77d3000d in ntdll!LdrFindResource_U ()
    from C:\Windows\SysWOW64\ntdll.dll
#1  0x77dbf896 in ntdll!RtlQueryTimeZoneInformation ()
    from C:\Windows\SysWOW64\ntdll.dll
#2  0x0827293f in ?? ()
#3  0x00000000 in ?? ()

Thread 2 (Thread 6444.0x2ab4):
#0  0x77d4013d in ntdll!RtlEnableEarlyCriticalSectionEventCreation ()
    from C:\Windows\SysWOW64\ntdll.dll
#1  0x77d4013d in ntdll!RtlEnableEarlyCriticalSectionEventCreation ()
    from C:\Windows\SysWOW64\ntdll.dll
#2  0x77d72f51 in ntdll!RtlWeaklyEnumerateEntryHashTable ()
    from C:\Windows\SysWOW64\ntdll.dll
#3  0x00000003 in ?? ()
#4  0x00ce1820 in ?? ()
#5  0x770d339a in KERNEL32!BaseCleanupAppcompatCacheSupport ()
    from C:\Windows\syswow64\kernel32.dll
#6  0x00000000 in ?? ()

Thread 1 (Thread 6444.0x2104):
#0  0x77d40542 in ntdll!RtlInitOutOfProcessMemoryStream ()
    from C:\Windows\SysWOW64\ntdll.dll
#1  0x77d40542 in ntdll!RtlInitOutOfProcessMemoryStream ()
    from C:\Windows\SysWOW64\ntdll.dll
#2  0x768e75df in RPCRT4!NdrConformantVaryingArrayMarshall ()
    from C:\Windows\syswow64\rpcrt4.dll
#3  0x40020000 in ?? ()
#4  0x00d2eff8 in ?? ()
#5  0x768e7a7f in RPCRT4!NdrConformantVaryingArrayMarshall ()
    from C:\Windows\syswow64\rpcrt4.dll
#6  0x00d2eff8 in ?? ()
#7  0x768e7982 in RPCRT4!NdrConformantVaryingArrayMarshall ()
    from C:\Windows\syswow64\rpcrt4.dll
#8  0x00ce1140 in ?? ()
#9  0x768f0071 in RPCRT4!I_RpcEnableWmiTrace ()
    from C:\Windows\syswow64\rpcrt4.dll
#10 0x0088edb0 in ?? ()
#11 0x768e7391 in RPCRT4!NdrConformantVaryingArrayMarshall ()
    from C:\Windows\syswow64\rpcrt4.dll
#12 0x0088eddc in ?? ()
#13 0x768e804b in UuidCreateNil () from C:\Windows\syswow64\rpcrt4.dll
#14 0x768e801a in UuidCreateNil () from C:\Windows\syswow64\rpcrt4.dll
#15 0x75560d3e in SECHOST!LsaLookupGetDomainInfo ()
    from C:\Windows\SysWOW64\sechost.dll
#16 0x755545e8 in ?? () from C:\Windows\SysWOW64\sechost.dll
#17 0x75560966 in SECHOST!LsaLookupTranslateNames ()
    from C:\Windows\SysWOW64\sechost.dll
#18 0x75560a4c in SECHOST!LsaLookupTranslateSids ()
    from C:\Windows\SysWOW64\sechost.dll
#19 0x7556030b in SECHOST!LookupAccountNameLocalW ()
    from C:\Windows\SysWOW64\sechost.dll
#20 0x7556050c in SECHOST!LookupAccountSidLocalA ()
    from C:\Windows\SysWOW64\sechost.dll
#21 0x76821e1b in LookupAccountSidW () from C:\Windows\syswow64\advapi32.dll
#22 0x010572d7 in lookup_account_sid (lpSystemName=0x0, Sid=0xce1bc8,
     Name=0x88f7cf "humayun", cbName=0x88f7c8,
     DomainName=0x88f3c8 "GEOINFORMATIK", cbDomainName=0x88f3c4,
     peUse=0x88f8d0) at w32.c:495
#23 0x0105b343 in get_name_and_id (psd=0xce1b98,
     fname=0x88f970 "c:\\emacs-24.2.50\\etc\\GNU", id=0x88fbf4,
     nm=0x88fd14 "/emacs-24.2.50/etc/GNU", what=2) at w32.c:3437
#24 0x0105b43c in get_file_owner_and_group (psd=0xce1b98,
     fname=0x88f970 "c:\\emacs-24.2.50\\etc\\GNU", st=0x88fbe0) at 
w32.c:3467
#25 0x0105b91c in stat_worker (path=0x164a5c2 "\\emacs-24.2.50\\etc\\GNU",
     buf=0x88fbe0, follow_symlinks=1) at w32.c:3689
#26 0x0105bf49 in stat (path=0x39e9e50 "c:/emacs-24.2.50/etc/GNU",
     buf=0x88fbe0) at w32.c:3865
#27 0x01067a18 in Ffile_exists_p (filename=59080209) at fileio.c:2506
#28 0x010d48f1 in init_callproc () at callproc.c:1582
#29 0x0100289b in main (argc=1, argv=0xa32c18) at emacs.c:1435
Detaching from program: C:\emacs-24.2.50\bin\emacs.exe, Pid 6444

===================
After Welcome Screen
===================
Attaching to program `C:\emacs-24.2.50\bin\emacs.exe', process 6444
[New Thread 6444.0x2104]
[New Thread 6444.0x2ab4]
[New Thread 6444.0x1338]
[New Thread 6444.0x2cf0]
[New Thread 6444.0x2fe0]
[New Thread 6444.0x1708]
[New Thread 6444.0x2fbc]

Thread 7 (Thread 6444.0x2fbc):
#0  0x77d3000d in ntdll!LdrFindResource_U ()
    from C:\Windows\SysWOW64\ntdll.dll
#1  0x77dbf896 in ntdll!RtlQueryTimeZoneInformation ()
    from C:\Windows\SysWOW64\ntdll.dll
#2  0x0cdf293f in ?? ()
#3  0x00000000 in ?? ()

Thread 6 (Thread 6444.0x1708):
#0  0x77d41f26 in ntdll!LdrQueryProcessModuleInformation ()
    from C:\Windows\SysWOW64\ntdll.dll
#1  0x77d41f26 in ntdll!LdrQueryProcessModuleInformation ()
    from C:\Windows\SysWOW64\ntdll.dll
#2  0x77d73352 in ntdll!RtlCreateTagHeap () from 
C:\Windows\SysWOW64\ntdll.dll
#3  0x00000144 in ?? ()
#4  0x738cfedc in ?? ()
#5  0x770d339a in KERNEL32!BaseCleanupAppcompatCacheSupport ()
    from C:\Windows\syswow64\kernel32.dll
#6  0x00d32ef8 in ?? ()
#7  0x77d59ef2 in ntdll!RtlpNtSetValueKey ()
    from C:\Windows\SysWOW64\ntdll.dll
#8  0x00d32ef8 in ?? ()
#9  0x77d59ec5 in ntdll!RtlpNtSetValueKey ()
    from C:\Windows\SysWOW64\ntdll.dll
#10 0x77d73e45 in ntdll!RtlSidIsHigherLevel ()
    from C:\Windows\SysWOW64\ntdll.dll
#11 0x00d32ef8 in ?? ()
#12 0x00000000 in ?? ()

Thread 5 (Thread 6444.0x2fe0):
#0  0x77d41f26 in ntdll!LdrQueryProcessModuleInformation ()
    from C:\Windows\SysWOW64\ntdll.dll
#1  0x77d41f26 in ntdll!LdrQueryProcessModuleInformation ()
    from C:\Windows\SysWOW64\ntdll.dll
#2  0x77d73352 in ntdll!RtlCreateTagHeap () from 
C:\Windows\SysWOW64\ntdll.dll
#3  0x00000134 in ?? ()
#4  0x7178fedc in ?? ()
#5  0x770d339a in KERNEL32!BaseCleanupAppcompatCacheSupport ()
    from C:\Windows\syswow64\kernel32.dll
#6  0x00d32ef8 in ?? ()
#7  0x77d59ef2 in ntdll!RtlpNtSetValueKey ()
    from C:\Windows\SysWOW64\ntdll.dll
#8  0x00d32ef8 in ?? ()
#9  0x77d59ec5 in ntdll!RtlpNtSetValueKey ()
    from C:\Windows\SysWOW64\ntdll.dll
#10 0x77d73e45 in ntdll!RtlSidIsHigherLevel ()
    from C:\Windows\SysWOW64\ntdll.dll
#11 0x00d32ef8 in ?? ()
#12 0x00000000 in ?? ()

Thread 4 (Thread 6444.0x2cf0):
#0  0x77d41f26 in ntdll!LdrQueryProcessModuleInformation ()
    from C:\Windows\SysWOW64\ntdll.dll
#1  0x77d41f26 in ntdll!LdrQueryProcessModuleInformation ()
    from C:\Windows\SysWOW64\ntdll.dll
#2  0x77d73352 in ntdll!RtlCreateTagHeap () from 
C:\Windows\SysWOW64\ntdll.dll
#3  0x0000017c in ?? ()
#4  0x70f4fedc in ?? ()
#5  0x770d339a in KERNEL32!BaseCleanupAppcompatCacheSupport ()
    from C:\Windows\syswow64\kernel32.dll
#6  0x00d33b88 in ?? ()
#7  0x77d59ef2 in ntdll!RtlpNtSetValueKey ()
    from C:\Windows\SysWOW64\ntdll.dll
#8  0x00d33b88 in ?? ()
#9  0x77d59ec5 in ntdll!RtlpNtSetValueKey ()
    from C:\Windows\SysWOW64\ntdll.dll
#10 0x77d73e45 in ntdll!RtlSidIsHigherLevel ()
    from C:\Windows\SysWOW64\ntdll.dll
#11 0x00d33b88 in ?? ()
#12 0x00000000 in ?? ()

Thread 3 (Thread 6444.0x1338):
#0  0x773778d7 in USER32!IsDialogMessage ()
    from C:\Windows\syswow64\user32.dll
#1  0x773778d7 in USER32!IsDialogMessage ()
    from C:\Windows\syswow64\user32.dll
#2  0x7737790d in USER32!GetCursorPos () from C:\Windows\syswow64\user32.dll
#3  0x730cfec0 in ?? ()
#4  0x011490bd in w32_msg_pump (msg_buf=0x730cff28) at w32fns.c:2263
#5  0x011492fb in w32_msg_worker@4 (arg=0x0) at w32fns.c:2485
#6  0x770d339a in KERNEL32!BaseCleanupAppcompatCacheSupport ()
    from C:\Windows\syswow64\kernel32.dll
#7  0x00000000 in ?? ()

Thread 2 (Thread 6444.0x2ab4):
#0  0x77d4013d in ntdll!RtlEnableEarlyCriticalSectionEventCreation ()
    from C:\Windows\SysWOW64\ntdll.dll
#1  0x77d4013d in ntdll!RtlEnableEarlyCriticalSectionEventCreation ()
    from C:\Windows\SysWOW64\ntdll.dll
#2  0x77d72f51 in ntdll!RtlWeaklyEnumerateEntryHashTable ()
    from C:\Windows\SysWOW64\ntdll.dll
#3  0x00000003 in ?? ()
#4  0x00ce1820 in ?? ()
#5  0x770d339a in KERNEL32!BaseCleanupAppcompatCacheSupport ()
    from C:\Windows\syswow64\kernel32.dll
#6  0x00000000 in ?? ()

Thread 1 (Thread 6444.0x2104):
#0  0x77d4013d in ntdll!RtlEnableEarlyCriticalSectionEventCreation ()
    from C:\Windows\SysWOW64\ntdll.dll
#1  0x77d4013d in ntdll!RtlEnableEarlyCriticalSectionEventCreation ()
    from C:\Windows\SysWOW64\ntdll.dll
#2  0x75510bdd in WaitForMultipleObjectsEx ()
    from C:\Windows\syswow64\KernelBase.dll
#3  0x00000003 in ?? ()
#4  0x0088f1d4 in ?? ()
#5  0x770d1a2c in KERNEL32!GetVolumePathNamesForVolumeNameA ()
    from C:\Windows\syswow64\kernel32.dll
#6  0x0088f1d4 in ?? ()
#7  0x7738086a in USER32!MessageBoxA () from C:\Windows\syswow64\user32.dll
#8  0x00000003 in ?? ()
#9  0x7efde000 in ?? ()
#10 0x77380b69 in USER32!DdeNameService () from 
C:\Windows\syswow64\user32.dll
#11 0x00000050 in ?? ()
#12 0x0088f400 in ?? ()
#13 0x010551a1 in sys_select (nfds=1, rfds=0x88f6c0, wfds=0x0, efds=0x0,
     timeout=0x88f6b0, ignored=0x0) at w32proc.c:1270
#14 0x0104cd4e in wait_reading_process_output (time_limit=28, nsecs=0,
     read_kbd=-1, do_display=1, wait_for_cell=56346650, wait_proc=0x0,
     just_wait_proc=0) at process.c:4647
#15 0x010fbc2a in sit_for (timeout=112, reading=true, do_display=1)
     at dispnew.c:5977
#16 0x010095c4 in read_char (commandflag=1, nmaps=2, maps=0x88f960,
     prev_event=56346650, used_mouse_menu=0x88fa38, end_time=0x0)
     at keyboard.c:2707
#17 0x0101ccb2 in read_key_sequence (keybuf=0x88fbc0, bufsize=30,
     prompt=56346650, dont_downcase_last=0, can_return_switch_frame=1,
     fix_current_buffer=1) at keyboard.c:9312
#18 0x01005f89 in command_loop_1 () at keyboard.c:1487
#19 0x0103269f in internal_condition_case (bfun=0x1005a97 <command_loop_1>,
     handlers=56397234, hfun=0x100526a <cmd_error>) at eval.c:1308
#20 0x010056c4 in command_loop_2 (ignore=56346650) at keyboard.c:1182
#21 0x010320bb in internal_catch (tag=56387090,
     func=0x10056a0 <command_loop_2>, arg=56346650) at eval.c:1069
#22 0x0100567e in command_loop () at keyboard.c:1161
#23 0x01004c27 in recursive_edit_1 () at keyboard.c:782
#24 0x01004f54 in Frecursive_edit () at keyboard.c:846
#25 0x01002b68 in main (argc=1, argv=0xa32c18) at emacs.c:1655
Detaching from program: C:\emacs-24.2.50\bin\emacs.exe, Pid 6444

-----------------------------------------------------------------------------------------------

PS: In case you're wondering how the gdb log's like when netlogon 
process is not running, see http://pastebin.com/DRuxk2ms

Thanks for actively following up on this.