8

hint: Waiting for your editor to close the file... 0 [main] vim 7372 C:\Program Files\Git\usr\bin\vim.exe: *** fatal error - cmalloc would have returned NULL 334 [main] vim 7372 cygwin_exception::open_stackdumpfile: Dumping stack trace to vim.exe.stackdump Aborting commit due to empty commit message.

Note : closed all related file to the one I want to commit.

I am running git commit -a to commit all changes I did on my project. I did the hint that the cmd offer but I still get error.

How to fix above error.

Update

When I first run the same command I was directed to a vim and I added the comment there. This time it does go to that screen just giving the error.

Running git status gives me:

enter image description here

romainl
  • 186,200
  • 21
  • 280
  • 313
guradio
  • 15,524
  • 4
  • 36
  • 57

4 Answers4

12

This error message can be seen in CMD wrapper like cmder.

It was recently fixed in Git for Windows 356 and PR 29.
It will be in Git 2.19 (for Windows) around Sept. 9th.

As the OP guradio comments:

Just used VScode and now I can update Git.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • im reading the fix but I cant totally understand to be honest no matter how many times I read it. Do i need to install new git? – guradio Aug 14 '18 at 05:03
  • @guradio Yes, the 2.19 as soon as it will be released. In the meantime, are you using a simple CMD, or cmder (a console emulator: http://cmder.net/)? – VonC Aug 14 '18 at 05:04
  • just a CMD in windows. Im using Visual Studio as IDE if it helps – guradio Aug 14 '18 at 05:07
  • @guradio So vim should not be involved: try and see if you can set vscode as your editor: https://stackoverflow.com/a/36644561/6309. Then check if the issue persists. – VonC Aug 14 '18 at 06:10
  • 1
    @guradio Thank you for the feedback: I have included your comment in the answer for more visibility. – VonC Aug 30 '18 at 06:44
8

I got cmalloc would have returned NULL when trying to launch vim from a command line in git bash through ConsoleZ. According to https://cygwin.com/ml/cygwin/2014-07/msg00185.html, this can happen if you set your console/terminal buffer too large. I had mine set at 5000 lines. Reducing it to 2000 resolved my issue. Hope this helps someone!

adamdport
  • 11,687
  • 14
  • 69
  • 91
  • 1
    Finally, the real solution! Though I do wonder how it got set to 9000 lines...either way, probably want to change the Defaults as well as the current window. – Dylan Nicholson May 26 '21 at 11:50
3

I got the same error while i was using a normal command prompt on windows. I switched to git bash and it worked like a charm!

Preeti Joshi
  • 841
  • 1
  • 13
  • 20
  • thank you so much for this! Works great if you need a quicker fix than some proposed above. – n1c9 May 28 '20 at 20:02
2

I had the same issue.

My environment:

  • Windows 10 Version 20H2
  • git version 2.33.1.windows.1

When checking the global options (git config --global --list) no default editor was set.

Setting the default editor to vim fixed the issue on my machine: git config --global core.editor vim

Marcel Studer
  • 581
  • 8
  • 9