Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hangs on ptee [rt.cpan.org #62310] #59

Open
xdg opened this issue Apr 3, 2016 · 1 comment
Open

Hangs on ptee [rt.cpan.org #62310] #59

xdg opened this issue Apr 3, 2016 · 1 comment

Comments

@xdg
Copy link
Contributor

xdg commented Apr 3, 2016

https://rt.cpan.org/Ticket/Display.html?id=62310

When installing a module within the CPAN shell, the installation hangs
if if a question is asked, other than a prerequisite question.  For
example if the user is asked to enter a path name.  After hitting return
not only does it hang but even SIGINT and SIGQUIT are ignored - the only
way out is to kill ptee which stops the installation procedure.

An example ptee command is:

sh -c /usr/bin/perl /tmp/CPAN-Reporter-CW-K9wHoWQ1  2>&1  |
/usr/bin/perl /usr/local/share/perl/5.10.1/auto/Tee/ptee  /tmp/CPAN-R...

This happens on a variety of operating systems and hardware.
@jkeenan jkeenan mentioned this issue Oct 9, 2023
@jkeenan
Copy link
Contributor

jkeenan commented Oct 9, 2023

In the original RT ticket from which this GH issue was migrated, there were additional comments which provided more data on the problem. Example:

On Wed Jul 20 13:20:27 2011, [email protected] wrote:
> Sorry, it's no better.
> 
> I set command_timeout=300 in .cpanreporter/config.ini and I get the same
> hangs on user input, e.g. it hangs on this after I hit return.
> 
> This is with 32- and 64-bit Linux on 5.12.4.
> 
> Mail-Mbox-MessageParser-1.5002/t/speed.pl
> Mail-Mbox-MessageParser-1.5002/t/stdin_compressed.t
> Mail-Mbox-MessageParser-1.5002/t/stdin_uncompressed.t
> Mail-Mbox-MessageParser-1.5002/t/Test/
> Mail-Mbox-MessageParser-1.5002/t/Test/Utils.pm
> Mail-Mbox-MessageParser-1.5002/t/undef_return_value.t
> 
>   CPAN.pm: Going to build D/DC/DCOPPIT/Mail-Mbox-MessageParser-1.5002.tar.gz
> 
> *************************************************************************** 
> NOTE: The optional module Benchmark::Timer (version 0.7100) is not
> installed.
> 
> Install Benchmark::Timer if you want to run "make speedtest"
> Enter the full path, or "none" for none.
> Where can I find your "bzip" executable? (bzip2 type) [/bin/bzip2] 
> 

Today I tried to reproduce the original problem on Linux using a threaded debugging perl built at a recent commit of blead. (I had previously installed Task::CPAN::Reporter against this perl.)

$ uname -mrs
Linux 6.2.0-33-generic x86_64
$ ./bin/perl -Ilib -v | head -2 | tail -1
This is perl 5, version 39, subversion 4 (v5.39.4 (v5.39.3-71-g148007c863)) built for x86_64-linux-thread-multi
$ ./bin/perl -Ilib -V:config_args
config_args='-des -Dusedevel -Dusethreads -Uuselongdouble -DEBUGGING=both -Dprefix=/home/jkeenan/testing/148007c8637 -Uversiononly -Dman1dir=none -Dman3dir=none';

I then used the associated cpan shell to try to install Mail-Mbox-MessageParser.

$ ./bin/cpan
...
cpan shell -- CPAN exploration and modules installation (v2.36)
Enter 'h' for help.

cpan[1]> install Mail::Mbox::MessageParser
Reading '/home/jkeenan/.cpan/Metadata'
  Database was generated on Mon, 09 Oct 2023 11:17:02 GMT
Running install for module 'Mail::Mbox::MessageParser'
...
Configuring D/DC/DCOPPIT/Mail-Mbox-MessageParser-1.5111.tar.gz with Makefile.PL
*************************************************************************** 
NOTE: The optional module Benchmark::Timer (version 0.7100) is not installed.

Install Benchmark::Timer if you want to run "make testspeed"
Use of uninitialized value $file in -x at /home/jkeenan/testing/148007c8637/lib/perl5/5.39.4/ExtUtils/MM_Unix.pm line 2899.
Enter the full path, or "none" for none.
Use of uninitialized value $file in -x at /home/jkeenan/testing/148007c8637/lib/perl5/5.39.4/ExtUtils/MM_Unix.pm line 2899.
Where can I find your "bzip" executable? (bzip2 type) [/usr/bin/bzip2] /usr/bin/bzip2
Use of uninitialized value $file in -x at /home/jkeenan/testing/148007c8637/lib/perl5/5.39.4/ExtUtils/MM_Unix.pm line 2899, <STDIN> line 1.
Where can I find your "bzip2" executable? (bzip2 type) [/usr/bin/bzip2] /usr/bin/bzip2
Where can I find your "cat" executable? [/usr/bin/cat] 
Use of uninitialized value $file in -x at /home/jkeenan/testing/148007c8637/lib/perl5/5.39.4/ExtUtils/MM_Unix.pm line 2899, <STDIN> line 3.
Where can I find your "diff" executable? [/usr/bin/diff] 
Where can I find your "gzip" executable? [/usr/bin/gzip] 
Use of uninitialized value $file in -x at /home/jkeenan/testing/148007c8637/lib/perl5/5.39.4/ExtUtils/MM_Unix.pm line 2899, <STDIN> line 5.
Where can I find your "lzip" executable? (GNU type) [none] 

At some prompts I typed in the path; at others I didn't. Either way, I didn't experience the indefinite hangs reported in the original ticket and confirmed by others over the years. Of course, I may be misunderstanding the problem. But if not, then I think this ticket is closable.

I did notice several instances of uninitialized value warnings from MakeMaker as shown above. I haven't yet analyzed them.

@chorny @nigelhorne

jkeenan added a commit to jkeenan/ExtUtils-MakeMaker that referenced this issue Oct 9, 2023
As demonstrated in
cpan-testers/CPAN-Reporter#59 (comment),
it is possible to exercise subroutine maybe_command() without a defined
argument.  We should preclude this from happening.
jkeenan added a commit to jkeenan/ExtUtils-MakeMaker that referenced this issue Oct 11, 2023
And thereby avoid uninitialized value warning.

As demonstrated in
cpan-testers/CPAN-Reporter#59 (comment),
it is possible to exercise subroutine maybe_command() without a defined
argument.  We should preclude this from happening.

Test explicitly for return value in edge cases as well as absence of warnings.
jkeenan added a commit to jkeenan/ExtUtils-MakeMaker that referenced this issue Apr 26, 2024
And thereby avoid uninitialized value warning.

As demonstrated in
cpan-testers/CPAN-Reporter#59 (comment),
it is possible to exercise subroutine maybe_command() without a defined
argument.  We should preclude this from happening.

Test explicitly for return value in edge cases as well as absence of warnings.

Simplify code per Ilmari review:
https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/pull/449/files
bingos pushed a commit to Perl-Toolchain-Gang/ExtUtils-MakeMaker that referenced this issue Nov 22, 2024
And thereby avoid uninitialized value warning.

As demonstrated in
cpan-testers/CPAN-Reporter#59 (comment),
it is possible to exercise subroutine maybe_command() without a defined
argument.  We should preclude this from happening.

Test explicitly for return value in edge cases as well as absence of warnings.

Simplify code per Ilmari review:
https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/pull/449/files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants