aboutsummaryrefslogtreecommitdiff
path: root/http-walker.c
diff options
context:
space:
mode:
authorNicolas Morey-Chaisemartin <devel-git@morey-chaisemartin.com>2011-08-30 15:45:38 +0200
committerJunio C Hamano <gitster@pobox.com>2011-08-30 11:14:24 -0700
commit8cb5775b2b9885708c3f646a1e273de1ac778a88 (patch)
tree2b0661076842cc1cafbb778e37041c8af7d9d7eb /http-walker.c
parent5b594f457afcf2cdddb3c79de8bcc571c775aa55 (diff)
downloadgit-8cb5775b2b9885708c3f646a1e273de1ac778a88.tar.gz
git-8cb5775b2b9885708c3f646a1e273de1ac778a88.tar.xz
grep: Fix race condition in delta_base_cache
When running large git grep (ie: git grep regexp $(git rev-list --all)), glibc error sometimes occur: *** glibc detected *** git: double free or corruption (!prev): 0x00000000010abdf0 *** According to gdb the problem originate from release_delta_cash (sha1_file.c:1703) free(ent->data); >From my analysis it seems that git grep threads do acquire lock before calling read_sha1_file but not before calling read_object_with_reference who ends up calling read_sha1_file too. Adding the lock around read_object_with_reference seems to fix the issue for me. I've ran git grep about a dozen time and seen no more error while it usually happened half the time before. Signed-off-by: Nicolas Morey-Chaisemartin <nicolas@morey-chaisemartin.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'http-walker.c')
0 files changed, 0 insertions, 0 deletions