Skip Menu |

This queue is for tickets about the Git-Repository CPAN distribution.

Report information
The Basics
Id: 60482
Status: resolved
Priority: 0/
Queue: Git-Repository

People
Owner: Nobody in particular
Requestors: TODDR [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.08
Fixed in: 1.09



Subject: new(input => ...) doesn't behave right.
with git version 1.7.2.1, I am seeing a failure for the test suite on t/20-simple on the last 2 tests. Strangeley, it's mis-behaving on centos 3,4 but not 5. I'm running on perl 5.12.1 on centos 3. This is an example of the failure which appears to also be present on Mac. http://www.cpantesters.org/cpan/report/8d6b9316-aae0-11df-8246-59ba6e8696e0 The test is failing with a SIGPIPE failure when "rev-parse --git-dir" is called. Because the object was created with an input hash value, ALL calls to run are going to try to pass this input to the run. I don't think this is what you were intending. That aside, when you call open3 in Git::Reppository::Command->new, we're not 1 checking for a valid pid 2. Somehow handling $SIG{'PIPE'} if CHILD_IN is closed by git. open3 docs state: If the child process dies for any reason, the next write to CHLD_IN is likely to generate a SIGPIPE in the parent, which is fatal by default. So you may wish to handle this signal. I do not think that in the failure cases, the program is going wrong so much as that we're seeing a difference between platforms on how libc requires stdin to be closed before a program can exit.
Show quoted text
> That aside, when you call open3 in Git::Reppository::Command->new, > we're not > 1 checking for a valid pid
Sorry, you are checking for this. my bad. Show quoted text
> 2. Somehow handling $SIG{'PIPE'} if CHILD_IN is closed by git.
I think you still need to do this check. something like this: local $SIG{'PIPE'} = sub {die("Failed to write to stdin for: $git " . join(' ', @cmd));}
The real bug in this ticket is that input is passed to all git run commands when input is passed into new. I think git is closing stdin sometimes when it starts up, so a sigpipe is going to happen even when the command succeeds. I'm not sure how you want to re-factor this, but it looks like a recent change so I'm guessing you might have some ideas.
On Wed Aug 18 15:47:59 2010, TODDR wrote: Show quoted text
> The real bug in this ticket is that input is passed to all git run > commands when input is passed > into new. I think git is closing stdin sometimes when it starts up, so > a sigpipe is going to > happen even when the command succeeds.
Thank you very much for you report and for the irc chat that followed. I've decided to: - handle the PIPE signal in Git::Repository::Command, to let the user know when git has closed stdin - ignore the 'input' option during new(), as I'm someone will eventually complain if I simply delete it, or warn or die :-) Thanks again, -- BooK