-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Failed to fork child process: No such file or directory #580
Comments
No, |
Yes, it is there. Opening it causes the same error. |
@intared, any chance of trying to run it with |
There's nearly 800 entries for it. Mostly with a result of "Success", some "Name not found", "Reparse" and "File Locked with only readers". I think the culprit is three lines, each very similar, with an operation of CreateFile on the paths.
They return "PATH NOT FOUND". The paths seem malformed in RelaunchCommand (I altered the paths before that). Outside of that there is are the following lines.
|
Same issue here, only way to run bash is "Run as administrator" |
OK, to confirm, if I set git-bash.exe to run as administrator, it does work. Of course, I get the UAC prompt. This wasn't an issue in the previous version I used (which I'm now kicking myself for not recording the version number of...). |
Well, now I cannot know what the culprit is. It has possibly something to do with this line. |
Okay, I could not reproduce the exact issue, but I could verify via ProcMon that |
The only altering I did here was to swap my username and drive letter to be generic. Please let me know if you need any further information to help with this. |
I do not think this is true. It's true they didn't make it unchanged, for reasons I explained and we discussed in length. The suggested feature is fully included in the current release, just using other option names. If you claim there is any harm in the implemented feature, please demonstrate it. If you simply think they should have been accepted in the exact form you wanted, I can't help it. And if that even makes you feel "bummer", you should take some relaxing Christmas holidays, please. For the actual issue, see mintty/mintty#493. It's a Windows bug for which cygwin has a workaround (not yet released). For Git you'll likely have to achieve a similar workaround in MSys. |
Which ones? I feel that the evolution from my original patch to whatever patch you actually applied to implement the feature is woefully underdocumented, as is the exact difference how to use the feature. That is what is highly frustrating. I had plenty of time to work on this for over a month, and nothing happened back then. That is even further frustrating, and you can either acknowledge that or ignore it. |
That is not the bug that is discussed here. It is a different issue that should have been addressed by our upgrade to the new MSys2 runtime, as far as Git for Windows is concerned anyways. |
About your request for the current status, see mintty/mintty#471 (comment) (of 3. Nov!):
And the feature is fully documented in the manual page, including a full example.
This is an unfair statement, and it's nonsense, see mintty/mintty#471 (comment):
|
@intared actually, I can confim that this is not the culprit, as these lines appear even if everything works alright with starting Git Bash. Any chance you can make the full log available? |
@dscho here you go. Produced running git-bash.exe (not as administrator) in 2.7.0. |
I fail to find anything of interest in the short amount of time I can afford to spend on this ticket today. However, you may want to download https://dl.bintray.com/git-for-windows/pacman/x86_64/:msys2-runtime-2.3.1.33884.84870b7-1-x86_64.pkg.tar.xz and extract |
So I got the very same problem, also with The tell-tale is that running
Seeing as this is caused by tampering with the |
Same error here. But I think I found something useful to this discussion:
All computers in my network that upgraded to 2.7.0 show the behavior above. I'm recommending my devs to stay with their current versions. |
Which was the last working version? |
@intared @edsondias @vcx are you running this on domain-joined machines, maybe? And: could y'all maybe spend some serious time trying to figure out using ProcMon what file was not found? |
@dscho No domain joined machine. However, all of mine are Azure AD joined (if you're concerned with GPOs, AAD doesn't have them, and it's policies are less intrusive, such as password and device encryption only). I've already dig into procmon. Nothing special there, except: git-bash.exe (the original exe that the start menu points) triggers a ProcessCreate with the following path: usr\bin\mintty.exe -o AppID=GitForWindows.Bash -o RelaunchCommand="C:\Program Files\Git\git-bash.exe" -o RelaunchDisplayName="Git Bash" -i /mingw64/share/git/git-for-windows.ico /usr/bin/bash --login -i typing this exact command in CMD/Run/TaskManager fails 100% of time. Removing parameters one by one shows that even usr\bin\mintty.exe alone can trigger the same error, same message. I've also compared procmon logs both trying to run the command as admin and as my regular user. Surprisingly, I found no big differences in file operations. And there's no significant file missing. One of them took my attention: an Access Denied while trying to set attributes in git-for-windows.ico. However, giving write permissions to the file, folder, upper folder and upper upper folder was enough to get rid of the Access Denied, but didn't change the initial problem of mintty. In registry operations, the log on "as admin" scenario has twice more reads when trying to load COM dlls (mostly because when running as admin it tries to read also keys on HKCU\Software\Classes instead of only HKCR\classes). I'm not sure if this behavior is expected... but probably it isn't related to the problem we're talking about here. Process-level operations are almost equal, of course, until it breaks. Logger.exe fails to attach in mintty. My next try will be on windbg looking for first chance exceptions. |
I also did the same strace command. I don't know how to interpret it (I'm good with Windows internals, but not Linux/Unix) but I assume the same troubleshooting rules applies. Reading backwards, I think I found some suspects in the following lines. It's something related to path translation.
|
👍 here too Fresh Windows 10 machine, Enterprise, on the MS Azure domain. |
For what it's worth, I am on a fresh windows 8, and git bash was working fine, until I closed all running instances, and restarted. I had recently been installing things and updating the PATH with various instances of git bash open, including installing both python 3 and 2 (and having one of them on my user PATH, and the other on system PATH). In between restarting all instances, I also tried removing the python version I didn't want (for the code I need to build), so I wound up just clearing my user PATH, as it had nothing of use that wasn't already in global PATH. Hope these tidbits help! |
I suggest git bash should update to mintty 2.2.4. It contains improvements both in startup and startup error reporting. |
I will upgrade once I can afford the time to re-test and re-patch our version of mintty. |
The latest version is 2.3.3 now. For taskbar integration, there should be no patches necessary anymore. |
If Git bash updates, let me know and I'll be happy to test it. |
I had this problem on git bash v2.6.2, Windows 10. I restarted the computer and everything was back to normal. ... I had a flashback to Windows 95 |
I just updated to latest Git for Windows which ships with mintty 2.4.2. The error message is no longer |
This error information pins the issue more precisely to the forkpty() system call of cygwin/msys. |
Well then it doesn't seem to be a git-for-windows issue. Where should this be reported? https://github.com/Alexpux/MSYS2-packages/issues? |
Given that the most likely location where that The more likely culprit is that the current account is not known to Cygwin and it mixes up the permissions when trying to access the (emulated) |
|
@SnehaRane1987 can you verify that your |
@mbp would you please download https://github.com/git-for-windows/msys2-runtime/releases/download/snapshot-2016-07-09/msys-2.0.dll and drop it into \usr\bin (overwriting the existing |
@dscho it works! |
Works for me too! Thank you! |
That DLL solves also the issue with Azure AD |
The new DLL works for me. Thank you. |
Thank you all for testing! I just built fixed 32-bit and 64-bit Meaning: the next Git for Windows release will have the fix. |
Git Bash [now opens properly even for Azure AD accounts](git-for-windows/git#580). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
For everybody who cannot wait for the next official release, here Is a prerelease with the fix: https://github.com/git-for-windows/git/releases/tag/prerelease-v2.10.0.windows.1.11.geda474c |
Oh, and: If y'all could test the prerelease and report whether it fixes the issue, that would be grand! |
@dscho I can confirm that the prerelease also works :-) |
@dscho the prerelease works! |
Hi all, My git commands are failing with this error as well:
Strange thing is, I can run basic git commands like 'status', 'pull' , 'push', 'checkout' But when I run Is there anything else I can provide to help debug this? Thank you kindly! |
Are there any open issues for this bug? I run into this intermittently. I almost posted here a week ago when I ran into this, but then the issue mysteriously resolved itself about 30-45 minutes later. Well today I ran into this again, but this time I discovered something interesting. So I was getting the error "Failed to fork child process: No such file or directory", and I thought I would just keep working until it resolved itself. Well then I ran into another seemingly unrelated issue. I was trying to delete a directory containing a git repo I had previously been working on, but some process had a lock on a random file in the .git folder. I used ProcessExplorer to search for the offending process, and it was "sh.exe" from git bash. But here's the really interesting thing. I didn't have any git bash windows open at the time, and the process showed up as "suspended". Like it was just permanently not actually running on the cpu. As soon as I killed the suspended "sh.exe" process I was able to open a new git bash window without getting the error (and I could delete those files). |
Are there any open issues for this bug? I run into this intermittently. I almost posted here a week ago when I ran into this, but then the issue mysteriously resolved itself about 30-45 minutes later.
Opening a fresh isssue, with a back reference here, but with all the important background info (versions..) the template asks for would help if the issue is sufficiently distinct.
Well today I ran into this again, but this time I discovered something interesting. So I was getting the error "Failed to fork child process: No such file or directory", and I thought I would just keep working until it resolved itself.
What were the activities that you'd been performing on that repo, both using `git` commands and windows actions (inc. editors and other long run processes that may have file handles open - which are implicit locks..)
Well then I ran into another seemingly unrelated issue. I was trying to delete a directory containing a git repo I had previously been working on, but some process had a lock on a random file in the .git folder.
How 'random'? Did you catch it's name? or an indication of it's name (e.g. `.pack`, `.idx`, ALLCAPS name) etc.?
I used ProcessExplorer to search for the offending process, and it was "sh.exe" from git bash. But here's the really interesting thing. I didn't have any git bash windows open at the time, and the process showed up as "suspended". Like it was just permanently not actually running on the cpu. As soon as I killed the suspended "sh.exe" process I was able to open a new git bash window without getting the error (and I could delete those files).
Any more information you can garner next time on such a sh.exe would be an advantage. Git often spawns excess shells which do linuxy tasks with poor abstractions for windows... They just need hunting down!
|
That's an interesting tidbit. I wonder how many other MSYS2 runtime issues have that very same root cause... |
…it-for-windows#580) Always use the internal "use_weak" random seed when initializing the "mimalloc" heap when statically linked on Windows. The imported "mimalloc" routines support several random sources to seed the heap data structures, including BCrypt.dll and RtlGenRandom. Crashes have been reported when using BCrypt.dll if it initialized during an `atexit()` handler function. Granted, such DLL initialization should not happen in an atexit handler, but yet the crashes remain. It should be noted that on Windows when statically linked, the mimalloc startup code (called by the GCC CRT to initialize static data prior to calling `main()`) always uses the internal "weak" random seed. "mimalloc" does not try to load an alternate random source until after the OS initialization has completed. Heap data is stored in `__declspec(thread)` TLS data and in theory each Git thread will have its own heap data. However, testing shows that the "mimalloc" library doesn't actually call `os_random_buf()` (to load a new random source) when creating these new per-thread heap structures. However, if an atexit handler is forced to run on a non-main thread, the "mimalloc" library *WILL* try to create a new heap and seed it with `os_random_buf()`. (The reason for this is still a mystery to this author.) The `os_random_buf()` call can cause the (previously uninitialized BCrypt.dll library) to be dynamically loaded and a call made into it. Crashes have been reported in v2.40.1.vfs.0.0 while in this call. As a workaround, the fix here forces the use of the internal "use_weak" random code for the subsequent `os_random_buf()` calls. Since we have been using that random generator for the majority of the program, it seems safe to use it for the final few mallocs in the atexit handler (of which there really shouldn't be that many. This fix should go into upstream git-for-windows eventually. I'm flighting it here in a special v240.1.vfs.0.1 so that we can confirm that it addresses the crash seen by GVFS/Scalar users with v2.40.1.vfs.0.0.
Hi,
This is related to #440.
I have the same issue and the following notes
If you need any other information please let me know.
The text was updated successfully, but these errors were encountered: