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

From: Eli Zaretskii <[email-masked]>
Date: Fri, 12 Oct 2012 17:27:00 +0200

> Date: Mon, 08 Oct 2012 17:47:15 +0200
> From: Eli Zaretskii <[email-masked]>
> Cc: [email-masked]
> 
> This part is clear: we are waiting for file security-related system
> calls:
> 
> > #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
> 
> As you see, these calls are originated from a function that needs to
> establish whether a certain file exists.  In a Windows domain, these
> calls go to the domain controller, and are evidently very slow when
> the Netlogon service is up and running.  I think I can find a solution
> for this.

I committed a change in trunk revision 110520 which should make this
part faster, as these functions now avoid calling 'stat' as much as
possible.  When the binaries of the next development snapshot appear
on http://alpha.gnu.org/gnu/emacs/windows/, or if you can build Emacs
yourself, please try that and see if things are better now when the
Netlogon service is running.

> I see that I misinterpreted your original report about the startup
> time line.  I now understand that after the welcome screen Emacs is
> responsive, and the slowdown is before the welcome screen.
> 
> So please repeat what you did, but do it once before the GUI shows up,
> and then again between the time the GUI shows up and the time Emacs
> shows its welcome screen.  (If you know to which of these two time
> instances belongs the first backtrace you show above, you need only to
> produce the backtrace for the other time instance.)

I'd still like to see this information, to make sure there isn't any
other place that slows down the startup.

Thanks.