Subject: | Net:::SSH::Expect fails if perl threads are running |
In the attached example, the script completes without error if the
worker thread is not started. [Try changing the "if (1)" to "if (0)" to
demonstrate]. If the thread is started, it fails with
"SSHConnectionAborted"
This has been seen on
v5.8.5 built for i386-linux-thread-multi
pre-installed on Centos 4.4
as well as on
This is perl, v5.8.7 built for x86_64-linux-gnu-thread-multi
(with 1 registered patch, see perl -V for more detail)
from Ubuntu 6.06.1 _Dapper Drake_ - Release amd64
Subject: | tbug.pl |
use strict;
use threads;
use Net::SSH::Expect;
my $w;
if (1) {
$w = threads->new(\&worker,{foo => 'bar'})
or die("thread creation failed");
}
my $t = new Net::SSH::Expect(
host => "myhost",
user => "myuser",
password => "mypassword",
timeout => 5,
raw_pty => 1
);
print "start login\n";
my $lo = $t->login();
print "end login\n";
sub worker {
while (1) {
sleep 10;
}
};