deadlock git upload-pack command when GIT_TRACE is enabled

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

deadlock git upload-pack command when GIT_TRACE is enabled

Eugene Petrenko
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.

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 [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|

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

Stefan Beller-4
On Mon, May 9, 2016 at 10:49 AM, Eugene Petrenko
<[hidden email]> 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.

           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 [hidden email]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|

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

Stefan Beller-4
On Mon, May 9, 2016 at 10:53 AM, Stefan Beller <[hidden email]> wrote:

> On Mon, May 9, 2016 at 10:49 AM, Eugene Petrenko
> <[hidden email]> 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.




>
>            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 [hidden email]
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html