Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cygwin update cause "Error: could not fork child process: Resource temporarily unavailable."

I updated my cygwin using the setup-x86_64.exe tool (version 2.873) on Windows 7. I needed to install some additional packages (mostly zip/unzip etc).

Since then, I am getting the following errors when I try to run the Cygwin Terminal (the shortcut points to C:\cygwin64\bin\mintty.exe -i /Cygwin-Terminal.ico -):

Error: could not fork child process: Resource temporarily unavailable.  
DLL rebasing may be required. See 'rebaseall / rebase --help'.

Screenshot

I searched online how to run the rebaseall command they advise in the message. Essentially the recommendation was to start cygwin/bin/dash.exe and run:
bin/rebaseall I did that a few times, I also used the -v comment, and no errors come back. Still I can't start cygwin.

I also tried running cygwin-x/XWin-server nothing happens.

I looked at the setup logs in cygwin/var/log/setup.log I can't see any error.

I tried to run the setup program a few more times reinstalling some of the packages I already had, that didn't help neither. Any ideas how can I get that to work?

like image 974
Charbel Avatar asked Apr 04 '16 09:04

Charbel


3 Answers

Here is the fix.

  1. Go to you Windows Defender Security Center settings
  2. Click on App & Browser Control
  3. At the bottom click on the "Exploit Protection Settings" link
  4. Go to "Program Settings" and click on the "Add program to customize" -> "Choose exact file path"
  5. Navigate to "C:\Program Files\Git\usr\bin\sh.exe" and add it
  6. Override and turn off the following: Mandatory ASLR, Randomize memory allocations (Bottom-up ASLR)
  7. Click "Apply" and now everything should work fine.

Also add these other binaries from the same folder: expr.exe, uname.exe, grep.exe, rm.exe

Good luck,
Gabriel

like image 79
Gabriel Bercea Avatar answered Oct 22 '22 21:10

Gabriel Bercea


One of my colleagues has similar errors when openening the terminal from SourceTree (Mingw32), and also got errors when trying to pull, rebase, etc (anything not local). He solved it by uninstalling Sourcetree, using CCleaner to clean his registries (not sure if this was required), rebooted and installed Sourcetree again.

I know this is slightly different from the problem described by the OP, but it might still be solvable by un/re-installing and cleaning of registries, and this might also help future people finding this question with the Sourcetree issue (like I did).

Edit: Another colleague had the issue as well, and he managed to fix it merely with a restart without any un/re-installation or using CCleaner.

like image 39
Svend Hansen Avatar answered Oct 22 '22 22:10

Svend Hansen


I've been suffering similar problems a lot recently. I've been unable to determine the cause, whether it's due to a recent Windows7 patch or an update in the latest cygwin. I'm in a tightly controlled corporate environment with only limited elevated rights, a lot of anti-malware and encrypted drives. I'm using 32-bit Cygwin at present.

Issues for me began after I installed Git and Git-Svn packages, which required Perl and upgraded various other Cygwin packages as well.

Rebasing using rebase-trigger or rebaseall did not solve the issue for me. Neither did re-installing and setup repeatedly raised errors in the post-install pahse when trying to do the rebase itself.

My first success was by downgrading Perl to the previous version, ie. down to 5.22.1.2 from 5.22.2.1. After a couple of weeks the error returned, perhaps after a compulsory windows update and reboot.

My latest success has been achieved by ignoring the dash/rebaseall script and running rebase.exe directly as follows:-

  1. Create a file which lists all cygwin .dlls in the /bin directory except cygwin1.dll and cyglsa.dll ie. $ cd /bin $ ls -1 *.dll | egrep -v '(cygwin1|cyglsa).*\.dll' >rebasedlls.txt
  2. Close all cygwin terminals, if you have any services running which use cygwin ensure that those are stopped also. Check TaskManager and kill processes if necessary.
  3. Open a cmd.exe window (it may help to use whatever elevated rights you can muster), change to the windows path of your cygwin /bin directory (ie. the windows directory of cygpath -wa /bin).
  4. Use rebase.exe directly to find the base address of the cygwin1.dll file:

C:\apps\cygwin\bin> rebase.exe --info cygwin1.dll /usr/bin/cygwin1.dll base 0x61000000 size 0x00500000

  1. Using that base address and the size as a guide I chose the next whole value up as my rebase base address, 0x62000000. No particular reason for this, just a hunch. (The rebaseall script uses 0x70000000).
  2. Use rebase.exe to fix all the .dlls listed in the file from step (1):

C:\apps\cygwin\bin> rebase -b 0x62000000 -4 -n -v -t -T rebasedlls.txt

So far, so good, my Cygwin is back to a working state again.

like image 36
Ed Randall Avatar answered Oct 22 '22 22:10

Ed Randall