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

shell: sh good shell: csh good shell: bash good shell: tcsh good shell: ksh good shell: dash shell: ash shell: pdksh shell: mksh shell: zsh good shell: fish -bash-3.2$

Replies are listed 'Best First'.
Re^7: Cpan install gets stuck installing Net OpenSSH ?
by syphilis (Archbishop) on Mar 13, 2016 at 00:55 UTC
    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
      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);
        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.