Skip Menu |

This queue is for tickets about the Net_SSLeay.pm CPAN distribution.

Report information
The Basics
Id: 24180
Status: resolved
Priority: 0/
Queue: Net_SSLeay.pm

People
Owner: Nobody in particular
Requestors: ANDK [...] cpan.org
Cc: imacat [...] cpan.org
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 1.30

Attachments


Subject: test suite drops a daemon running forever
From time to time I find a running process pair like this: k 18692 0.0 0.0 2956 1328 pts/4 S+ Jan01 0:00 sh -c /home/src/perl/repoperls/installed-perls/perl/prOxRQY/perl-5.8.0@29651/bin/perl -Iblib/lib -Iblib/arch -I/home/src/perl/repoperls/installed-perls/perl/prOxRQY/perl-5.8.0@29651/lib/5.9.5/i686-linux-64int -I/home/src/perl/repoperls/installed-perls/perl/prOxRQY/perl-5.8.0@29651/lib/5.9.5 -I/home/src/perl/repoperls/installed-perls/perl/prOxRQY/perl-5.8.0@29651/lib/site_perl/5.9.5/i686-linux-64int -I/home/src/perl/repoperls/installed-perls/perl/prOxRQY/perl-5.8.0@29651/lib/site_perl/5.9.5 -I. examples/sslecho.pl 1212 examples/cert.pem examples/key.pem Show quoted text
>>sslecho.log 2>&1
k 18693 0.0 0.5 10512 7812 pts/4 S+ Jan01 0:00 /home/src/perl/repoperls/installed-perls/perl/prOxRQY/perl-5.8.0@29651/bin/perl -Iblib/lib -Iblib/arch -I/home/src/perl/repoperls/installed-perls/perl/prOxRQY/perl-5.8.0@29651/lib/5.9.5/i686-linux-64int -I/home/src/perl/repoperls/installed-perls/perl/prOxRQY/perl-5.8.0@29651/lib/5.9.5 -I/home/src/perl/repoperls/installed-perls/perl/prOxRQY/perl-5.8.0@29651/lib/site_perl/5.9.5/i686-linux-64int -I/home/src/perl/repoperls/installed-perls/perl/prOxRQY/perl-5.8.0@29651/lib/site_perl/5.9.5 -I. examples/sslecho.pl 1212 examples/cert.pem examples/key.pem and then I can find the CWD of the processes with lsof: % lsof -p 18692 lsof: WARNING: can't stat() ext3 file system /dev/.static/dev Output information may be incomplete. COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME sh 18692 k cwd DIR 9,1 0 11390681 /home/k/.cpan/build/Net_SSLeay.pm-1.30-KYd1Uh (deleted) Apparently the daemon comes from Net_SSLeay-1.30. Regards,
From: imacat [...] cpan.org
Confirmed on perl 5.8.8 Linux 2.6 x86_64. It seems to be the server raised at line 97 of test.pl. It is not killed by the "kill $pid" at line 134. I cannot identify this issue further. Maybe you can check if kill successed. You may refer to the attached console log. Also, this seems to cause CPANPLUS hang, waiting for its child to die forever, if the user is running from CPANPLUS. Because several modules rely on Net_SSLeay.pm, they cannot be tested by CPAN testers for this dependency. Please tell me if I could be of any help, or if you need any more information. Thank you. imacat@rinse build/Net_SSLeay.pm-1.30 % make test 1..20 ok 1 ... ok 5tcp Spawning a SSL test server on port 1212, pid=4576... ok 5 ... All sites were successful! ok 3 imacat@rinse build/Net_SSLeay.pm-1.30 % ps ax | grep perl 4576 pts/0 S 0:00 sh -c /opt/perl/testers/bin/perl -Iblib/lib -Iblib/arch -I/home/imacat/lib/perl5 -I/opt/perl/testers/lib/5.8.8/x86_64-linux-thread-multi-ld -I/opt/perl/testers/lib/5.8.8 -I/opt/perl/testers/lib/site_perl/5.8.8/x86_64-linux-thread-multi-ld -I/opt/perl/testers/lib/site_perl/5.8.8 -I/opt/perl/testers/lib/site_perl -I. examples/sslecho.pl 1212 examples/cert.pem examples/key.pem >>sslecho.log 2>&1 4577 pts/0 S 0:00 /opt/perl/testers/bin/perl -Iblib/lib -Iblib/arch -I/home/imacat/lib/perl5 -I/opt/perl/testers/lib/5.8.8/x86_64-linux-thread-multi-ld -I/opt/perl/testers/lib/5.8.8 -I/opt/perl/testers/lib/site_perl/5.8.8/x86_64-linux-thread-multi-ld -I/opt/perl/testers/lib/site_perl/5.8.8 -I/opt/perl/testers/lib/site_perl -I. examples/sslecho.pl 1212 examples/cert.pem examples/key.pem imacat@rinse build/Net_SSLeay.pm-1.30 %
Dear Florian Ragwitz, Hi. This is imacat from Taiwan. I have made more tests. It seems that this keep-running daemon is this "SSL test server on port 1212" in test.pl line 98, and is the cause that CPANPLUS hangs waiting for. Once I kill it CPANPLUS returns. Further investigation reveals that: "kill $pid" is not working at test.pl line 134. According to the perlfunc(1) documentation http://perldoc.perl.org/functions/kill.html It show that "kill 15, $pid" should be used instead of "kill $pid". You omitted the kill signal and Perl treats $pid as the signal with an empty process ID list. I have make some tests. After changing "kill $pid" to "kill 15, $pid" that daemon is killed, and CPANPLUS returns as usual when tests finish. There seem to be still another daemon running, with a PID next to that one. I don't quite understand yet. I attached a simple patch that may solve this issue, in the hope that it helps. Please tell me if I could be of any help, or if you need any more information. Thank you. -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 diff -u -r Net_SSLeay.pm-1.30.orig/test.pl Net_SSLeay.pm-1.30/test.pl - --- Net_SSLeay.pm-1.30.orig/test.pl 2005-12-01 10:20:34.000000000 +0800 +++ Net_SSLeay.pm-1.30/test.pl 2007-03-28 03:57:05.000000000 +0800 @@ -131,7 +131,7 @@ print "\t\t...took $secs secs (" . int($mb*1024/$secs). " KB/s)\n" if $trace; print &test(10, ($res =~ /OK\s*$/)); - -kill $pid; # We don't need that server any more +kill 15, $pid; # We don't need that server any more if ($exe_path !~ /\.exe$/i) { # Not Windows where fork does not work $res = `$perl examples/cli-cert.pl $cert_pem $key_pem examples`; -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQFGCXcmi9gubzC5S1wRAvSiAJsFgLm/Cm5CyCsGqdhD7C5CY5r3pwCdFePd OP+TVUtPMeo6l/lyMMuOhXk= =i+fU -----END PGP SIGNATURE-----
Download Net_SSLeay.pm-1.30-kill.diff.asc
application/octet-stream 835b

Message body not shown because it is not plain text.

because I find downloading of patches from RT.cpan.org more than inconvenient I uploaded this patch to CPAN as ANDK/patches/Net_SSLeay.pm-1.30-IMACAT-01.patch.gz Thanks, imacat, your patch works like a charm. andreas