Subject: | 30_loops/50_tk/comp_tcp_concurrent.t hangs on FreeBSD-6.2 |
The test 30_loops/50_tk/comp_tcp_concurrent.t hangs on my FreeBSD-6.2
system with perl 5.8.8 and perl 5.10.0. I tried it with Tk-804.027 and
Tk-804.028, neither worked.
Looking with truss at the hanging process there is an endless fast loop
doing select() calls. I experimented a little bit with
comp_tcp_concurrent.pm and found that by lowering the count of clients
from 21 to 9 (see attached patch) the test worked.
I am not sure what part of my system is causing the problem. I can
reproduce the problem with this Tk script.
#!perl
use Tk;
my @fh;
my $mw = tkinit;
for (1..31) { # 30 is fine, 31 is causing problems
warn $_;
open my $dup, "<&STDIN" or die $!;
push @fh, $dup;
$mw->fileevent($dup, "readable", sub { });
}
warn "truss -p $$\n";
MainLoop;
__END__
Here I also observe the fast loop doing select() calls.
It could be that it's the fault of FreeBSD, or a (undocumented?) limit
in Tk. I'll investigate. In the meanwhile, I propose to lower the number
of clients in this test at least for this configuration, that is $^O eq
'freebsd', $Config{osvers} =~ m{^6\.}, $Tk::VERSION >= 804.
Regards,
Slaven
Subject: | POE-comp_tcp_concurrent.patch |
#
#
# To apply this patch:
# STEP 1: Chdir to the source directory.
# STEP 2: Run the 'applypatch' program with this patch file as input.
#
# If you do not have 'applypatch', it is part of the 'makepatch' package
# that you can fetch from the Comprehensive Perl Archive Network:
# http://www.perl.com/CPAN/authors/Johan_Vromans/makepatch-x.y.tar.gz
# In the above URL, 'x' should be 2 or higher.
#
# To apply this patch without the use of 'applypatch':
# STEP 1: Chdir to the source directory.
# STEP 2: Run the 'patch' program with this file as input.
#
#### End of Preamble ####
#### Patch data follows ####
diff -up '../build/POE-0.9999-uoIvha/t/30_loops/00_base/comp_tcp_concurrent.pm' 'POE-0.9999/t/30_loops/00_base/comp_tcp_concurrent.pm'
Index: ./t/30_loops/00_base/comp_tcp_concurrent.pm
Prereq: 1971
--- ./t/30_loops/00_base/comp_tcp_concurrent.pm Thu Nov 2 21:22:01 2006
+++ ./t/30_loops/00_base/comp_tcp_concurrent.pm Tue Jan 1 18:41:49 2008
@@ -17,7 +17,11 @@ BEGIN {
}
}
-use Test::More tests => (42);
+my $NO_CLIENTS;
+BEGIN { $NO_CLIENTS = 21 }
+#BEGIN { $NO_CLIENTS = 9 } # 9 is the last working count on my FreeBSD system
+
+use Test::More tests => ($NO_CLIENTS*2);
diag( "You might see a 'disconnect' error during this test." );
diag( "It may be ignored." );
@@ -179,7 +183,7 @@ sub do_servers {
}
sub do_clients {
- foreach my $N (1..21) {
+ foreach my $N (1..$NO_CLIENTS) {
DEBUG and warn "$$: SPAWN\n";
two_clients($N);
}
@@ -214,7 +218,7 @@ sub two_clients {
ServerInput => sub {
my ($heap, $input) = @_[HEAP, ARG0];
DEBUG and warn("$$: acceptor client $N got input ($input)");
- if( $input =~ /#21$/ ) {
+ if( $input =~ /#$NO_CLIENTS$/ ) {
$_[HEAP]->{server}->put( 'quit' );
}
@@ -259,7 +263,7 @@ sub two_clients {
ServerInput => sub {
my ($heap, $input) = @_[HEAP, ARG0];
DEBUG and warn("$$: callback client $N got input ($input)");
- if( $input =~ /#21$/ ) {
+ if( $input =~ /#$NO_CLIENTS$/ ) {
$_[HEAP]->{server}->put( 'quit' );
}
$_[KERNEL]->yield('shutdown');
#### End of Patch data ####
#### ApplyPatch data follows ####
# Data version : 1.0
# Date generated : Tue Jan 1 18:42:02 2008
# Generated by : makepatch 2.03
# Recurse directories : Yes
# Excluded files : (\A|/).*\~\Z
# (\A|/).*\.a\Z
# (\A|/).*\.bak\Z
# (\A|/).*\.BAK\Z
# (\A|/).*\.elc\Z
# (\A|/).*\.exe\Z
# (\A|/).*\.gz\Z
# (\A|/).*\.ln\Z
# (\A|/).*\.o\Z
# (\A|/).*\.obj\Z
# (\A|/).*\.olb\Z
# (\A|/).*\.old\Z
# (\A|/).*\.orig\Z
# (\A|/).*\.rej\Z
# (\A|/).*\.so\Z
# (\A|/).*\.Z\Z
# (\A|/)\.del\-.*\Z
# (\A|/)\.make\.state\Z
# (\A|/)\.nse_depinfo\Z
# (\A|/)core\Z
# (\A|/)tags\Z
# (\A|/)TAGS\Z
# (\A|/)lib\/POE\/Loop\/TkCommon\.pm\Z
# p 't/30_loops/00_base/comp_tcp_concurrent.pm' 8105 1199209309 0100644
#### End of ApplyPatch data ####
#### End of Patch kit [created: Tue Jan 1 18:42:02 2008] ####
#### Patch checksum: 80 2852 54143 ####
#### Checksum: 98 3476 40133 ####