我意识到还有一些其他问题,为什么Cygwin显然很慢,但这种情况似乎是独一无二的.
我遇到了一些问题,其中事情报告了很多错误,然后重启后,从bash启动的任何进程都非常慢.老实说,我不知道是什么导致这种情况(我检查了taskmgr中的进程优先级;它仍然正常).
细节:
我在一夜之间运行了一些套接字代码的浸泡测试,并在早上回来发现我的屏幕充满了错误(DialogBoxes - 主要是尝试访问NULL指针)以及发送到命令行的很多东西.我无法捕获相当多的文本(计算机大多没有响应;我不得不手动重启).我确实记得一些引用"Win32错误6"的文本(我假设它意味着无效处理).
重新启动后,大多数事情都很好,但Cygwin/bash仍然没有反应.我按照另一个问题的建议运行了以下内容:
$ time for i in {1..10} ; do bash -c "echo Hello" ; done
...
real 1m12.244s
user 0m3.522s
sys 0m34.460s
Run Code Online (Sandbox Code Playgroud)
对于可怕的速度,不需要调用另一个bash实例:
$ time for i in {1..10}; do ls ; done
# nb there are about 6 entries in pwd
....
real 0m47.718s
user 0m2.568s
sys 0m23.411s
Run Code Online (Sandbox Code Playgroud)
虽然内置确实足够快:
$ time for i in {1..10} ; do echo Hello ; done
....
real 0m0.001s
user 0m0.000s
sys 0m0.000s
Run Code Online (Sandbox Code Playgroud)
更新: 我刚刚实现了在当时和现在之间安装的Windows Update.我很高兴这不是太复杂或任何事情.(虽然,我相信其他同事已经安装了更新,并没有看到问题).
更新2:
要回答下面的评论,/ bin中的文件执行时没有任何CMD问题.此外,我完全删除并重新下载了我的cygwin安装目录,问题仍然存在.
我[仍]不完全确定如何使用Cygwin的strace,但我认为第一列可能是时间增量.考虑到这一点,这里有几行看起来有问题(0xDEADBEEF当然不鼓励):
4100175 4101564 [main] bash 5664 _cygtls::remove: wait 0xFFFFFFFF
4278898 4279724 [main] bash 5612 child_copy: dll bss - hp 0x628 low 0x611DC000, high 0x612108D0, res 1
2210923 25635973 [proc_waiter] bash 5664 pinfo::maybe_set_exit_code_from_windows: pid 5400, exit value - old 0x8000000, windows 0xDEADBEEF, cygwin 0x8000000
3595425 16085618 [proc_waiter] bash 5612 pinfo::maybe_set_exit_code_from_windows: pid 5376, exit value - old 0x8000000, windows 0xDEADBEEF, cygwin 0x8000000
3057452 19149209 [proc_waiter] bash 5664 pinfo::maybe_set_exit_code_from_windows: pid 5612, exit value - old 0x8000000, windows 0xDEADBEEF, cygwin 0x8000000
2631997 38835042 [proc_waiter] bash 5716 pinfo::maybe_set_exit_code_from_windows: pid 5720, exit value - old 0x8000000, windows 0xDEADBEEF, cygwin 0x8000000
2610852 38836658 [main] bash 4624 _cygtls::remove: wait 0xFFFFFFFF
3708283 42556365 [proc_waiter] bash 5716 pinfo::maybe_set_exit_code_from_windows: pid 4624, exit value - old 0x8000000, windows 0xDEADBEEF, cygwin 0x8000000
3666884 42562053 [main] bash 5664 fhandler_base_overlapped::wait_overlapped: GetOverLappedResult failed, bytes 0
2742397 45305871 [proc_waiter] bash 5664 pinfo::maybe_set_exit_code_from_windows: pid 5716, exit value - old 0x8000000, windows 0xDEADBEEF, cygwin 0x8000000
45322195 45322997 [main] bash 3996 child_copy: dll bss - hp 0x62C low 0x611DC000, high 0x612108D0, res 1
4247577 49581019 [main] bash 3996 _cygtls::remove: wait 0xFFFFFFFF
4266690 49581325 [main] bash 5664 child_info::sync: pid 3996, WFMO returned 0, res 1
49622099 49623318 [main] bash 4840 child_copy: dll bss - hp 0x690 low 0x611DC000, high 0x612108D0, res 1
4225718 53860809 [main] bash 4840 _cygtls::remove: wait 0xFFFFFFFF
4248491 53861119 [main] bash 3996 child_info::sync: pid 4840, WFMO returned 0, res 1
2167422 2169463 [main] bash 1412 _cygtls::remove: wait 0xFFFFFFFF
10369 2205831 [main] bash 1412 pwdgrp::load: \etc\passwd curr_lines 4082
10313 2237148 [main] bash 1412 cygwin_gethostname: name A119894
14720 2251868 [main] bash 1412 stat64: entering
Run Code Online (Sandbox Code Playgroud)
所以我从来没有真正解决过这个问题。换了一台新电脑。
最终也出现了类似的问题,问题出在 NVIDIA 驱动程序软件上,而不是实际的驱动程序本身。
所以,路径是: