Bug#627025: perl: data loss in output when both stdout and stderr are redirected to a pipe

Vincent Lefevre vincent at vinc17.net
Tue May 17 15:08:33 UTC 2011


On 2011-05-17 15:54:26 +0200, Vincent Lefevre wrote:
> Not sure whether this is related, but cvs had the same problem:
> 
>   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=179729
>   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=232555

After testing with "strace -f -t", I can see that the problem comes
from that the write's do not block: all the output is sent by the
Perl script before I do anything in less.

If I omit the 2>&1, then the write's from the Perl script block as
expected. They also block with the following Perl script (and 2>&1):

#!/usr/bin/env perl

use strict;

foreach my $i (1..100000)
  {
    warn if $i == 17;
    print "$i\n";
  }

I think that the cause of the problem may come from that the
svn client starts a child process (ssh). This would explain
the similarity with the old cvs bug (which occurred only with
ssh and stderr redirected to stdout too).

-- 
Vincent Lefèvre <vincent at vinc17.net> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)






More information about the Perl-maintainers mailing list