Cygwin错误:"-bash:fork:retry:资源暂时不可用"

Dav*_*d C 65 cygwin

我最近在我的计算机上重新安装了Cygwin,以便访问我缺少的几个命令行元素.我以前从未遇到过Cygwin的困难,但在重新安装之后,在(几乎)每个命令输入之后会继续出现错误消息.例如:

-bash-4.1$ wc m1.txt
      3 [main] bash 2216 child_info_fork::abort: data segment start: parent(0x26D000) !=     child(0x38D000)
-bash: fork: retry: Resource temporarily unavailable
2013930  4027950 74968256 m1.txt
Run Code Online (Sandbox Code Playgroud)

通常,命令仍然运行(如上所示),但并非总是如此.偶尔,"错误"消息连续出现几次(初始数字"3"将变为"4"或"2",特别是如果我启动第二个Cygwin窗口.

另外,一旦我启动Cygwin,我会在提示之前收到以下消息:

      3 [main] bash 6140 child_info_fork::abort: data segment start: parent(0x26D000)     != child(0x36D000)
-bash: fork: retry: Resource temporarily unavailable
-bash: fork: Resource temporarily unavailable
-bash-4.1$
Run Code Online (Sandbox Code Playgroud)

目前,我正在讨论是否要再次卸载/重新安装Cygwin,或者只是接收错误消息,但我很好奇是否可能存在我不知道的问题.

Cod*_*y S 118

(假设Cygwin安装在C:\ Cygwin):

  1. 打开任务管理器并关闭任何看起来与Cygwin相关的进程.
  2. 在Windows资源管理器中打开C:\ Cygwin\bin
  3. 验证此文件夹中是否存在dash.exe,ash.exe,rebase.exe和rebaseall
    • 如果缺少任何一个,请重新运行Cygwin设置并选择dash,ash和rebase包
  4. 右键单击C:\ Cygwin文件夹,取消选中只读(如果已选中),然后按确定.
    • 当出现无法切换某些文件的错误时,请选择"全部忽略".等待此过程完成.
  5. 在Windows资源管理器中浏览到C:\ Cygwin\bin
  6. 右键单击dash.exe,然后单击"以管理员身份运行".命令提示符应该只显示一个$
  7. 键入/usr/bin/rebaseall -v,按Enter键,然后等待该过程完成.
    • 如果您收到有关Cygwin进程运行的错误,请再次尝试步骤1.如果仍然无效,请将计算机重新启动到安全模式并再次尝试这些步骤.
    • 评论者注意到,根据您的设置,您可能需要输入cd /usr/bin && ./rebaseall -v.
  8. 尝试再次打开Cygwin.

这个过程对我有用.我希望它也适合你们.

资料来源:http://cygwin.wikia.com/wiki/Rebaseall

  • 真棒.在步骤7中,由于PATH,我必须首先进入目录:cd/usr/bin`和`./rebaseall -v`. (4认同)

Mic*_*eal 13

I would like to add the following to the above answers, as it is what I had to do after reinstalling Cygwin:

Navigate to the "/usr/bin" directory (usually, C:\cygwin\bin) and right click, Run as Administrator the file: dash.exe Then, at the $ prompt type the following, hitting enter after each line:

cd /usr/bin/
/usr/bin/peflags * -d 1
/usr/bin/rebaseall -v
Run Code Online (Sandbox Code Playgroud)

What it does is, it marks the dll's as "rebase-able," and then rebases them. You have to have peflags.exe in addition to the above files (in previous answers). You may have to restart windows after doing this and you will definitely need to make sure that there are no processes nor services belonging to cygwin running. (Use task manager, kill any related processes, and then under the services tab look for any service starting with CYG and stop it.)

执行此操作后,我能够运行cygwin而没有任何关于dll被加载到错误地址的错误,即fork错误等.

我希望这有助于其他人,因为这很难找到.

SOURCE: http://www.cygwin.com/faq.html#faq.using.fixing-fork-failures 
and the rebase README file.
Run Code Online (Sandbox Code Playgroud)


小智 5

为了在这里添加其他答案,我们遇到了同样的问题,但无法从ash或dash shell运行rebase命令.但是,从Windows cmd shell启动命令时,以下工作正常.

cmd /c "C:\cygwin64\bin\ash.exe /usr/rebaseall -v"
Run Code Online (Sandbox Code Playgroud)

-v是获得详细输出