git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "René Scharfe" <rene.scharfe@lsrfire.ath.cx>
To: John Hsing <tsyj2007@gmail.com>
Cc: Matthieu Moy <matthieu.moy@grenoble-inp.fr>,
	git@vger.kernel.org, Jeff King <peff@peff.net>
Subject: Re: a bug when execute "git status" in git version 1.7.7.431.g89633
Date: Sun, 23 Oct 2011 15:25:17 +0200	[thread overview]
Message-ID: <4EA415BD.1040109@lsrfire.ath.cx> (raw)
In-Reply-To: <4EA3D1BB.2010802@gmail.com>

Am 23.10.2011 10:35, schrieb John Hsing:
> ok,when i finish compiling git 1.7.7.431.g89633,I use it to check
> Cyanogenod(an Android mod source) by “git status”,it happend this
> error!but when i reuse git v1.7.7,it is OK!so i think it is a bug in
> git 1.7.7.431.g89633!My OS is Ubuntu Linux 10.10,sorry for my bad
> english! If you want to reproduce this error,please excute "git status"
> in https://github.com/CyanogenMod/android_packages_apps_DSPManager.git
> repo!

I can reproduce the malloc crash on Ubuntu 11.10 with these simple steps:

	$ a=android_packages_apps_DSPManager
	$ git-v1.7.7 clone https://github.com/CyanogenMod/$a.git
	Cloning into android_packages_apps_DSPManager...
	remote: Counting objects: 902, done.
	remote: Compressing objects: 100% (412/412), done.
	remote: Total 902 (delta 367), reused 838 (delta 324)
	Receiving objects: 100% (902/902), 136.78 KiB | 264 KiB/s, done.
	Resolving deltas: 100% (367/367), done.
	$ cd $a

	$ git-v1.7.7 status
	# On branch gingerbread
	nothing to commit (working directory clean)

	$ git-master status
	git: malloc.c:3096: sYSMALLOc: Assertion `(old_top == (((mbinptr) (((char *) &((av)->bins[((1) - 1) * 2])) - __builtin_offsetof (struct malloc_chunk, fd)))) && old_size == 0) || ((unsigned long) (old_size) >= (unsigned long)((((__builtin_offsetof (struct malloc_chunk, fd_nextsize))+((2 * (sizeof(size_t))) - 1)) & ~((2 * (sizeof(size_t))) - 1))) && ((old_top)->size & 0x1) && ((unsigned long)old_end & pagemask) == 0)' failed.
	Aborted

Bisect points to 2548183ba, "fix phantom untracked files when
core.ignorecase is set" from Jeff (cc:d).  If I revert that patch from
master (8963314c), git status works fine.

The following experimental patch fixes it for me as well, but I can't
claim to know exactly why.  In any case, estimate_cache_size() seems
to guess too low.

René


---
 read-cache.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/read-cache.c b/read-cache.c
index 01a0e25..b143bd3 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -1257,7 +1257,7 @@ static inline size_t estimate_cache_size(size_t ondisk_size, unsigned int entrie
 	 * Alignment can cause differences. This should be "alignof", but
 	 * since that's a gcc'ism, just use the size of a pointer.
 	 */
-	per_entry += sizeof(void *);
+	per_entry += 2 * sizeof(void *);
 	return ondisk_size + entries*per_entry;
 }
 

  reply	other threads:[~2011-10-23 13:25 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-22  0:20 a bug when execute "git status" in git version 1.7.7.431.g89633 John Hsing
2011-10-23  8:25 ` Matthieu Moy
2011-10-23  8:35   ` John Hsing
2011-10-23 13:25     ` René Scharfe [this message]
2011-10-23 14:28       ` René Scharfe
2011-10-23 16:29       ` Jeff King
2011-10-23 17:50         ` René Scharfe
2011-10-24  1:01           ` [PATCH] read-cache.c: fix index memory allocation René Scharfe
2011-10-24  7:07             ` Junio C Hamano
2011-10-24 15:59               ` René Scharfe
2011-10-24 21:59               ` René Scharfe
2011-10-24 23:34                 ` Nguyen Thai Ngoc Duy
2011-10-25  0:01                   ` Nguyen Thai Ngoc Duy
2011-10-25 18:00                     ` René Scharfe
2011-10-25 16:24                 ` Junio C Hamano
2011-10-24  7:28             ` Junio C Hamano
2011-10-24 15:52               ` René Scharfe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EA415BD.1040109@lsrfire.ath.cx \
    --to=rene.scharfe@lsrfire.ath.cx \
    --cc=git@vger.kernel.org \
    --cc=matthieu.moy@grenoble-inp.fr \
    --cc=peff@peff.net \
    --cc=tsyj2007@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).