Skip to content

Windows 10 pro x64, Git 2.20.1 Windows x64, Unable to edit C:\Program Files\Git\git-bash.exe (out of memory). #2003

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

Closed
donhuvy opened this issue Dec 31, 2018 · 21 comments

Comments

@donhuvy
Copy link

donhuvy commented Dec 31, 2018

Windows 10 pro x64.

Git for Windows version 2.20.1 x64.

I try to reinstall, restart many time, Run as administrator, but not success.

git

also version 2.20.1 for Windows 32 bit, 64 bit cause same error (like screenshot).

@donhuvy
Copy link
Author

donhuvy commented Dec 31, 2018

C:\Users\donhuvy>git --version --build-options
git version 2.20.0.windows.1
cpu: x86_64
built from commit: 95155834166f64fe9666f2c0a4909f076080893a
sizeof-long: 4
sizeof-size_t: 8

C:\Users\donhuvy>

@donhuvy
Copy link
Author

donhuvy commented Dec 31, 2018

C:\Users\donhuvy>cmd.exe /c ver

Microsoft Windows [Version 10.0.16299.847]

C:\Users\donhuvy>

@donhuvy
Copy link
Author

donhuvy commented Dec 31, 2018

Install by file Git-2.20.0-64-bit.exe

@dscho
Copy link
Member

dscho commented Dec 31, 2018

That sounds as if you tried to use Windows' default console window for Git Bash (note: the issue reporting template really is not meant to annoy bug reporters, but rather intended to help you not forget vital information).

Can you edit git-bash.exe via ResEdit? Its first string table has two entries, and you would want to remove the first one.

@donhuvy
Copy link
Author

donhuvy commented Jan 1, 2019

  • I used previous version of Git for Windows, and the problem did not exist.

  • You said true, I tried to use Windows' default console (cmd).

  • A warning popup display, it is wrong. It is exactly a bug.

@dscho
Copy link
Member

dscho commented Jan 2, 2019

@donhuvy please do try to work with me, if you do not try ResEdit I get the impression that you might not be interested in resolving this bug at all.

@donhuvy
Copy link
Author

donhuvy commented Jan 3, 2019

ok, I will reply soon. I am using macOS, I will report about it when use Windows OS.

@donhuvy
Copy link
Author

donhuvy commented Jan 5, 2019

This is my result

First line

APP_ID=GitForWindows.Bash ALLOC_CONSOLE=1 usr\\bin\\mintty.exe --nodaemon -o AppID=GitForWindows.Bash -o AppLaunchCmd=\"@@EXEPATH@@\\git-bash.exe\" -o AppName=\"Git Bash\" -i \"@@EXEPATH@@\\git-bash.exe\" --store-taskbar-properties -- /usr/bin/bash --login -i

a1

a2

git --version
git version 2.20.0.windows.1

(latest version 2.20.1 for Windows is the same)

@dscho
Copy link
Member

dscho commented Jan 9, 2019 via email

@donhuvy
Copy link
Author

donhuvy commented Jan 10, 2019

The content of it is

APP_ID=GitForWindows.Bash ALLOC_CONSOLE=1 usr\bin\mintty.exe --nodaemon -o AppID=GitForWindows.Bash -o AppLaunchCmd="@@EXEPATH@@\git-bash.exe" -o AppName="Git Bash" -i "@@EXEPATH@@\git-bash.exe" --store-taskbar-properties -- /usr/bin/bash --login -i

@alegrigoriev
Copy link

What antivirus do you have?

@donhuvy
Copy link
Author

donhuvy commented Jan 14, 2019

Yes, I use McAfee Antivirus

mcafee

@donhuvy
Copy link
Author

donhuvy commented Jan 19, 2019

After I use ResEdit on file git-bash.exe, I have what I expected. For resolving this issue, please consider the affect of other factor (such as Anti-virus software). I you still feel unclear, please require more information.

@dscho
Copy link
Member

dscho commented Feb 21, 2019

I think there is a bug where the actual condition of the error is not handed through correctly, and the installer will always claim that it is out of memory, even if it is a matter of access being denied.

I just kicked off a snapshot build that should address the incorrect error message, and would like to ask you, @donhuvy, to test this installer; It should be available here once the build is done.

@alegrigoriev
Copy link

To work around an antivirus, perhaps the installer needs to patch the file while in a temporary directory, and then copy the patched file to ProgramFiles/Git

@donhuvy
Copy link
Author

donhuvy commented Feb 22, 2019

My PC

pc

I download Git for Windows 64bit - (commit 1dfd189). Turn on Real-time protection of Mc-Afee antivirus.

image

git1

Error happen
git2

Git prerelease-2.21.0.rc2.windows.1.335.g1dfd1896e4 Setup

Unable to close C:\Program Files\Git\git-bash.exe after editing.

As you see error notice dialog, after I press button OK, Git Bash still work as I want.

git3

@dscho
Copy link
Member

dscho commented Feb 22, 2019

To work around an antivirus, perhaps the installer needs to patch the file while in a temporary directory, and then copy the patched file to ProgramFiles/Git

That's a good suggestion. Could you open a PR to make it so?

@mfriedrich74
Copy link

mfriedrich74 commented Feb 24, 2019 via email

@dscho
Copy link
Member

dscho commented Feb 24, 2019

@mfriedrich74 you don't need to guess, you can look!

In any case, we already work with a temporary directory in similar cases, look for ExpandConstant('{tmp}') in install.iss.

To test out your changes:

  1. Install Git for Windows' SDK
  2. sdk cd build-extra
  3. Edit installer/install.iss (look for "edit-git-bash", and use CopyFile() with the third parameter set to True to force-overwrite)
  4. Test by building a test installer (./installer/release.sh 0-test) and running it.

@dscho
Copy link
Member

dscho commented Feb 24, 2019

Okay, people, I really described in detail how you can help yourself with this issue. Ball's in your court now.

@donhuvy
Copy link
Author

donhuvy commented Mar 9, 2019

I install git version 2.21.0.windows.1 , it is ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants