-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: could not fork child process: Resource temporarily unavailable (-1) #6
Comments
Did you install from the release package (installer) or did you build yourself? |
I downloaded a release package. However, rebooting fixed the issue for me On Sep 30, 2016 1:56 AM, "mintty" notifications@github.com wrote:
|
According to common wisdom, any Windows system should be rebooted at least every 42 days, anyway:) |
I just got hit with this immediately after a reboot - I installed using the installer. |
Unfortunately, cygwin has always had occasional problems with forking, see https://cygwin.com/faq.html#faq.using.fixing-fork-failures |
I am getting it all the time when I launch cygwin from a Windows taskbar launcher with But I can double-click mintty.exe in the File Explorer or launch from cmd, and cygwin runs happily, or I can run it as administrator. Windows 10 is obviously doing some shenanigans with the taskbar. |
Is this Cygwin 64- or 32-bit? With taskbar launcher you mean an application icon docked to the taskbar? |
64-bit. Yes - an application icon pinned to the taskbar. |
Cannot reproduce, works here. Have you tried "rebasing"? Can you try with a fresh (parallel, minimal) Cygwin installation? |
Problem gone away now. Typical Windows. |
For those passing from Google - Encountered the same problem with a new (correct me if im wrong) feature in Windows 10:
Turning it off (as its by default) resolves the problem. |
Thanks for this information. We should share it on the cygwin mailining list. |
Sure. I'm using Cygwin x64 on Windows 10 build 1709. To disable this feature you'll have to:
It should be off by default, but i think Microsoft will switch that on by default in the future as more and more programs become compatible. |
Has this been brought up on the Cygwin mailing list yet? I don't see any reference to it but I wanted to make sure. This is actually pretty severe problem IMO. |
No, I had the intention to report it but you are welcome to do it yourself, please. |
Will do, thanks. |
I've just encountered this issue. However, |
There's also a "randomize memory allocations (Bottom-up ASLR) that I suspect might be a problem for Cygwin's fork, but I'm not sure. |
Here is the fix. Also add these other binaries from the same folder: expr.exe, uname.exe, grep.exe, rm.exe Good luck, |
I just hit this issue today trying to launch WSL Terminal on Windows 10 (build 17134.228), and then found it affected Git Bash and msys2 as well. However changing the ASLR settings for just mintty.exe or bash.exe wasn't enough. I found I also had to change them for wslbridge.exe, in the case of WSL Terminal, and other files in the case of Git Bash and msys2. If you have msys2 installed, you can user PowerShell (in Admin mode) to script the changes for all of the binaries as follows:
With Git for Windows, do the same but change the line for setting $files as follows:
Note that this may be disabling the ASLR settings for more binaries than strictly necessary; I'm not sure which aspects of the msys2/cygwin runtime are affected by ASLR. |
For Future Reference:That code can be even more Simplified/Shortened to something like this:
And for Git (for Windows), to something like this:
IMPORTANT NOTES (for consideration):
I'll include a "ScreenShot" of the "System Settings" Tab of the "Exploit Protection" Section of the "Windows Security Center" System App (Windows 10 x64 - Version 1803 - Build Cheers. EDITHere's some
Just make sure the " MSys64 - Default Path .ps1.txt Bye then. |
While not a bad attempt... With the Latest Versions of both Windows (Upgrades + Updates) and Git (for Windows) (which obviously includes an Updated MSys2/MinTTY), if the System-Wide Setting of
(apparently this "Bug" has something to do with with direct references/accesses to Example of a VERY SIMPLE ASLR with a Google Search Link:(Note: in a good ASLR implementation EVERYTHING moves around, not just the `Code´...) Cheers!. |
In the latter case, mintty is not even involved (starting bash directly from a shortcut)! Even if it were, it would not be a mintty issue if it happens inside the shell. |
@mintty <https://github.com/mintty>
Did my Last *Comment* (That GIANT *Wall-of-Text*) Help?...
(I'm just curious/asking because I didn't see any reaction from You...
Sorry about that...)
I was quite tired and even sent it before I was finished because I (while
half asleep) pressed *ENTER* before releasing the *SHIFT* Key...
I then finished it and did many QC/QA related *EDIT*s/Corrections, some
of questionable decision making processes (I was too sleepy), like stating
the Hours when I started writing the Posts and when I finished it...
Things like that...
You should probably Notice that it is not the same as the
e-mail/Notification You received before if You Read it *Directly* on The
GitHub Issue's page...
I should also Note that the *2 Lines* (now Corrected and Working) from my
Inicial Comment is everything I need for personal use. (since "*I know what
I'm doing*"...)
I only wrote that more Complex and *Advanced Script* for "educational
purposes" and so anyone could simply just "Double Click" a file, confirm
the Admin Elevation Prompt (UAC) and simply be done with it and get
everything to work...
Maybe those 2 Lines could be added to Run during the last steps of the
installation after a quick test and user informative prompt?...
In my case, I was using "*Process Explorer*" while doing a new "*Git for
Windows*" Upgrade and noticed that in the end, it runs some final set-up
scripts in a tree of Linux-Original-processes (bash/ln/rm/MinTTY/ls/...)
that keep Crashing and only after, when I actually tried to test/use it,
did I find/come across this *Issue* (#6) (and did this "*fix*"/workaround)
...
Anyways...
What @user29387 said, while not being related with MinTTY, is probably
the same problem - those */usr/bin* "*.exe*"s/binaries and Windows Exploit
protection settings...
This *issue* (#6) on GitHub just happens to be VERY *near the Top* (if
not the very 1st entry - might vary with country) of *Google Search* for
this "*Error Message*" (which is also in the Subject/Name of the issue
itself) ...
(He probably even has the MinTTY binary somewhere in the same folder...)
(Probably a Good Way to test my Script?... - Though it needs that
Manual Variable Edit...)
*P.S.:* I'm writing *this* from an e-mail to test This GitHub's *reply-to*
Functionality and see How it goes...
(I may need to go to GitHub itself to make corrections to this if it
doesn't come out as expected though... I'll see, I guess...)
Bye then.
…On Mon, Sep 10, 2018, 23:19 mintty ***@***.***> wrote:
In the latter case, mintty is not even involved (starting bash directly
from a shortcut)! Even if it were, it would not be a mintty issue if it
happens inside the shell.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#6 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AMf68mO5P8ybzQcy7nYG3rvZ1ZxVx94Sks5uZuVhgaJpZM4KKkOP>
.
|
I appreciate your script and additional explanations, for anyone interested in the background. I do not have the capacity to study it fully myself right now. If you'd like to contribute further, the following would be great:
|
Since I posted a couple of days ago, I though I would do a followup, even though the issue doesn't seem connected with mintty. I generated a couple of null C programs, with this code in each: int main() {return 0;} These are 'np1' and 'np2'. I put the first in a script: #!/bin/bash and then run the script and the second program using a pipe: script | np2 This sometimes works, but typically freezes, with a dramatic change with Windows 10 version 1803. The script and pipe seem to be required. The programs do no I/O, and thus the pipe is not actually used. I tried a lot of things, including peflags/rebase, without any success. One thing that does seem to work is to run the top-level shell as an Administrator. I don't know why this works, but it should be a big hint to someone out there who is more astute than I in the workings of Cygwin and Msys. The other approach that seems to work is to change the first line of the script to this: ##!/bin/bash The extra '#' has the effect of making the first line into a comment, and thus the shell invokes a standard tool like /bin/bash or /bin/sh to interpret the script commands. This is conceptually similar to the '#!' notation, but presumably is processed in a somewhat different way. |
For anybody who arrives here after trying to install git for windows under Win10 amd64: I'm running all exploit protections plus full software restriction policies. There seems to be some bug in mingw64, and I had to explicitly add the path "C:\Program Files\Git*" to the SRP and set it to unrestricted. Perhaps the installer is using some nonstandard way of specifying file paths. So, to install git without having to turn of exploit protections and reboot, first, do the install and it will fail after copying all (most?) of the files. Then run the above powershell scripts to disable aslr for the git binaries. Now install git again into the same folder, and it will say that it wasn't able to uninstall the previous installation. Continue, and after the install gets going installing files, you change "C:\Program Files\Git*" to "Unrestricted". That way, at the end of the installation process, git.exe will be able to do things like changing the default editor. |
Avast fix: |
For me, this was ADB shell daemon running after one command in terminal. |
What about fixing the application so it works with the exploit mitigations? |
The cygwin people talked about it in this thread : https://sourceware.org/pipermail/cygwin/2020-August/245973.html Looking at these it seems like it is a very tough job to do, but we might get it one day. |
You can just turn of ASLR for all the .exe in GitHub bin, run this script in powershell as admin. You must restart your PC after you have ran. Also replace
|
Thanks for the suggestion. My first impression was it would help, even without rebooting, but then I had a lot of trouble fiddling with these options, so I'd better not touch them again... |
There is a recent discussion about it here https://cygwin.com/pipermail/cygwin/2021-February/247922.html. The solution is to disable ASLR option in binutils ld. The issue is only with fork() in cygwin based binaries. mingw toolchain is OK. |
I got this error when I lost power to my pc, this fixed it for some reason, thanks! So random |
Error: Could not fork child process: Resource temporarily unavailable (-1). |
Try to reinstall wsltty and/or exclude wsltty install directory in antivirus scanning operation. |
thankxx a ton |
I don't know where else to put this. I'm a noob so I hope this even makes sense, and maybe helps someone. I tried all of the tips I could find about disabling ASLR. I tried globally, and then I tried for selected git exe's, and then I tried for all of the git exe's. Still got the git bash startup error. Tried reinstalling Git. No luck. Finally I tried running the installer as admin. This is what worked. It installed git under my admin profile, but it now works for my regular profile too. |
You're posting this in the wsltty repository but you mention Git. Please describe your environment (Git for Windows?). |
Bro I love youuu you're such a life saver!.I was getting crazy by this error ,it took me 2 days and still couldnt fix it.ThanQ man. |
Hello! I'm getting the following when I attempt to start the process:
Obviously there is no rebase binary packaged with this like Cygwin would typically have. Is there another way to rebase this?
The text was updated successfully, but these errors were encountered: