Plantir56 has asked for the wisdom of the Perl Monks concerning the following question:

Hi, we are hitting random segfaults with Net::OpenSSH.pm version 0.70 and perl 5.8.8. the segv happens sometimes while creating ssh session and sometimes destroying openssh object. we use openssh version OpenSSH_6.2p2 Ubuntu-6. The system creates multiple ssh sessions to the hosts.. here is one such backtrace.. HandleSEGVSignal('SEGV') called at ../Net/OpenSSH.pm line 345 eval {...} called at ../Net/OpenSSH.pm line 345

  • Comment on Segmentation faults with Net::OPenSSH.pm

Replies are listed 'Best First'.
Re: Segmentation faults with Net::OPenSSH.pm
by salva (Canon) on May 18, 2016 at 08:26 UTC
    Net::OpenSSH is a pure perl module, so a SIGSEGV probably means a bug in the perl interpreter.

    Even if you are using an old version of Perl, the module is known to work there, so either you have some custom perl configuration or you are doing something unusual in your code.

    Post the output of perl -V and the source for your script. A strace capture may also help and a backtrace obtained with gdb at the point where the exception is raised.

      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?
        Thread support in Perl 5.8 was quite immature. You are probably triggering some bug there.
Re: Segmentation faults with Net::OPenSSH.pm
by hippo (Archbishop) on May 18, 2016 at 08:31 UTC
    HandleSEGVSignal('SEGV') called at ../Net/OpenSSH.pm line 345

    It's a little surprising to see a relative path in there. Did you install Net::OpenSSH in some unusual way? Why is it not in a standard location?