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

Too many args give fatal cmalloc error #1917

Closed
1 task done
ole-tange opened this issue Nov 7, 2018 · 6 comments
Closed
1 task done

Too many args give fatal cmalloc error #1917

ole-tange opened this issue Nov 7, 2018 · 6 comments

Comments

@ole-tange
Copy link

  • I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options
git version 2.18.0.windows.1
cpu: x86_64
built from commit: cd1a74fc9dc8a07626c216940db9a51f25206e03
sizeof-long: 4
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver

Microsoft Windows [Version 10.0.17763.55]
  • What options did you set as part of the installation? Or did you choose the
    defaults?
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt

$ type "C:\Program Files\Git\etc\install-options.txt"
bash: type: C:\Program Files\Git\etc\install-options.txt: not found

$  type "C:\Program Files (x86)\Git\etc\install-options.txt"
bash: type: C:\Program Files (x86)\Git\etc\install-options.txt: not found

$  type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
bash: type: %USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt: not found

$ cat /etc/install-options.txt
cat: /etc/install-options.txt: No such file or directory
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

Nope.

Details

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

Bash.

$ /bin/true `seq 65070`
$ /bin/true `seq 65080`
$ /bin/echo `seq 100000`
$ /bin/wc `seq 100000`
$ /bin/cat `seq 100000`
  • What did you expect to occur after running these commands?

Nothing; nothing; output of 1 2 3 ... 100000; wc run on files; cat run on files.

  • What actually happened instead?

Nothing in the first example. The rest give output similar to this:

      1 [main] bash 14524 C:\Users\ota\Documents\PortableGit\usr\bin\bash.exe: *** fatal error - cmalloc would have returned NULL
Stack trace:
Frame        Function    Args
000FFFEB510  0018005E0DE (00180230639, 00180230C39, 001802412F0, 000FFFEA3E0)
000FFFEB510  001800468F9 (0018023F59A, 000FFFEB510, 0000000000C, 00000000010)
000FFFEB510  00180046932 (00180230616, 000000001E7, 001802412F0, 00000000000)
000FFFEB510  00180043543 (000FFFEB4B0, 00000000000, 00000000000, 00000000000)
000FFFEB510  0018005B002 (000000002C4, 0018028E980, 00000000002, 00000000000)
000FFFFB830  0018005B595 (000FFFFB9D8, 001803226D0, 00180322CDF, 00000000000)
000FFFFB970  00180129DE8 (00000000000, 00600045F40, 00600045F40, 00000000003)
6FFFFC90010  0018012B829 (00000080000, 00010000000, 00000200000, 00000000014)
00600052330  0018011DE4B (00000080000, 00010000000, 00000200000, 00000000014)
00600052330  00100414F5F (0000000001F, 0060004F1C6, 00000000278, 000FFFFC890)
006000440B0  00100416B63 (001FFFFFFFF, 000FFFFFFFF, 00100000000, 00600043FE0)
001004DE7B8  0010041796C (00000000004, 00100441480, 00000000002, 00600043FE0)
00000000000  00100419C44 (00000000000, 00000000000, 0018011DE4B, 001005FA368)
00000000000  00100401F78 (00100000002, 00000000001, 00000000001, 00000000001)
00000000000  001004DBF1A (000FFFFCC60, 00600000160, 00000000030, FF0700010302FF00)
000FFFFCCD0  00180047F24 (00000000000, 00000000000, 00000000000, 00000000000)
End of stack trace (more stack frames may be present)
Hangup

This issue is not present on Ubuntu.

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

Not a repository issue.

@PhilipOakley
Copy link

So the issue isn't with a Git / Git for Windows command. Rather it is with the MSYS2 minimal system and terminal that provides the shim between Git and the OS.

I also note that this is PortableGit

If you do the commands in reverse order, what happens then? Does the success move to the end, or it it just the second command that fails?

Maybe see if you can test on a plain vanilla MSYS2?

@ole-tange
Copy link
Author

The order of the commands do not matter: The failing commands fails and the command with success succeeds.

This looks like a buffer overflow - possibly in the bash binary included with https://git-scm.com/download/win

Can you confirm that you can not reproduce the error when running the above?

@dakotahawkins
Copy link

dakotahawkins commented Dec 10, 2018

If this is reproducible in msys2 and perhaps even cygwin, it may be related to the upper limit of this issue.

Edit: I can't reproduce it with /bin/cat `seq 100000` in cygwin, msys2, or git bash (or git bash in ConEmu).

@dscho
Copy link
Member

dscho commented Dec 26, 2018

@ole-tange you have been oddly silent on this issue, almost as if you were no longer interested in it (maybe because it magically works on your side now)? Please do engage with the community, otherwise I will have to close this ticket, writing it off as yet another loss of time and effort.

@dscho
Copy link
Member

dscho commented Dec 26, 2018

@ole-tange also note that this might be related to the buffer settings of your console, or something specific to your particular system (you indicated that there is nothing interesting about your setup, but the mere fact that there is no install-options.txt anywhere to be found in your system suggests strongly that you did not, in fact, install Git for Windows in the most common way, i.e. via the installer).

@dscho
Copy link
Member

dscho commented Feb 27, 2019

I am constantly amazed how many people report bugs that seem to be critical to them, and then just fall off the wagon at some stage. I hope @ole-tange is well, because this here ticket is not.

In any case, it is probably addressed via git-for-windows/MSYS2-packages#29 (and I just verified that v2.21.0 does not have any problem with the MCVE).

@dscho dscho closed this as completed Feb 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants