{"thread":{"id":"46249","subject":"Crash in t3507-cherry-pick-conflict.sh with GIT_TEST_SPLIT_INDEX set","startedAt":"2017-06-24T18:51:32Z","lastAt":"2017-06-24T18:59:33Z","messageCount":2,"participants":["Christian Couder","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"323219","messageId":"CAP8UFD0bOfzY-_hBDKddOcJdPUpP2KEVaX_SrCgvAMYAHtseiQ@mail.gmail.com","threadId":"46249","inReplyTo":null,"subject":"Crash in t3507-cherry-pick-conflict.sh with GIT_TEST_SPLIT_INDEX set","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2017-06-24T18:51:11Z","receivedAt":"2017-06-24T18:51:32Z","isPatch":false,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Git from the master branch currently segfaults when running\nt3507-cherry-pick-conflict.sh with GIT_TEST_SPLIT_INDEX set:\n\nexpecting success:\n        pristine_detach initial &&\n        test_must_fail git cherry-pick -s picked-signed &&\n        git commit -a -s &&\n        test $(git show -s |grep -c \"Signed-off-by\") = 1\n\nHEAD is now at df2a63d... initial\nAuto-merging foo\nCONFLICT (content): Merge conflict in foo\nerror: could not apply e4ca149... picked-signed\nhint: after resolving the conflicts, mark the corrected paths\nhint: with 'git add <paths>' or 'git rm <paths>'\nhint: and commit the result with 'git commit'\nSegmentation fault\nnot ok 29 - commit after failed cherry-pick does not add duplicated -s\n#\n#               pristine_detach initial &&\n#               test_must_fail git cherry-pick -s picked-signed &&\n#               git commit -a -s &&\n#               test $(git show -s |grep -c \"Signed-off-by\") = 1\n#\n\nThe crash happens during the `git commit -a -s` with a backtrace like this:\n\nProgram received signal SIGSEGV, Segmentation fault.\n0x000000000050bcf1 in entry_equals (map=0x8cef80 <the_index+64>,\ne1=0xa2d2d2d2d2d2d00, e2=0x7fffffffce10,\n    keydata=0x0) at hashmap.c:98\n98              return (e1 == e2) || (e1->hash == e2->hash &&\n!map->cmpfn(e1, e2, keydata));\n(gdb) bt\n#0  0x000000000050bcf1 in entry_equals (map=0x8cef80 <the_index+64>,\ne1=0xa2d2d2d2d2d2d00, e2=0x7fffffffce10,\n    keydata=0x0) at hashmap.c:98\n#1  0x000000000050bec6 in find_entry_ptr (map=0x8cef80 <the_index+64>,\nkey=0x7fffffffce10, keydata=0x0)\n    at hashmap.c:138\n#2  0x000000000050c044 in hashmap_get (map=0x8cef80 <the_index+64>,\nkey=0x7fffffffce10, keydata=0x0)\n    at hashmap.c:182\n#3  0x0000000000525a1d in hashmap_get_from_hash (map=0x8cef80\n<the_index+64>, hash=1625022057, keydata=0x0)\n    at hashmap.h:78\n#4  0x0000000000526edd in index_file_exists (istate=0x8cef40\n<the_index>, name=0x8f19d0 \"unrelated\",\n    namelen=9, icase=0) at name-hash.c:701\n#5  0x00000000004f55ba in treat_one_path (dir=0x7fffffffd0b0,\nuntracked=0x0, istate=0x8cef40 <the_index>,\n    path=0x7fffffffcf80, baselen=0, pathspec=0x88c2b8 <s+24>, dtype=8,\nde=0x8f8a00) at dir.c:1550\n#6  0x00000000004f5914 in treat_path (dir=0x7fffffffd0b0,\nuntracked=0x0, cdir=0x7fffffffcfa0,\n    istate=0x8cef40 <the_index>, path=0x7fffffffcf80, baselen=0,\npathspec=0x88c2b8 <s+24>) at dir.c:1660\n#7  0x00000000004f6006 in read_directory_recursive\n(dir=0x7fffffffd0b0, istate=0x8cef40 <the_index>,\n    base=0x61561b \"\", baselen=0, untracked=0x0, check_only=0,\npathspec=0x88c2b8 <s+24>) at dir.c:1809\n\nIt bisects to f9d7abec2a (split-index: add and use\nunshare_split_index(), 2017-05-05) that is fixing memory leaks when\ndiscarding the index.\nIt looks like we are freeing some cache entries that we shouldn't free.\n"},{"id":"323221","messageId":"xmqqy3sh8b5c.fsf@gitster.mtv.corp.google.com","threadId":"46249","inReplyTo":"CAP8UFD0bOfzY-_hBDKddOcJdPUpP2KEVaX_SrCgvAMYAHtseiQ@mail.gmail.com","subject":"Re: Crash in t3507-cherry-pick-conflict.sh with GIT_TEST_SPLIT_INDEX set","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-06-24T18:59:27Z","receivedAt":"2017-06-24T18:59:33Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Christian Couder <christian.couder@gmail.com> writes:\n\n> It bisects to f9d7abec2a (split-index: add and use\n> unshare_split_index(), 2017-05-05) that is fixing memory leaks when\n> discarding the index.\n> It looks like we are freeing some cache entries that we shouldn't free.\n\nOuch.  Let's revert the merge for now so that we can figure out what\nis exactly broken in 'pu'.\n\n"}]}