Re: git-commit fatal: Out of memory? mmap failed: Bad file descriptor
- From
Brandon Casey <casey@nrlssc.navy.mil>
- Date
- Jan 15, 2008, 19:43 UTC
- Message-ID
- <478D0CDA.5050709@nrlssc.navy.mil>
- In-Reply-To
- <alpine.LFD.1.00.0801151036110.2806@woody.linux-foundation.org>
Linus Torvalds wrote:
Show 8 quoted lines
> > On Tue, 15 Jan 2008, Brandon Casey wrote: >> Linus Torvalds wrote: >>> It would obviously be interesting to see the base repository and the >>> commit you are trying to do - is that possibly publicly available? >> I wish it was. > > It's ok, I found the bug in your full strace.
Good catch, but that wasn't it. Still getting the same error.
> and now it's trying to close that fd *again*
In that same vein, just above your changes in prepare_index() is:
if (!pathspec || !*pathspec) {
fd = hold_locked_index(&index_lock, 1);
refresh_cache(REFRESH_QUIET);
if (write_cache(fd, active_cache, active_nr) ||
close(fd) || commit_locked_index(&index_lock))
die("unable to write new_index file");
commit_style = COMMIT_AS_IS;
return get_index_file();
}If I followed hold_locked_index() correctly, then fd and index_lock.fd are equal, and commit_locked_index() does a close(lk->fd) making the close(fd) above, redundant (or vice-versa).
Probably not causing the error at hand, but not good.
-brandon
diff --git a/builtin-commit.c b/builtin-commit.c index 1e55c2e..3b4f4e2 100644 --- a/builtin-commit.c +++ b/builtin-commit.c @@ -256,7 +256,7 @@ static char *prepare_index(int argc, const char **argv, cons fd = hold_locked_index(&index_lock, 1); refresh_cache(REFRESH_QUIET); if (write_cache(fd, active_cache, active_nr) || - close(fd) || commit_locked_index(&index_lock)) + commit_locked_index(&index_lock)) die("unable to write new_index file"); commit_style = COMMIT_AS_IS; return get_index_file();