{"thread":{"id":"45138","subject":"[BUG] Memory corruption crash with \"git bisect start\"","startedAt":"2017-02-14T11:57:55Z","lastAt":"2017-02-14T14:53:21Z","messageCount":2,"participants":["Maxim Kuvyrkov","Christian Couder"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"311539","messageId":"A7AEC719-6E15-4622-8E21-3E11BAF74A3C@linaro.org","threadId":"45138","inReplyTo":null,"subject":"[BUG] Memory corruption crash with \"git bisect start\"","fromName":"Maxim Kuvyrkov","fromEmail":"maxim.kuvyrkov@linaro.org","sentAt":"2017-02-14T11:56:22Z","receivedAt":"2017-02-14T11:57:55Z","isPatch":false,"sender":{"key":"maxim.kuvyrkov@linaro.org","avatar":"https://gravatar.com/avatar/69cb389e8d846940106bc9acc9e1bce67eeb225a03be0c8147a53d864f0e611a?d=mp&s=160"},"body":"I'm seeing the following memory corruption crash on a script-constructed repo when starting git bisect.  I'm seeing this crash both with system git of Ubuntu Xenial and with freshly-compiled git master from the official repo.\n\nThe log of the crash is attached.\n\nIt is possible that the bug is in Xenial glibc, in which case -- please let me know and I will take it up with the glibc developers.\n\nTo reproduce the crash:\n\n<snip>\n# Create a repo with 42 files, and change all of them.\nrm -rf .git\ngit init\nfor i in `seq 1 42`; do echo 0 > f$i; git add f$i; echo 1 > f$i; done\ngit commit -m 0\n\n# Download script to generate bisect history:\npushd ../\nwget https://git.linaro.org/people/maxim.kuvyrkov/tree-bisect.git/plain/construct-tree.sh\npopd\n\n# Construct tree for bisect.  This script creates a history graph for all permutations of changed files up to \"2\" in depth.\n# The goal of the script is to assist in reducing testcases for compiler/toolchain development.\n../construct-tree.sh -d 2\n\n# Trigger crash\ngit bisect start bottom top\n</snip>\n\nIt is interesting that \"42\" number files is boundary.  The crash does not occur with history generated from 41 or fewer files, and only occurs with 42 or more files.  It appears that the contents of the files is not relevant for the crash.\n\n--\nMaxim Kuvyrkov\nwww.linaro.org\n\n\n"},{"id":"311542","messageId":"CAP8UFD12tQmWRV29BLO+KJGcGHXOqPaOLbovL7kTBHPWdyMM3g@mail.gmail.com","threadId":"45138","inReplyTo":"A7AEC719-6E15-4622-8E21-3E11BAF74A3C@linaro.org","subject":"Re: [BUG] Memory corruption crash with \"git bisect start\"","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2017-02-14T14:52:40Z","receivedAt":"2017-02-14T14:53:21Z","isPatch":false,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Tue, Feb 14, 2017 at 12:56 PM, Maxim Kuvyrkov\n<maxim.kuvyrkov@linaro.org> wrote:\n> I'm seeing the following memory corruption crash on a script-constructed repo when starting git bisect.  I'm seeing this crash both with system git of Ubuntu Xenial and with freshly-compiled git master from the official repo.\n>\n> The log of the crash is attached.\n\nYeah, thanks for the report.\n\nI took a look and it looks like git bisect crashes when it runs git\nshow-branch and it can be reproduced with just `git show-branch\nbottom` instead of `git bisect start bottom top`.\n\n> It is possible that the bug is in Xenial glibc, in which case -- please let me know and I will take it up with the glibc developers.\n\nI have Ubuntu GLIBC 2.23-0ubuntu5 and I get a crash too.\n"}]}