{"thread":{"id":"23147","subject":"Bug - crash on large commit","startedAt":"2010-03-22T23:36:25Z","lastAt":"2010-03-23T08:30:13Z","messageCount":3,"participants":["P Fudd","Erik Faye-Lund","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"137597","messageId":"310ba29b220a70e5624819e6ef80bff0.squirrel@www.pkts.ca","threadId":"23147","inReplyTo":null,"subject":"Bug - crash on large commit","fromName":"P Fudd","fromEmail":"fink@ch.pkts.ca","sentAt":"2010-03-22T23:36:25Z","receivedAt":"2010-03-22T23:36:25Z","isPatch":false,"sender":{"key":"fink@ch.pkts.ca","avatar":null},"body":"Hi...\n\nI'm a new user, and thinking that git is better than sliced bread.  So,\ntoday I had to set up a new computer (MacOSX), and thought: \"hey, I could\nput the whole system into git!\"\n\nWell, ok, technically yes, you can do that.  Go into the root directory,\ntype 'git init', then 'git add .', then 'git commit -a'.\n\nBug 1: git complained about a symbolic link to nowhere and halted...\nseveral hours into the 'add'.  If I want to store a broken link, let me;\nmaybe warn me.\n\nBug 2: git died with an out-of-memory error on the commit:\n------\n# git commit -a\n[master (root-commit) 62b52e2] The initial checkin of the whole hard disk.\n Committer: System Administrator <root@Mac-Pro.local>\nYour name and email address were configured automatically based\non your username and hostname. Please check that they are accurate.\nYou can suppress this message by setting them explicitly:\n\n    git config --global user.name \"Your Name\"\n    git config --global user.email you@example.com\n\nIf the identity used for this commit is wrong, you can fix it with:\n\n    git commit --amend --author='Your Name <you@example.com>'\n\ngit(4667) malloc: *** mmap(size=1964838912) failed (error code=12)\n*** error: can't allocate region\n*** set a breakpoint in malloc_error_break to debug\ngit(4667) malloc: *** mmap(size=1964838912) failed (error code=12)\n*** error: can't allocate region\n*** set a breakpoint in malloc_error_break to debug\nfatal: Out of memory, malloc failed\n[Mac-Pro:/] shadministrator# git version\ngit version 1.7.0.2\n-----\n\nAnyhoo, it's not really the right tool for the job, but Apple hasn't got a\npackage management system to speak of (yes, I know about bom files --\ndon't speak of it), and their filesystem loses bits now and then, so I\nwanted the crypto checksums and the ability to spot and roll back changes.\n I suppose TimeMachine will have to do.\n\nThanks for a great program!\n"},{"id":"137616","messageId":"40aa078e1003230125n5be565drb55fa7fdf731c72e@mail.gmail.com","threadId":"23147","inReplyTo":"310ba29b220a70e5624819e6ef80bff0.squirrel@www.pkts.ca","subject":"Re: Bug - crash on large commit","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@googlemail.com","sentAt":"2010-03-23T08:25:27Z","receivedAt":"2010-03-23T08:25:27Z","isPatch":false,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Tue, Mar 23, 2010 at 12:36 AM, P Fudd <fink@ch.pkts.ca> wrote:\n> Bug 2: git died with an out-of-memory error on the commit:\n> ------\n> # git commit -a\n> [master (root-commit) 62b52e2] The initial checkin of the whole hard disk.\n>  Committer: System Administrator <root@Mac-Pro.local>\n> Your name and email address were configured automatically based\n> on your username and hostname. Please check that they are accurate.\n> You can suppress this message by setting them explicitly:\n>\n>    git config --global user.name \"Your Name\"\n>    git config --global user.email you@example.com\n>\n> If the identity used for this commit is wrong, you can fix it with:\n>\n>    git commit --amend --author='Your Name <you@example.com>'\n>\n> git(4667) malloc: *** mmap(size=1964838912) failed (error code=12)\n> *** error: can't allocate region\n> *** set a breakpoint in malloc_error_break to debug\n> git(4667) malloc: *** mmap(size=1964838912) failed (error code=12)\n> *** error: can't allocate region\n> *** set a breakpoint in malloc_error_break to debug\n> fatal: Out of memory, malloc failed\n> [Mac-Pro:/] shadministrator# git version\n> git version 1.7.0.2\n\nIs your git built as a 32-bit program? If so, it can't handle files\nlarger than ~1-2 gb, which looks like it might be the case here...\n\n-- \nErik \"kusma\" Faye-Lund\n"},{"id":"137617","messageId":"20100323083013.GA14703@coredump.intra.peff.net","threadId":"23147","inReplyTo":"310ba29b220a70e5624819e6ef80bff0.squirrel@www.pkts.ca","subject":"Re: Bug - crash on large commit","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2010-03-23T08:30:13Z","receivedAt":"2010-03-23T08:30:13Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Mar 22, 2010 at 04:36:25PM -0700, P Fudd wrote:\n\n> Bug 1: git complained about a symbolic link to nowhere and halted...\n> several hours into the 'add'.  If I want to store a broken link, let me;\n> maybe warn me.\n\nGit does let you store broken links. Without seeing the actual error\nmessage you got, it's hard to say what actually happened. But you should\nbe able to:\n\n  $ mkdir foo && cd foo && git init\n  $ ln -s bogus link\n  $ git add .\n  $ git commit -m 'add bogus link'\n  $ git show\n  [...]\n  diff --git a/link b/link\n  new file mode 120000\n  index 0000000..882b604\n  --- /dev/null\n  +++ b/link\n  @@ -0,0 +1 @@\n  +bogus\n  \\ No newline at end of file\n\n> Bug 2: git died with an out-of-memory error on the commit:\n> ------\n> # git commit -a\n> [master (root-commit) 62b52e2] The initial checkin of the whole hard disk.\n>  Committer: System Administrator <root@Mac-Pro.local>\n> Your name and email address were configured automatically based\n> on your username and hostname. Please check that they are accurate.\n> You can suppress this message by setting them explicitly:\n> \n>     git config --global user.name \"Your Name\"\n>     git config --global user.email you@example.com\n> \n> If the identity used for this commit is wrong, you can fix it with:\n> \n>     git commit --amend --author='Your Name <you@example.com>'\n> \n> git(4667) malloc: *** mmap(size=1964838912) failed (error code=12)\n> *** error: can't allocate region\n> *** set a breakpoint in malloc_error_break to debug\n\nNote that it actually did make the commit, which means that the problem\nyou saw happened while git was generating a diffstat summary of the\ncommit.\n\nIt's hard to say exactly what it was trying to mmap without seeing a\nstack trace. But note that it is trying to malloc almost 2 gigabytes.\nIn general, git assumes that it can fit any file you throw at it into\nmemory during a diff. So presumably you have some gigantic file, and\nthat is the problem.\n\nWhich, as you noted, means git is not really suitable for just throwing\nyour whole hard disk at it. The topic of better handling gigantic files\ncomes up occasionally on the list, but I don't know that anyone is\nworking on anything concrete right now.\n\nAvery Pennarun's \"bup\" tool may be closer to what you want, but I've\nnever used it myself:\n\n  http://github.com/apenwarr/bup\n\n-Peff\n"}]}