Cygwin随机抛出“权限被拒绝”错误,大部分或全部与fork调用有关

问题描述

一段时间以来,在带有find消息的我们的几个客户端服务器上,嵌入带有-exec参数的"Permission denied"循环命令的脚本开始失败。

要找出问题所在,我尝试了以下代码:

find "/cygdrive/path/to/dir" some-filter-args -exec echo {} ';' -exec file {} ';'

过一会儿,find继续时会出现以下错误消息(这可能会发生多次):

find : ‘echo’: Permission denied

这似乎是一个非常严重的错误,因为它与echo的执行有关。 ls -l检查显示/bin/echo.exe是拥有管理员特权的登录用户(并且Cygwin以管理员身份运行)。

我测试了另一行,将find的输出传递到while循环中:

find "/cygdrive/path/to/dir" some-filter-args | while read a ; do wc –l "$a" ; done

发生错误,并显示不同但相关的消息:

dofork: child -1 - CreateProcessW failed for 'Path\To\Cygwin\bin\bash.exe',errno 13
-bash: fork: Permission denied

该脚本本身基本上是执行grep的调用循环的find循环:

find "/cygdrive/path/to/dir" some-filter-args \
     -exec grep -L 'text' '{}' ';' |
while read line ; do
  # [...]
  # At least the command below should perform a fork() call
  echo "some_stuff" | (>&2 tee -a "/logs/output.log")
  # [...]
done

发生以下错误:

      1 [main] bash 645 dofork: child -1 - CreateProcessW failed for 'Path\To\Cygwin\bin\find.exe',errno 13
/cygdrive/path/to/a/script/w/pipe: fork: Permission denied
      1 [main] bash 23354 dofork: child -1 - CreateProcessW failed for 'Path\To\Cygwin\bin\find.exe',errno 13

/cygdrive/path/to/a/script/w/pipe: fork: Permission denied
find: ‘grep’ terminated by signal 13
      1 [main] find 644 dofork: child -1 - CreateProcessW failed for 'Path\To\Cygwin\bin\find.exe',errno 13
find: cannot fork: Permission denied  

我觉得某些东西会阻止进程执行派生调用而超出限制。这些服务器上已安装Symantec Endpoint Protection。

我可以在这些服务器上进行哪些检查以找出导致此问题的原因?

配置详细信息:

  • Cygwin -设置版本2.901(64位)
  • 扑扑 4.4.12-3
  • findutils 4.6.0-1
  • grep 3.0-2

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...