Skip to content
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

warning: failed to restrict file handles (5) #2353

Closed
LeonardGC opened this issue Oct 8, 2019 · 5 comments
Closed

warning: failed to restrict file handles (5) #2353

LeonardGC opened this issue Oct 8, 2019 · 5 comments

Comments

@LeonardGC
Copy link

LeonardGC commented Oct 8, 2019

ISSUE: from a script
Log:
...
(mvn build)
...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.419 s
[INFO] Finished at: 2019-10-08T16:33:35+02:00
[INFO] ------------------------------------------------------------------------
[master 8269297] Release v5.16.3
5 files changed, 5 insertions(+), 5 deletions(-)
warning: failed to restrict file handles (5)

handle #0: 0000000000000440 (type 3, handle info (1) 0
handle #1: 0000000000000444 (type 3, handle info (1) 1

This is a bug; please report it at
https://github.com/git-for-windows/git/issues/new

To suppress this warning, please set the environment variable

    SUPPRESS_HANDLE_INHERITANCE_WARNING=1

Already up to date.
...

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?

git version 2.23.0.windows.1
cpu: x86_64
built from commit: 4db2e5c
sizeof-long: 4
sizeof-size_t: 8

  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?

Microsoft Windows [Version 10.0.18362.356]

  • What options did you set as part of the installation? Or did you choose the
    defaults?

Editor Option: Notepad++
Custom Editor Path:
Path Option: Cmd
SSH Option: OpenSSH
Tortoise Option: false
CURL Option: OpenSSL
CRLF Option: CRLFAlways
Bash Terminal Option: MinTTY
Performance Tweaks FSCache: Enabled
Use Credential Manager: Disabled
Enable Symlinks: Disabled
Enable Builtin Interactive Add: Disabled

  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

Command window was started from inside SourceTree (Clicked on Terminal)

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

MingW64?

I ran a script.
This were the last commands of that script:
********** START **************
git merge develop

mvn org.codehaus.mojo:versions-maven-plugin:set -DnewVersion=${NEW_VERSION} versions:commit
find . -name 'pom.xml' | xargs git add
git commit -m "Release v${NEW_VERSION}"
git pull
git push
*********** END ***************
So it seems that it appeared at the end of the commit, or at the start of the pull

  • What did you expect to occur after running these commands?

** insert here **

  • What actually happened instead?

everything seems to be allright?!?

  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?

no

@PhilipOakley
Copy link

There was some hearsay that SourceTree internally used an older version. But I'm not sure if that is just a scurrilous rumour (I don't use SourceTree).

Was the git version generated from a command issued inside SourceTree (and what version of SourceTree is it?)

@LeonardGC
Copy link
Author

No that can't be the issue.

  1. I don't use the internal git from SourceTree,
  2. I let SourceTree open a terminal window and the GitVersion comes from that window
  3. This terminal window isIMHO completely separate from SourceTree, because when I close SourceTree those windows stay open.

@dscho
Copy link
Member

dscho commented Oct 8, 2019

failed to restrict file handles (5)

According to https://github.com/git-for-windows/git-sdk-64/blob/f146d8c11c82ba1e976752df10ea9f92ab914141/mingw64/x86_64-w64-mingw32/include/winerror.h#L50, this means "Access denied".

handle #0: 0000000000000440 (type 3, handle info (1) 0

the 3 means that the file type is that it is a pipe.

As far as I remember, pipes are inheritable anyways, so it does not make sense to include them in the "restrict file handles" code path.

@LeonardGC since your example is not exactly minimal (I don't have Maven, and as far as I remember, the first Maven run always downloads half the internet), can you try the following:

  1. install the Git for Windows SDK,

  2. sdk cd git

  3. insert something like this before https://github.com/git-for-windows/git/blob/v2.23.0.windows.1/compat/mingw.c#L1830:

    if (stdhandles_count > 0) {
        /* skip pipe handles; they are inheritable by default, anyway */
        DWORD i, j;
    
        for (i = j = 0; i < stdhandles_count; i++)
            if (GetFileType(stdhandles[i]) != FILE_TYPE_PIPE)
                stdhandles[j++] = stdhandles[i];
    
        stdhandles_count = j;
    }

    (Note: I wrote this on the web, it might need adjusting before it compiles.)

  4. make -j$(nproc) install

  5. test by inserting the SDK's mingw64\bin and usr\bin into the PATH, at the beginning

@LeonardGC
Copy link
Author

LeonardGC commented Oct 9, 2019 via email

@dscho
Copy link
Member

dscho commented Oct 9, 2019 via email

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

3 participants