deadlock git upload-pack command when GIT_TRACE is enabled

3 messages, 2 authors, 2016-06-16 · open the first message on its own page

deadlock git upload-pack command when GIT_TRACE is enabled

From: Eugene Petrenko <hidden>
Date: 2016-06-16 02:19:16

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

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

From: Stefan Beller <hidden>
Date: 2016-06-16 02:19:16

On Mon, May 9, 2016 at 10:49 AM, Eugene Petrenko
[off-list ref] 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 majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

From: Stefan Beller <hidden>
Date: 2016-06-16 02:19:16

On Mon, May 9, 2016 at 10:53 AM, Stefan Beller [off-list ref] wrote:
On Mon, May 9, 2016 at 10:49 AM, Eugene Petrenko
[off-list ref] wrote:
quoted
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.
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help