cygwin: how to fix fork failures

0

I know there is a lot of information out there already about this, but I haven't been able to find a solution. Maybe someone who knows more about how cygwin works can help.

I had cygwin working for several months without issue until Wednesday. Wednesday, while experimenting, I accidentally executed eval "exit 1". Cygwin immediately because printing fork errors, like this:

      0 [main] -bash 10632 fork: child 11748 - died waiting for dll loading, errno 11
-bash: fork: retry: Resource temporarily unavailable

I now get these fork errors every time I try to source my .bash_profile file, which I've linked here, including when I first start the terminal. The only file that gets sourced under that one that also causes the error is git-completion.bash, but removing that file doesn't prevent source .bash_profile from having errors.

I've rebooted my computer, updated cygwin, and run a full rebase, and I'm still getting that error. It seems likely that by running that command I accidentally killed something I shouldn't have, but I have no idea what it could be. Any ideas?

I'm not running any BLODA. I'm running 64 bit cygwin on Windows 7.

ewok

Posted 2017-11-24T15:17:30.863

Reputation: 2 743

The best place for support is the cygwin mailing list. Follow guideline https://cygwin.com/problems.html .We can not manage properly the issue here.

– matzeri – 2017-11-24T18:27:26.940

Answers

1

Fork failures on cygwin are never 100% possible to eliminate - see Cygwin FAQ - How do I fix fork failures?

Quoting the cygwin site:

How do I fix fork() failures?

Unfortunately, Windows does not use the fork/exec model of process creation found in UNIX-like OSes, so it is difficult for Cygwin to implement a reliable and correct fork(), which can lead to error messages such as:

  • unable to remap somedll to same address as parent
  • couldn't allocate heap
  • died waiting for dll loading
  • child -1 - died waiting for longjmp
  • before initialization
  • STATUS_ACCESS_VIOLATION
  • resource temporarily unavailable

Potential solutions for the above errors:

  • Restart whatever process is trying (and failing) to use fork(). Sometimes Windows sets up a process environment that is even more hostile to fork() than usual.
  • Ensure that you have eliminated (not just disabled) all software on the BLODA.
  • Switch from 32-bit Cygwin to 64-bit Cygwin, if your OS and CPU support that. With the bigger address space fork() is less likely to fail.
  • Try setting the environment variable CYGWIN to "detect_bloda", which enables some extra debugging, which may indicate what other software is causing the problem.

In my experience the longer your windows machine is up and running the more chance you have of a fork failure, I'm guessing memory fragmentation over time can make it harder for cygwin to do it's fork hacking.

I have noticed that adding more RAM can help too.

I've had reasonable success by scheduling reboots of cygwin machines.

That said, the most effective has been overall to use 64bit cygwin instead of 32bit and to be prepared to totally replace cygwin and to be generous about giving explicit antivirus exclusions to your cygwin install folders.

IanNorton

Posted 2017-11-24T15:17:30.863

Reputation: 111