Bug 774703

Summary: git push on an empty repo: fatal: Out of memory, realloc failed
Product: [openSUSE] openSUSE 12.2 Reporter: Juergen Weigert <jw>
Component: OtherAssignee: Takashi Iwai <tiwai>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: jdsn
Version: Final   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Bug Depends on:    
Bug Blocks: 357354    

Description Juergen Weigert 2012-08-06 21:09:26 UTC
I create to fresh git repos for testing, one on code.google.com, one on github.
With both, I cannot do git push.
Top shows me, that it collects all 2.3 GB RAM I have here, then says
 fatal: Out of memory, realloc failed

git-1.7.10.4-2.1.2.i586

Is there a git configuration that could limit its memory usage?
Comment 1 Takashi Iwai 2012-08-07 08:57:13 UTC
It sounds strange for an empty repo.  You can pull the repos, right?
Any handy way I can reproduce the same problem?

Also, it's worth to try the latest git 1.7.11.x...
Comment 2 Juergen Weigert 2012-08-07 11:59:24 UTC
devel:tools:scm offers me only 1.7.10.4, where can I pull 1.7.11.x?
I can put my laptop on your desk, if you like?

While it collects memory, it is in a busyloop, strace:

13766 13:56:48.030587 write(1, "thub.com': \nUsername for 'https:"..., 4096 <unfinished ...>
13764 13:56:48.030612 read(3,  <unfinished ...>
13766 13:56:48.030633 <... write resumed> ) = 4096
13764 13:56:48.030652 <... read resumed> "thub.com': \nUsername for 'https:"..., 44139771) = 4096
13766 13:56:48.030689 write(1, "tps://github.com': \nUsername for"..., 4096 <unfinished ...>
13764 13:56:48.030714 read(3,  <unfinished ...>
13766 13:56:48.030734 <... write resumed> ) = 4096
13764 13:56:48.030754 <... read resumed> "tps://github.com': \nUsername for"..., 44135675) = 4096
13766 13:56:48.030791 write(1, " for 'https://github.com': \nUser"..., 4096 <unfinished ...>
13764 13:56:48.030815 read(3,  <unfinished ...>
13766 13:56:48.030836 <... write resumed> ) = 4096
13764 13:56:48.030856 <... read resumed> " for 'https://github.com': \nUser"..., 44131579) = 4096
13766 13:56:48.030893 write(1, "Username for 'https://github.com"..., 4096 <unfinished ...>
13764 13:56:48.030918 read(3,  <unfinished ...>
13766 13:56:48.030938 <... write resumed> ) = 4096
13764 13:56:48.030958 <... read resumed> "Username for 'https://github.com"..., 44127483) = 4096
13766 13:56:48.030998 write(1, ".com': \nUsername for 'https://gi"..., 4096 <unfinished ...>
13764 13:56:48.031023 read(3,  <unfinished ...>
13766 13:56:48.031044 <... write resumed> ) = 4096
13764 13:56:48.031063 <... read resumed> ".com': \nUsername for 'https://gi"..., 44123387) = 4096
13766 13:56:48.031101 write(1, "//github.com': \nUsername for 'ht"..., 4096 <unfinished ...>
13764 13:56:48.031125 read(3,  <unfinished ...>
13766 13:56:48.031147 <... write resumed> ) = 4096
13764 13:56:48.031167 <... read resumed> "//github.com': \nUsername for 'ht"..., 44119291) = 4096
13766 13:56:48.031219 write(1, " 'https://github.com': \nUsername"..., 4096 <unfinished ...>
13764 13:56:48.031257 read(3,  <unfinished ...>
13766 13:56:48.031278 <... write resumed> ) = 4096
13764 13:56:48.031298 <... read resumed> " 'https://github.com': \nUsername"..., 44115195) = 4096
13766 13:56:48.031336 write(1, "name for 'https://github.com': \n"..., 4096 <unfinished ...>
13764 13:56:48.031360 read(3,  <unfinished ...>
13766 13:56:48.031381 <... write resumed> ) = 4096
13764 13:56:48.031401 <... read resumed> "name for 'https://github.com': \n"..., 44111099) = 4096
13766 13:56:48.031437 write(1, "': \nUsername for 'https://github"..., 4096 <unfinished ...>
13764 13:56:48.031462 read(3,  <unfinished ...>
13766 13:56:48.031482 <... write resumed> ) = 4096
Comment 3 Takashi Iwai 2012-08-07 12:56:25 UTC
What is the URL of the origin?  Is it git:// or https:// or else?
Please show .git/config of the project.

Also I put git 1.7.11.4 to OBS home:tiwai:branches:devel:tools:scm/git repo.
It's being built.
Comment 4 Takashi Iwai 2012-08-07 13:08:55 UTC
The symptom sounds similar like the bug reported below
    http://code.google.com/p/msysgit/issues/detail?id=487
Comment 5 Juergen Weigert 2012-08-07 16:47:55 UTC
Reproduced with git 1.7.11.4 from OBS home:tiwai:branches:devel:tools:scm/git

$ cat .git/config
[core]
	repositoryformatversion = 0
	filemode = true
	bare = false
	logallrefupdates = true
[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = https://github.com/jnweiger/xxl-heissdrahtschneider.git
[branch "master"]
	remote = origin
	merge = refs/heads/master
Comment 6 Takashi Iwai 2012-08-07 17:34:35 UTC
And do you have any setup in ~/.gitconfig?
I wonder why root user worked.
Comment 7 Juergen Weigert 2012-08-08 07:57:06 UTC
Bingo! The culprit is

[core]
        askpass = yes

Having this in ~/.gitconfig makes both git-7.10.4 and git-7.11.4 run busy loop.
The word after the equals sign is apparently taken as a command to run.
I changed it to

[core]
        askpass = 

All is well now. Thanks!