Skip Menu |
 

This queue is for tickets about the Net-SSH-Perl CPAN distribution.

Report information
The Basics
Id: 17475
Status: resolved
Priority: 0/
Queue: Net-SSH-Perl

People
Owner: Nobody in particular
Requestors: cpan-contact [...] fischglas.de
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in:
  • 1.25
  • 1.27
  • 1.29
Fixed in: (no value)



Subject: Net::SSH::Perl blocks/crashes on IO-Volume > 32kB
please see the attached file for extensive description of the problem
Subject: Net::SSH::Perl.txt
Download Net::SSH::Perl.txt
text/plain 5.8k
Net::SSH::Perl blocks/crashes on IO-Volume > 32kB I ran several tests: (error messages are given if I got some) Net::SSH::Perl 1.25 Src-OS FreeBSD 4.11 Target-OS FreeBSD 4.11 Target-SSH SSH-2.0-OpenSSH_3.5p1 FreeBSD-20030924 Size Result 32000 Ok 33000 writes 33000 bytes & hangs 63999 writes 63999 bytes & hangs 64000 writes 32768 bytes & hangs 100000 writes 98304 bytes & dies : Received disconnect message: Bad packet length 257988659. at /sw/i386_fbsd4/perl-5.8/lib/site_perl/5.8.4/Net/SSH/Perl/SSH2.pm line 281 130000 Ok 140000 writes 32768 bytes & dies Net::SSH::Perl 1.25 Src-OS FreeBSD 4.11 Target-OS FreeBSD 4.11 Target-SSH SSH-2.0-OpenSSH_3.8.1p1 32000 Ok 33000 writes 33000 bytes & hangs 63999 writes 63999 bytes & hangs 64000 writes 64000 bytes & hangs 100000 Ok 130000 Ok 140000 Ok Net::SSH::Perl 1.25 Src-OS FreeBSD 4.11 Target-OS FreeBSD 4.11 Target-SSH SSH-2.0-OpenSSH_3.5p1 FreeBSD-20030924 32000 Ok 33000 writes 33000 bytes & hangs 33222 writes 33222 bytes & hangs 33223 writes 32768 bytes & hangs 63999 writes 32768 bytes & hangs 64000 writes 32768 bytes & hangs 100000 writes 32768 bytes & dies Received disconnect message: Corrupted MAC on input. at /sw/i386_fbsd4/perl-5.8/lib/site_perl/5.8.4/Net/SSH/Perl/SSH2.pm line 281 120000 writes 32768 bytes & dies Received disconnect message: Corrupted MAC on input. at /sw/i386_fbsd4/perl-5.8/lib/site_perl/5.8.4/Net/SSH/Perl/SSH2.pm line 281 130000 writes 32768 bytes & dies 340000 Ok Net::SSH::Perl 1.25 Src-OS FreeBSD 4.11 Target-OS FreeBSD 5.4 Target-SSH SSH-2.0-OpenSSH_3.8.1p1 FreeBSD-20040419 32000 Ok 33000 writes 33000 bytes & hangs 33222 writes 33222 bytes & hangs 33223 writes 32768 bytes & hangs 63999 writes 32768 bytes & hangs 64000 writes 32768 bytes & hangs 100000 writes 32768 bytes & dies Received disconnect message: Corrupted MAC on input. at /sw/i386_fbsd4/perl-5.8/lib/site_perl/5.8.4/Net/SSH/Perl/SSH2.pm line 281 120000 writes 32768 bytes & dies 130000 writes 32768 bytes & dies 340000 writes 32768 bytes & dies Net::SSH::Perl 1.27 Src-OS FreeBSD 5.4 Target-OS FreeBSD 5.4 Target-SSH SSH-2.0-OpenSSH_3.8.1p1 FreeBSD-20040419 32000 Ok 33000 writes 33000 bytes & dies Received disconnect message: Corrupted MAC on input. at /sw/i386_fbsd4/perl-5.8/lib/site_perl/5.8.4/Net/SSH/Perl/SSH2.pm line 281 33222 writes 33222 bytes & hangs 33223 writes 33223 bytes & hangs 63999 writes 63999 bytes & hangs 64000 writes 64000 bytes & hangs 100000 Ok 120000 Ok 130000 (1) Ok 130000 (2) writes 65536 bytes & dies Received disconnect message: Corrupted MAC on input. at /sw/i386_fbsd4/perl-5.8/lib/site_perl/5.8.4/Net/SSH/Perl/SSH2.pm line 281 Net::SSH::Perl 1.29 Src-OS FreeBSD 5.4 Target-OS FreeBSD 5.4 Target-SSH SSH-2.0-OpenSSH_3.8.1p1 FreeBSD-20040419 32000 Ok 33000 writes 33000 bytes & dies Received disconnect message: Corrupted MAC on input. at /sw/i386_fbsd4/perl-5.8/lib/site_perl/5.8.4/Net/SSH/Perl/SSH2.pm line 281 33222 writes 33222 bytes & hangs 33223 writes 33223 bytes & hangs 63999 writes 63999 bytes & hangs 64000 writes 64000 bytes & hangs 100000 Ok 120000 Ok 130000 Ok For none of the versions 1.25, 1.27 and 1.29 the "make test" succeeded: t/03-packet......ok 1/10 <- hangs Last but not least the way I tested: ------------- Net::SSH::Perl-scp.pl -------- #!/client/bin/perl # # copy stdin -> host:/tmp/blah # use strict; use Net::SSH::Perl; my $host = "some.host"; my $user = "unknown"; my $pass = "secret"; my $file = "/tmp/blah"; my $copy = "cat - > $file"; my $c = do { local $/; $_ = <> }; my $ssh = Net::SSH::Perl->new( $host, protocol => 2, # debug => 1, ); $ssh->login($user,$pass); # just test connection my($stdout, $stderr, $exit) = $ssh->cmd("w"); print "stdout: <<$stdout>>\n"; print "stderr: <<$stderr>>\n"; print "exit: <<$exit>>\n"; # copy file my($stdout, $stderr, $exit) = $ssh->cmd($copy, $c); print "stdout: <<$stdout>>\n"; print "stderr: <<$stderr>>\n"; print "exit: <<$exit>>\n"; # list file (sometimes not reached) my($stdout, $stderr, $exit) = $ssh->cmd("ls -l $file"); print "stdout: <<$stdout>>\n"; print "stderr: <<$stderr>>\n"; print "exit: <<$exit>>\n"; -------------------- END ------------------- Tests: 32000 bytes: ( yes "123456789" | head -3200 ) | ./Net::SSH::Perl-scp.pl 33000 bytes: ( yes "123456789" | head -3300 ) | ./Net::SSH::Perl-scp.pl 33222 bytes: ( yes "123456789" | head -3322 ; echo 1 ) | ./Net::SSH::Perl-scp.pl 33223 bytes: ( yes "123456789" | head -3322 ; echo 12 ) | ./Net::SSH::Perl-scp.pl 63999 bytes: ( yes "123456789" | head -6399 ; echo 12345678 ) | ./Net::SSH::Perl-scp.pl 64000 bytes: ( yes "123456789" | head -6400 ) | ./Net::SSH::Perl-scp.pl 100000 bytes: ( yes "123456789" | head -10000 ) | ./Net::SSH::Perl-scp.pl 120000 bytes: ( yes "123456789" | head -12000 ) | ./Net::SSH::Perl-scp.pl 130000 bytes: ( yes "123456789" | head -13000 ) | ./Net::SSH::Perl-scp.pl 320000 bytes: ( yes "123456789" | head -32000 ) | ./Net::SSH::Perl-scp.pl 340000 bytes: ( yes "123456789" | head -34000 ) | ./Net::SSH::Perl-scp.pl
From: mike [...] semich.net
Download (untitled) / with headers
text/plain 1.3k
I ran into the same problem and found a semi-workaround for it in SSH1 mode that let things go thru. This is not to say that I found the true source of the issue, but this gets it done. Seeing at it seems to effect both SSH 1 and 2, this is a highly incomplete fix, but it leads me to believe that some interaction with IO::Select is going awry based on blowing out a buffer somewhere. in Net/SSH/Perl/SSH1.pm, line 246 there is a definition: $chunk_size = 32000; If you set this to: $chunk_size = 14400; everything goes thru just fine. I tested on the other side and it had the correct length() on the passed argument and returned just as quickly as it ever does. I traced a little further and found that the following call is blocking in sub _start_interactive: my @ready = $s->can_read; The pod for IO::Select says that "Return an array of handles that are ready for reading. TIMEOUT is the maximum amount of time to wait before returning an empty list, in seconds, possibly fractional. If TIMEOUT is not given and any handles are registered then the call will block." I gave that call a one second timeout and it cycled forever, failing the "while (!$ssh->_quit_pending) {" condition. I didn't dig deeper, but I would assume that some buffer in _quit_pending is going awry. For now, in SSH1, that one change to the chunk_size fixes the problem.
CC: cpan-contact [...] fischglas.de
Subject: Re: [rt.cpan.org #17475] Net::SSH::Perl blocks/crashes on IO-Volume > 32kB
Date: Sun, 13 Jan 2008 00:52:59 +0100
To: Michael Semich via RT <bug-Net-SSH-Perl [...] rt.cpan.org>
From: Christian Recktenwald <cpan-contact [...] fischglas.de>
Download (untitled) / with headers
text/plain 627b
Hi Michael, thanks for your reply. On Fri, Jan 11, 2008 at 04:28:21PM -0500, Michael Semich via RT wrote: Show quoted text
> > <URL: http://rt.cpan.org/Ticket/Display.html?id=17475 > > > I ran into the same problem and found a semi-workaround for it in SSH1 > mode that let things go thru.
I solved my problem using Net::SSH2 based on libssh2. This works flawless (as far as I can tell) and much faster (connecting several hundred os instances in some minutes instead of about an hour). Maybe you give that a try. :-) Kind regards, Chris -- Christian Recktenwald | elwood sys adm cpan-contact@fischglas.de |
Download .signature.gz
application/octet-stream 56b

Message body not shown because it is not plain text.

Download (untitled) / with headers
text/plain 213b
IMHO, this is also the missing rekey feature which got implemented by v1.34. Please reopen if this issue persists. Steffen -- Steffen Schwigon <ss5@renormalist.net> Dresden Perl Mongers <http://dresden-pm.org/>


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.