git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: deadlock git upload-pack command when GIT_TRACE is enabled

From
Stefan Beller <sbeller@google.com>
Date
May 9, 2016, 17:54 UTC
Message-ID
<CAGZ79kZ35Dz7ky7XHUc=uXBiWcVTWQnU4aeogERxvO9gKdXBNQ@mail.gmail.com>
In-Reply-To
<CAGZ79kbhbLZpXe+Af+6PXioM-0xLz7S02=KAUavfuUSL6xM+jw@mail.gmail.com>
On Mon, May 9, 2016 at 10:53 AM, Stefan Beller <sbeller@google.com> wrote:
Show 20 quoted lines
> On Mon, May 9, 2016 at 10:49 AM, Eugene Petrenko
> <eugene.petrenko@gmail.com> wrote:
>> Hello,
>>
>> I stuck around the deadlock inside git when running git upload-pack .
>> command. A debugging shown that the bottom process (it starts several
>> processes to implement the task) hangs writing to stderr. I managed to
>> reproduce the issue with a tiny bash script. The repository and the
>> script is found here
>> https://github.com/jonnyzzz/git-upload-pack-deadlock
>>
>> I saw the issue reproducing both under Windows and Linux/Mac.
>
> GIT_TRACE=true GIT_TRACE_PACKET=true GIT_TRACE_PACK_ACCESS=true
>
> What do you mean by true?
>
>
>            If this variable is set to "1", "2" or "true" (comparison
> is case insensitive), trace messages will be printed to stderr.
Oh dang. I should read what I quote.
Show 33 quoted lines
>
>            If the variable is set to an integer value greater than 2
> and lower than 10 (strictly) then Git will interpret this value as an
> open file descriptor and will try to write the trace
>            messages into this file descriptor.
>
>            Alternatively, if the variable is set to an absolute path
> (starting with a / character), Git will interpret this as a file path
> and will try to write the trace messages into it.
>
>            Unsetting the variable, or setting it to empty, "0" or
> "false" (case insensitive) disables trace messages.
>
>>
>> Windows thread dumps are available here
>> https://github.com/jonnyzzz/git-upload-pack-deadlock/tree/master/debug
>>
>>
>> According to those thread dumps I see the following problem around
>> upload-pack.c line 129. There the pack_objects command is executed.
>> First the wants block is pushed to the command, next the stdout
>> processing is started. This means, that pack_objects process output is
>> not processed until all output is put there. In the case I have, the
>> pack_objects process writes TRACE logging into stderr and eventually
>> (on hug repo) the OS buffer runs-out deadlocking the execution.
>>
>>
>> Best regards,
>> Eugene Petrenko
>> --
>> To unsubscribe from this list: send the line "unsubscribe git" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous: Stefan Beller
Message 3 of 3 in “deadlock git upload-pack command when GIT_TRACE is enabled”
  1. Eugene PetrenkoMay 9, 2016
  2. Stefan BellerMay 9, 2016
  3. Stefan BellerMay 9, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.