lalit javale
lalit javale

Reputation: 11

segmentation fault while using Net::ssh::perl module with threads

After running this program

Segmentation fault (core dumped)

Code below:

use threads;
use Net::SSH::Perl;

my $host = 'hostname';
my $user = 'root';
my $password = 'root123';

my $thread = threads->new (\&ThreadEntry,"ls");
my $thread1 = threads->new (\&ThreadEntry,"ls -al ");

sub ThreadEntry()
{
    my $ssh = Net::SSH::Perl->new($host, 35903);
    print "in ssh function \n";
    my($stdout, $stderr, $exit) =$ssh->cmd(@_);
    print "$stdout $stderr $exit\n";
}

$thread->join();
$thread1->join();

Upvotes: 1

Views: 186

Answers (1)

Oleg G
Oleg G

Reputation: 945

This is a known bug, see link below:
https://rt.cpan.org/Public/Bug/Display.html?id=62053

Upvotes: 1

Related Questions