in reply to Re: Segmentation faults with Net::OPenSSH.pm
in thread Segmentation faults with Net::OPenSSH.pm

We narrowed down issue due to stale OpenSSH handles.. basically we create subprocess' inside our modules in different threads and each sub-process in turn creates a new ssh connection... so there could be multiple ssh handles to the same hosts..we were not properly cleaning up the ssh handles.. so when we exit we see SEGV.. cleaning up ssh handles seems to be resolve these to some extent. is this expected with OpenSSH module?
  • Comment on Re^2: Segmentation faults with Net::OPenSSH.pm

Replies are listed 'Best First'.
Re^3: Segmentation faults with Net::OPenSSH.pm
by salva (Canon) on May 20, 2016 at 06:11 UTC
    Thread support in Perl 5.8 was quite immature. You are probably triggering some bug there.
      Thanks Salva. is doing undef on OpenSSH.pm is the correct way to destroy ssh handle ('undef Net::OpenSSH')
        You have to undefine all the variables pointing to the object. For instance:
        my $ssh = Net::OpenSSH->new(...); ... undef $ssh;

        You can also call the disconnect method explicitly:

        $ssh->disconnect;