From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#74311: Long startup time on windows (with simple fix) Date: Wed, 1 Jan 2025 20:03:04 -0600 Message-ID: References: <86v7wtkj5c.fsf@gnu.org> <86ttcdkeuu.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24519"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Vladimir =?UTF-8?Q?=C5=A0ironja?= , 74311@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 02 03:04:19 2025 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tTAZO-0006Dj-FG for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 02 Jan 2025 03:04:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tTAZC-0003XR-6e; Wed, 01 Jan 2025 21:04:06 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tTAZA-0003X8-DH for bug-gnu-emacs@gnu.org; Wed, 01 Jan 2025 21:04:04 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tTAZ8-0003Ki-K0 for bug-gnu-emacs@gnu.org; Wed, 01 Jan 2025 21:04:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:MIME-Version:References:In-Reply-To:From:To:Subject; bh=SDYUEa7Caus3TVk89ecwZJqAhxKBTdkWUH6ewdB8EJ0=; b=R5MvEUHAWMVJ2kiqBhahtrw64dvIambTfe99nHaJUYEYB1pxYf7q3Kd2YMeZrMkto9Ay4egej9z7ZWvA8wOqlVI0MBD7JGg2GBgqFj9qZ73mR0cB/DzGM/7irknGM1fKYbNvt300d3W9BCnQVF+1JKiYO7+c/UIelXCTHIPDbmYlqt68Y6euHiiGJA3R0pRYGxhnEMd3JGwfZywlkjQP9k1QEcm+Ys5nTHyr1e5qIlYEsN+GlGi9F+0kwkRqrYz4tHIZmabbE+Ig4FXKf/iu9z0e3QxQq5QxhJR9KYFW//hQai0R4QPmtOY/1hm9IZjv+LKRJ6zdeqqRZQGi9ZeJsw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tTAZ8-0002X0-Dq for bug-gnu-emacs@gnu.org; Wed, 01 Jan 2025 21:04:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 02 Jan 2025 02:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74311 X-GNU-PR-Package: emacs Original-Received: via spool by 74311-submit@debbugs.gnu.org id=B74311.17357833949638 (code B ref 74311); Thu, 02 Jan 2025 02:04:02 +0000 Original-Received: (at 74311) by debbugs.gnu.org; 2 Jan 2025 02:03:14 +0000 Original-Received: from localhost ([127.0.0.1]:41409 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tTAYL-0002VN-Hr for submit@debbugs.gnu.org; Wed, 01 Jan 2025 21:03:14 -0500 Original-Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]:43478) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tTAYI-0002Uu-GH for 74311@debbugs.gnu.org; Wed, 01 Jan 2025 21:03:11 -0500 Original-Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5d3f57582a2so21058578a12.1 for <74311@debbugs.gnu.org>; Wed, 01 Jan 2025 18:03:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735783384; x=1736388184; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date :mime-version:references:in-reply-to:from:from:to:cc:subject:date :message-id:reply-to; bh=SDYUEa7Caus3TVk89ecwZJqAhxKBTdkWUH6ewdB8EJ0=; b=TPrxUDgILxVKrZX8T1EoSBwRjEOZQRfbWyEbTaoWjYZXixkaCbCjOilv0kRHdJMWCj TIY1Fn5kiig3fbe15DTr82HxGIdnhD+iz10YzC/ddNLEOBi+pbHwGbEVZND5ZI/tcOKh SliSGkXoycq/4tjp3jvF9zaBtrBtolfAZZnDVCNQL0TOgEqSCJHIqpEuGY1fHVJmqpv1 h0sHKhyvPf+2YAaO0xRGrQVNzd78CM0ti5Tblwit9kVkZyYfMsXEW3WSfbnUwS65vxKg kfbip7qG+tk28gfDf2Sv9kFTn3w7TmiP0Q/IoekiN/bsqxW1R8qOus7OtBcnHgq8RZvF DglQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735783384; x=1736388184; h=content-transfer-encoding:cc:to:subject:message-id:date :mime-version:references:in-reply-to:from:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=SDYUEa7Caus3TVk89ecwZJqAhxKBTdkWUH6ewdB8EJ0=; b=MMxi3PzXKEj7+/X6v/FsRb3h/zqZSfRo7HnZpxZ2wOBpTjdWnRMpAQLSQahhd3HAqM S3EBpddI7swDCYJuh/TjX83Fpp1MulDIzDfVZJD8UMhdPp7nXCaW0izKWrEbPcS2g2Jv CLdXXlW2qStGRanfoNCuAdrLTZryh3iziV/uAu1s94keR/GxdqsNLOQL5QLWB2ZaSdEh 9sTo2nomKtPZIUCOqz6Rg0EYM9udCrdyV/JwjfNXN+GBPTkZ0/tudJt84kXJ6YzeMI+8 mCz/oRq6CZONbYE9UlF73d17TQId+mo9NXK58onTJP8Sk1VJklnS2Z2QiryAWYDz8MR7 ktwQ== X-Forwarded-Encrypted: i=1; AJvYcCVdJNKbdTJAB/vEZKQxkJeiULzak/cmu8+MJGph70fqhVSOjtXQSqUJRpG0HYR8uKhLzKGqZw==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yxh1/YI0qDDR9WeEy4IgW3Z2aOqoP5HTVqzqI0ELyy30XE0NEuy O5U6itmWWAVwudJz/iOU+ikd40K6uG3tstJ1I6NST5X8qA+k28AjnS0JrNqpQP1UkvwPFfkjIAl udw1hOrEphmMeXatRyX34StcLHv0= X-Gm-Gg: ASbGncuhPNJ0q7CBrDR13rA83RjpK+I4Qty5lmTQDGpbKhhm3CpBXeSYcUcuJhKVfEC 59ZDX/WMV7hHMG8QggYCn7C6gf87777OSrsYKV69M X-Google-Smtp-Source: AGHT+IFCSndA+By5BsfIZ8N1c223ylqU0ebH/PHeH1m+63ZKljkgXimk8vJkFERf7iS3CnYPlUPyDBgONQ58oiXdHXg= X-Received: by 2002:a05:6402:2115:b0:5d0:7a0b:b45f with SMTP id 4fb4d7f45d1cf-5d8023a1343mr44212912a12.10.1735783384294; Wed, 01 Jan 2025 18:03:04 -0800 (PST) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 1 Jan 2025 20:03:04 -0600 In-Reply-To: <86ttcdkeuu.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 11 Nov 2024 16:46:33 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:298099 Archived-At: Eli Zaretskii writes: >> From: Vladimir =C5=A0ironja >> Date: Mon, 11 Nov 2024 15:12:39 +0100 >> Cc: 74311@debbugs.gnu.org >> >> sorry, didn't quite understand which bugs should be separated, please >> advice again, > > Sorry, my misunderstanding, please ignore that part. > >> 1) regarding netlogon, I do not really have an option disconnecting from= DC > > Canj you at least try it once, to see if that is the root cause? > >> Here the debugger session: >> >> (gdb) b w32.c:701 >> Breakpoint 1 at 0x40031a8e0: file w32.c, line 701. >> (gdb) run >> Starting program: C:\Development\emacs-emacs-29.4\src\emacs.exe >> [New Thread 20812.0x73b4] >> [New Thread 20812.0x7bbc] >> [New Thread 20812.0x60fc] >> >> Thread 1 hit Breakpoint 1, lookup_account_sid (lpSystemName=3D0x0, >> Sid=3D0x3e714b0, Name=3D0xbfe850 "=E2=94=94o\021", cbName=3D0xbfe32c, >> DomainName=3D0xbfe330 "b", cbDomainName=3D0xbfe328, peUse=3D0xbfe314) at >> w32.c:701 >> 701 HMODULE hm_advapi32 =3D NULL; >> (gdb) bt >> #0 lookup_account_sid (lpSystemName=3D0x0, Sid=3D0x3e714b0, Name=3D0xbf= e850 >> "=E2=94=94o\021", cbName=3D0xbfe32c, DomainName=3D0xbfe330 "b", >> cbDomainName=3D0xbfe328, peUse=3D0xbfe314) at w32.c:701 >> #1 0x00007ff79378d364 in init_user_info () at w32.c:2314 >> #2 0x00007ff79378f2fe in init_environment (argv=3D0x26015b0) at w32.c:3= 233 >> #3 0x00007ff7935a93de in main (argc=3D1, argv=3D0x26015b0) at emacs.c:2= 120 >> (gdb) continue >> Continuing. >> >> Thread 1 hit Breakpoint 1, lookup_account_sid (lpSystemName=3D0x0, >> Sid=3D0x3e714a8, Name=3D0xbfe740 "XD=E2=94=8C=C3=B4\001", cbName=3D0xbfe= 320, >> DomainName=3D0x0, cbDomainName=3D0xbfe328, peUse=3D0xbfe314) at w32.c:70= 1 >> 701 HMODULE hm_advapi32 =3D NULL; >> (gdb) bt >> #0 lookup_account_sid (lpSystemName=3D0x0, Sid=3D0x3e714a8, Name=3D0xbf= e740 >> "XD=E2=94=8C=C3=B4\001", cbName=3D0xbfe320, DomainName=3D0x0, cbDomainNa= me=3D0xbfe328, >> peUse=3D0xbfe314) at w32.c:701 >> #1 0x00007ff79378d50c in init_user_info () at w32.c:2354 >> #2 0x00007ff79378f2fe in init_environment (argv=3D0x26015b0) at w32.c:3= 233 >> #3 0x00007ff7935a93de in main (argc=3D1, argv=3D0x26015b0) at emacs.c:2= 120 >> (gdb) info locals >> cache =3D {ret =3D 1, Name =3D 0x2606560 "Vladimir.Sironja", DomainName = =3D >> 0x26065b0 "EDGE", peUse =3D SidTypeUser} >> been_here_count =3D 2 >> s_pfn_Lookup_Account_Sid =3D 0x7ff9e0d9bc20 >> hm_advapi32 =3D 0x7ff9e0d50000 >> ret =3D 5 >> (gdb) continue >> Continuing. >> [New Thread 20812.0x4594] >> >> Thread 1 hit Breakpoint 1, lookup_account_sid (lpSystemName=3D0x0, >> Sid=3D0x1242d4, Name=3D0xbfdb30 "\220\\q=C3=8C=C2=A8\177", cbName=3D0xbf= db2c, >> DomainName=3D0xbfd720 "P3\022", cbDomainName=3D0xbfd71c, peUse=3D0xbfdc3= 8) >> at w32.c:701 >> 701 HMODULE hm_advapi32 =3D NULL; >> (gdb) bt >> #0 lookup_account_sid (lpSystemName=3D0x0, Sid=3D0x1242d4, Name=3D0xbfd= b30 >> "\220\\q=C3=8C=C2=A8\177", cbName=3D0xbfdb2c, DomainName=3D0xbfd720 "P3\= 022", >> cbDomainName=3D0xbfd71c, peUse=3D0xbfdc38) at w32.c:701 >> #1 0x00007ff793792fa6 in get_name_and_id (psd=3D0x1242c0, id=3D0xbfeac0= , >> nm=3D0xbfeaf0 "=C3=B19=C3=9E\003", what=3D1) at w32.c:5230 >> #2 0x00007ff79379308b in get_file_owner_and_group (psd=3D0x1242c0, >> st=3D0xbfeab0) at w32.c:5256 >> #3 0x00007ff79379379f in stat_worker (path=3D0x7ff793da0043 >> "Development\\emacs-emacs-29.4\\src\\", buf=3D0xbfeab0, >> follow_symlinks=3D0) at w32.c:5504 >> #4 0x00007ff793794217 in fstatat (fd=3D-3041965, name=3D0x3e7d408 >> "c:/Development/emacs-emacs-29.4/src/", st=3D0xbfeab0, flags=3D4096) at >> w32.c:5751 >> #5 0x00007ff7935d7b79 in emacs_fstatat (dirfd=3D-3041965, >> filename=3D0x3e7d408 "c:/Development/emacs-emacs-29.4/src/", >> st=3D0xbfeab0, flags=3D4096) at sysdep.c:2338 >> #6 0x00007ff793612ab9 in file_attributes (fd=3D-3041965, name=3D0x3e7d4= 08 >> "c:/Development/emacs-emacs-29.4/src/", dirname=3D0x0, >> filename=3D0x3e839a4, id_format=3D0x0) at dired.c:1016 >> #7 0x00007ff793612a1e in Ffile_attributes (filename=3D0x3e839a4, >> id_format=3D0x0) at dired.c:962 >> #8 0x00007ff7936810f6 in funcall_subr (subr=3D0x7ff793c824a0 >> , numargs=3D1, args=3D0x4cbd070) at eval.c:3040 >> #9 0x00007ff7936d99a3 in exec_byte_code (fun=3D0x44e227d, >> args_template=3D513, nargs=3D2, args=3D0x4cbd200) at bytecode.c:809 >> #10 0x00007ff7936814f2 in fetch_and_exec_byte_code (fun=3D0x43ee9e5, >> args_template=3D0, nargs=3D0, args=3D0xbff420) at eval.c:3085 >> #11 0x00007ff793681899 in funcall_lambda (fun=3D0x43ee9e5, nargs=3D0, >> arg_vector=3D0xbff420) at eval.c:3157 >> #12 0x00007ff793681676 in apply_lambda (fun=3D0x43ee9e5, args=3D0x0, >> count=3D...) at eval.c:3107 >> #13 0x00007ff79367fb3f in eval_sub (form=3D0x48a614b) at eval.c:2549 >> #14 0x00007ff79367f0af in Feval (form=3D0x48a614b, lexical=3D0x0) at eva= l.c:2365 >> #15 0x00007ff7935ae82a in top_level_2 () at keyboard.c:1142 >> #16 0x00007ff79367ce04 in internal_condition_case (bfun=3D0x7ff7935ae803 >> , handlers=3D0x90, hfun=3D0x7ff7935adfad ) at >> eval.c:1474 >> #17 0x00007ff7935ae87c in top_level_1 (ignore=3D0x0) at keyboard.c:1150 >> #18 0x00007ff79367c4ac in internal_catch (tag=3D0x103b0, >> func=3D0x7ff7935ae82f , arg=3D0x0) at eval.c:1197 >> #19 0x00007ff7935ae6d2 in command_loop () at keyboard.c:1110 >> #20 0x0000000000000000 in ?? () >> (gdb) info locals >> cache =3D {ret =3D 1, Name =3D 0x2606560 "Vladimir.Sironja", DomainName = =3D >> 0x26065b0 "EDGE", peUse =3D SidTypeUser} >> been_here_count =3D 3 >> s_pfn_Lookup_Account_Sid =3D 0x7ff9e0d9bc20 >> hm_advapi32 =3D 0x0 >> ret =3D 0 >> (gdb) continue >> Continuing. >> >> Thread 1 hit Breakpoint 1, lookup_account_sid (lpSystemName=3D0x0, >> Sid=3D0x1242f0, Name=3D0xbfdb30 "Vladimir.Sironja", cbName=3D0xbfdb2c, >> DomainName=3D0xbfd720 "EDGE", cbDomainName=3D0xbfd71c, peUse=3D0xbfdc38) >> at w32.c:701 >> 701 HMODULE hm_advapi32 =3D NULL; >> (gdb) bt >> #0 lookup_account_sid (lpSystemName=3D0x0, Sid=3D0x1242f0, Name=3D0xbfd= b30 >> "Vladimir.Sironja", cbName=3D0xbfdb2c, DomainName=3D0xbfd720 "EDGE", >> cbDomainName=3D0xbfd71c, peUse=3D0xbfdc38) at w32.c:701 >> #1 0x00007ff793792fa6 in get_name_and_id (psd=3D0x1242c0, id=3D0xbfeac4= , >> nm=3D0xbfebf4 "", what=3D2) at w32.c:5230 >> #2 0x00007ff7937930c2 in get_file_owner_and_group (psd=3D0x1242c0, >> st=3D0xbfeab0) at w32.c:5258 >> #3 0x00007ff79379379f in stat_worker (path=3D0x7ff793da0043 >> "Development\\emacs-emacs-29.4\\src\\", buf=3D0xbfeab0, >> follow_symlinks=3D0) at w32.c:5504 >> #4 0x00007ff793794217 in fstatat (fd=3D-3041965, name=3D0x3e7d408 >> "c:/Development/emacs-emacs-29.4/src/", st=3D0xbfeab0, flags=3D4096) at >> w32.c:5751 >> #5 0x00007ff7935d7b79 in emacs_fstatat (dirfd=3D-3041965, >> filename=3D0x3e7d408 "c:/Development/emacs-emacs-29.4/src/", >> st=3D0xbfeab0, flags=3D4096) at sysdep.c:2338 >> #6 0x00007ff793612ab9 in file_attributes (fd=3D-3041965, name=3D0x3e7d4= 08 >> "c:/Development/emacs-emacs-29.4/src/", dirname=3D0x0, >> filename=3D0x3e839a4, id_format=3D0x0) at dired.c:1016 >> #7 0x00007ff793612a1e in Ffile_attributes (filename=3D0x3e839a4, >> id_format=3D0x0) at dired.c:962 >> #8 0x00007ff7936810f6 in funcall_subr (subr=3D0x7ff793c824a0 >> , numargs=3D1, args=3D0x4cbd070) at eval.c:3040 >> #9 0x00007ff7936d99a3 in exec_byte_code (fun=3D0x44e227d, >> args_template=3D513, nargs=3D2, args=3D0x4cbd200) at bytecode.c:809 >> #10 0x00007ff7936814f2 in fetch_and_exec_byte_code (fun=3D0x43ee9e5, >> args_template=3D0, nargs=3D0, args=3D0xbff420) at eval.c:3085 >> #11 0x00007ff793681899 in funcall_lambda (fun=3D0x43ee9e5, nargs=3D0, >> arg_vector=3D0xbff420) at eval.c:3157 >> #12 0x00007ff793681676 in apply_lambda (fun=3D0x43ee9e5, args=3D0x0, >> count=3D...) at eval.c:3107 >> #13 0x00007ff79367fb3f in eval_sub (form=3D0x48a614b) at eval.c:2549 >> #14 0x00007ff79367f0af in Feval (form=3D0x48a614b, lexical=3D0x0) at eva= l.c:2365 >> #15 0x00007ff7935ae82a in top_level_2 () at keyboard.c:1142 >> #16 0x00007ff79367ce04 in internal_condition_case (bfun=3D0x7ff7935ae803 >> , handlers=3D0x90, hfun=3D0x7ff7935adfad ) at >> eval.c:1474 >> #17 0x00007ff7935ae87c in top_level_1 (ignore=3D0x0) at keyboard.c:1150 >> #18 0x00007ff79367c4ac in internal_catch (tag=3D0x103b0, >> func=3D0x7ff7935ae82f , arg=3D0x0) at eval.c:1197 >> #19 0x00007ff7935ae6d2 in command_loop () at keyboard.c:1110 >> #20 0x0000000000000000 in ?? () >> (gdb) info locals >> cache =3D {ret =3D 1, Name =3D 0x2606560 "Vladimir.Sironja", DomainName = =3D >> 0x26065b0 "EDGE", peUse =3D SidTypeUser} >> been_here_count =3D 4 >> s_pfn_Lookup_Account_Sid =3D 0x7ff9e0d9bc20 >> hm_advapi32 =3D 0x0 >> ret =3D 0 >> (gdb) continue >> Continuing. >> [New Thread 20812.0x4f7c] >> [New Thread 20812.0x6d38] >> [New Thread 20812.0x4a54] >> >> here emacs comes up. >> >> So for some reason been_here_count =3D 4. > > This tells me: > > . the first 2 calls are from init_user_info, where we obtain and > record the user SID and the Group SID of your user > . the next 2 calls are from file-attributes, where Emacs for some > reason needed to obtain the owner and owner's group of the > directory "c:/Development/emacs-emacs-29.4/src" > > These are different calls for different purposes: they obtain both the > user and group SID (which are different SID values), and there's no > guarantee that the directory "c:/Development/emacs-emacs-29.4/src" is > necessarily owned by your user. > > So I don't see how caching could help here, and still produce the > correct results. > > You could avoid the second pair of calls (and many similar calls in > other cases where Emacs calls file-attributes) if you set the variable > w32-get-true-file-attributes to the nil value. Maybe this makes > startup faster in your case. Does that mean that we should close this as wontfix?