当我从 cygwin (3.2.0-340.x86_64) tcsh (echo, cd) 运行内置命令时,它会立即运行。但是当我尝试从 cygwin tcsh(/bin/echo、ls 等)运行一个非内置命令时,它在运行前会暂停 3-4 秒。
运行 /bin/echo 时 strace 输出的开头如下。延迟可能是由于 Bitdefender,但我无法卸载它(或添加例外),因为这台工作机器需要它。我想知道是否有解决办法。延迟发生在第一个 open_shared 调用中,但我找不到有关该调用的任何信息。我认为问题与访问各种用户信息有关,但是 /etc/nsswitch.conf 的各种设置(无文件,passwd 和组设置为“文件”,密码和组设置为“文件 db”)没有任何影响.另外,停止或启动 cygserver 也没有任何影响。
open_shared 做了什么,有没有办法避免调用它(或至少避免延迟)?
--- Process 888 created
--- Process 888 loaded C:\Windows\System32\ntdll.dll at 0000000077330000
--- Process 888 loaded C:\Windows\System32\kernel32.dll at 0000000077110000
--- Process 888 loaded C:\Windows\System32\KernelBase.dll at 000007fefd180000
--- Process 888 loaded C:\Program Files\Bitdefender\Endpoint Security\atcuf\dlls_265343666501645444\atcuf64.dll at 000007fee7520000
--- Process 888 loaded C:\cygwin64\bin\cygwin1.dll at 0000000180040000
--- Process 888 loaded C:\cygwin64\bin\cygintl-8.dll at 00000003e2480000
--- Process 888 loaded C:\cygwin64\bin\cygiconv-2.dll at 00000003eb590000
0 0 [main] echo (888) **********************************************
160 160 [main] echo (888) Program name: C:\cygwin64\bin\echo.exe (windows pid 888)
138 298 [main] echo (888) OS version: Windows NT-6.1
72 370 [main] echo (888) **********************************************
--- Process 888 loaded C:\Windows\System32\advapi32.dll at 000007fefef70000
--- Process 888 loaded C:\Windows\System32\msvcrt.dll at 000007fefeda0000
--- Process 888 loaded C:\Windows\System32\sechost.dll at 000007fefebf0000
--- Process 888 loaded C:\Windows\System32\rpcrt4.dll at 000007fefd240000
--- Process 888 loaded C:\Windows\System32\cryptbase.dll at 000007fefcd20000
4695 5065 [main] echo (888) sigprocmask: 0 = sigprocmask (0, 0x0, 0x180333190)
4125658 4130723 [main] echo (888) open_shared: name shared.5, n 5, shared 0x180030000 (wanted 0x180030000), h 0x94, *m 6
214 4130937 [main] echo (888) user_heap_info::init: heap base 0x800000000, heap top 0x800000000, heap size 0x20000000 (536870912)
162 4131099 [main] echo (888) open_shared: name S-1-5-21-168175717-1872246286-1819828000-60825.1, n 1, shared 0x180020000 (wanted 0x180020000), h 0x90, *m 6
126 4131225 [main] echo (888) user_info::create: opening user shared for 'S-1-5-21-168175717-1872246286-1819828000-60825' at 0x180020000
157 4131382 [main] echo (888) user_info::create: user shared version AB1FCCE8
140 4131522 [main] echo (888) fhandler_pipe::create: name \\.\pipe\cygwin-e022582115c10879-888-sigwait, size 11440, mode PIPE_TYPE_MESSAGE
148 4131670 [main] echo (888) fhandler_pipe::create: pipe read handle 0xA8
89 4131759 [main] echo (888) fhandler_pipe::create: CreateFile: name \\.\pipe\cygwin-e022582115c10879-888-sigwait
157 4131916 [main] echo (888) fhandler_pipe::create: pipe write handle 0xAC
134 4132050 [main] echo (888) dll_crt0_0: finished dll_crt0_0 initialization