{"thread":{"id":"42267","subject":"deadlock git upload-pack command when GIT_TRACE is enabled","startedAt":"2016-05-09T17:49:01Z","lastAt":"2016-05-09T17:54:21Z","messageCount":3,"participants":["Eugene Petrenko","Stefan Beller"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"285951","messageId":"CAJNyVBAr7dJFxXA2+dXCJUMs=mB9u3-Ja7r4wemk9C_HBZ3W2A@mail.gmail.com","threadId":"42267","inReplyTo":null,"subject":"deadlock git upload-pack command when GIT_TRACE is enabled","fromName":"Eugene Petrenko","fromEmail":"eugene.petrenko@gmail.com","sentAt":"2016-05-09T17:49:01Z","receivedAt":"2016-05-09T17:49:01Z","isPatch":false,"sender":{"key":"eugene.petrenko@gmail.com","avatar":null},"body":"Hello,\n\nI stuck around the deadlock inside git when running git upload-pack .\ncommand. A debugging shown that the bottom process (it starts several\nprocesses to implement the task) hangs writing to stderr. I managed to\nreproduce the issue with a tiny bash script. The repository and the\nscript is found here\nhttps://github.com/jonnyzzz/git-upload-pack-deadlock\n\nI saw the issue reproducing both under Windows and Linux/Mac.\n\nWindows thread dumps are available here\nhttps://github.com/jonnyzzz/git-upload-pack-deadlock/tree/master/debug\n\n\nAccording to those thread dumps I see the following problem around\nupload-pack.c line 129. There the pack_objects command is executed.\nFirst the wants block is pushed to the command, next the stdout\nprocessing is started. This means, that pack_objects process output is\nnot processed until all output is put there. In the case I have, the\npack_objects process writes TRACE logging into stderr and eventually\n(on hug repo) the OS buffer runs-out deadlocking the execution.\n\n\nBest regards,\nEugene Petrenko\n"},{"id":"285952","messageId":"CAGZ79kbhbLZpXe+Af+6PXioM-0xLz7S02=KAUavfuUSL6xM+jw@mail.gmail.com","threadId":"42267","inReplyTo":"CAJNyVBAr7dJFxXA2+dXCJUMs=mB9u3-Ja7r4wemk9C_HBZ3W2A@mail.gmail.com","subject":"Re: deadlock git upload-pack command when GIT_TRACE is enabled","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2016-05-09T17:53:41Z","receivedAt":"2016-05-09T17:53:41Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Mon, May 9, 2016 at 10:49 AM, Eugene Petrenko\n<eugene.petrenko@gmail.com> wrote:\n> Hello,\n>\n> I stuck around the deadlock inside git when running git upload-pack .\n> command. A debugging shown that the bottom process (it starts several\n> processes to implement the task) hangs writing to stderr. I managed to\n> reproduce the issue with a tiny bash script. The repository and the\n> script is found here\n> https://github.com/jonnyzzz/git-upload-pack-deadlock\n>\n> I saw the issue reproducing both under Windows and Linux/Mac.\n\nGIT_TRACE=true GIT_TRACE_PACKET=true GIT_TRACE_PACK_ACCESS=true\n\nWhat do you mean by true?\n\n\n           If this variable is set to \"1\", \"2\" or \"true\" (comparison\nis case insensitive), trace messages will be printed to stderr.\n\n           If the variable is set to an integer value greater than 2\nand lower than 10 (strictly) then Git will interpret this value as an\nopen file descriptor and will try to write the trace\n           messages into this file descriptor.\n\n           Alternatively, if the variable is set to an absolute path\n(starting with a / character), Git will interpret this as a file path\nand will try to write the trace messages into it.\n\n           Unsetting the variable, or setting it to empty, \"0\" or\n\"false\" (case insensitive) disables trace messages.\n\n>\n> Windows thread dumps are available here\n> https://github.com/jonnyzzz/git-upload-pack-deadlock/tree/master/debug\n>\n>\n> According to those thread dumps I see the following problem around\n> upload-pack.c line 129. There the pack_objects command is executed.\n> First the wants block is pushed to the command, next the stdout\n> processing is started. This means, that pack_objects process output is\n> not processed until all output is put there. In the case I have, the\n> pack_objects process writes TRACE logging into stderr and eventually\n> (on hug repo) the OS buffer runs-out deadlocking the execution.\n>\n>\n> Best regards,\n> Eugene Petrenko\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n"},{"id":"285953","messageId":"CAGZ79kZ35Dz7ky7XHUc=uXBiWcVTWQnU4aeogERxvO9gKdXBNQ@mail.gmail.com","threadId":"42267","inReplyTo":"CAGZ79kbhbLZpXe+Af+6PXioM-0xLz7S02=KAUavfuUSL6xM+jw@mail.gmail.com","subject":"Re: deadlock git upload-pack command when GIT_TRACE is enabled","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2016-05-09T17:54:21Z","receivedAt":"2016-05-09T17:54:21Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Mon, May 9, 2016 at 10:53 AM, Stefan Beller <sbeller@google.com> wrote:\n> On Mon, May 9, 2016 at 10:49 AM, Eugene Petrenko\n> <eugene.petrenko@gmail.com> wrote:\n>> Hello,\n>>\n>> I stuck around the deadlock inside git when running git upload-pack .\n>> command. A debugging shown that the bottom process (it starts several\n>> processes to implement the task) hangs writing to stderr. I managed to\n>> reproduce the issue with a tiny bash script. The repository and the\n>> script is found here\n>> https://github.com/jonnyzzz/git-upload-pack-deadlock\n>>\n>> I saw the issue reproducing both under Windows and Linux/Mac.\n>\n> GIT_TRACE=true GIT_TRACE_PACKET=true GIT_TRACE_PACK_ACCESS=true\n>\n> What do you mean by true?\n>\n>\n>            If this variable is set to \"1\", \"2\" or \"true\" (comparison\n> is case insensitive), trace messages will be printed to stderr.\n\nOh dang. I should read what I quote.\n\n\n\n\n>\n>            If the variable is set to an integer value greater than 2\n> and lower than 10 (strictly) then Git will interpret this value as an\n> open file descriptor and will try to write the trace\n>            messages into this file descriptor.\n>\n>            Alternatively, if the variable is set to an absolute path\n> (starting with a / character), Git will interpret this as a file path\n> and will try to write the trace messages into it.\n>\n>            Unsetting the variable, or setting it to empty, \"0\" or\n> \"false\" (case insensitive) disables trace messages.\n>\n>>\n>> Windows thread dumps are available here\n>> https://github.com/jonnyzzz/git-upload-pack-deadlock/tree/master/debug\n>>\n>>\n>> According to those thread dumps I see the following problem around\n>> upload-pack.c line 129. There the pack_objects command is executed.\n>> First the wants block is pushed to the command, next the stdout\n>> processing is started. This means, that pack_objects process output is\n>> not processed until all output is put there. In the case I have, the\n>> pack_objects process writes TRACE logging into stderr and eventually\n>> (on hug repo) the OS buffer runs-out deadlocking the execution.\n>>\n>>\n>> Best regards,\n>> Eugene Petrenko\n>> --\n>> To unsubscribe from this list: send the line \"unsubscribe git\" in\n>> the body of a message to majordomo@vger.kernel.org\n>> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n"}]}