in reply to Re^6: Cpan install gets stuck installing Net OpenSSH ?
in thread Cpan install gets stuck installing Net OpenSSH ?

Working directory is /usr/local/home/myuser/.cpan/build/Net-OpenSSH-0.70-ARY6NC

Try cd'ing to that directory, and then run:
perl -Mblib t/quoting.t
If that hangs, kill the process (Ctrl-C) and start inserting some print statements in t/quoting.t to see how far into the script you get before it hangs.
Then we'll know precisely what function call is hanging - and you might even be able to insert some print statements into that function to more precisely locate the hang.

If, for example, you find that the hang occurs in the shell_is_clean function (at about line 29 of t/quoting.t) you could stick print statements within that function (which is found in t/common.pm) to further narrow it down.

Cheers,
Rob

Replies are listed 'Best First'.
Re^8: Cpan install gets stuck installing Net OpenSSH ?
by jtzako (Sexton) on Mar 15, 2016 at 17:16 UTC
    I put in some prints and found where it stops. I put a print right before and after this line and it prints the one before but not the one after: my @shells = grep try_shell($_), qw(sh csh bash tcsh ksh dash ash pdksh mksh zsh fish);
      Here I put some prints inside the 'try_shell' sub:
      sub try_shell { my $shell = shift; print "line 1\n"; my $out = eval { capture($shell, '-c', 'echo good') }; print "line 2\n"; if ($out and $out =~ /^good$/) { print "line 3\n"; if ($shell =~ /ksh/) { print "line 4\n"; if (defined (my $version = eval { `$shell --version 2>&1` +})) { print "line 5\n"; if ($version =~ /version\s+sh\s+\(AT\&T\s+Research\)/) + { diag "skipping tests for broken AT&T ksh shell!"; return undef; } } } print "line 6\n"; if ($shell eq '!!fish') { diag "TODO: add support for fish shell!"; return undef; } return 1; } return undef; }
      This is the result:
      -bash-3.2$ sudo perl -Mblib t/quoting.t line 1 line 2 line 3 line 6 line 1 line 2 line 3 line 6 line 1 line 2 line 3 line 6 line 1 line 2 line 3 line 6 line 1 line 2 line 3 line 4 ^C
      I think it makes it through the first 4 shells then gets stuck on the 5th. I think ksh is the 5th one based on the line that calls the sub:
      my @shells = grep try_shell($_), qw(sh csh bash tcsh ksh dash ash pdks +h mksh zsh fish);
        Ah, it seems that the command hanging is ksh --version.

        Until now, all the shells I have checked printed its version or just thrown an error when called with that argument, but it seems you have found one behaving differently.

        Could you give us a bit more detail about your operating system vendor and version, and if possible about the ksh available there?

      Hmm, it is estrange because when you tested the shells by hand no one did hang...

      Could you continue with your instrumentation inside the function try_shell? You will find it around the middle of the file.

        I removed 'ksh' from the list and the t/quoting.t completes properly.

        I dont know if this would be a problem for the installation that calls t/quoting.t in the first place.