toddr / Net-Daemon

Read-only release history for Net-Daemon
http://metacpan.org/release/Net-Daemon
0 stars 0 forks source link

forkm test hangs for Solaris 8 [rt.cpan.org #18112] #10

Closed toddr closed 3 years ago

toddr commented 3 years ago

Migrated from rt.cpan.org#18112 (status was 'open')

Requestors:

From on 2006-03-10 22:25:42 :

test Net-Daemon-0.39 hangs and never returns when it attempts
the forkm test.   This is for perl 5.8.3 sun4-solaris-thread-multi
under Solaris 8 (SunOS 5.8) with the latest recommended
and security patches (March 2006) installed.  I have
Net::Daemon 0.38 installed and had no problem when it
was installed.

(I couldn't choose 0.39 from the 'Broken in' menu above
since it only lists up to 0.38)

From on 2006-03-27 12:29:54 :

Experiencing the same problem on a Solaris9 platform

From on 2006-04-24 15:45:29 :


I'm seeing the same behavior on Solaris 10 x86

From on 2006-04-24 19:10:34 :

On Mon Apr 24 11:45:29 2006, guest wrote:
> 
> I'm seeing the same behavior on Solaris 10 x86

I'm seeing it on Solaris 2.8 Sparc, with a new
perl 5.8.8 (no threads).

From on 2006-04-24 20:31:21 :

On Mon Apr 24 15:10:34 2006, guest wrote:
> On Mon Apr 24 11:45:29 2006, guest wrote:
> > 
> > I'm seeing the same behavior on Solaris 10 x86
> 
> 
> I'm seeing it on Solaris 2.8 Sparc, with a new
> perl 5.8.8 (no threads).
> 

I'm getting the same behavior on Sparc Solaris 2.8 with perl
5.8.8...both with and without threads.

From m.nooning@comcast.net on 2007-05-23 12:55:58 :

It has been a long time since you reported this.  Sorry about that.

If you are still interested, try Net-Daemon/Net-Daemon-0.40.tar.gz which
is now on CPAN.  The fixes were not about the problem you are reporting,
but since then Perl and Net-Daemon have changed some.

From feldt@nhn.ou.edu on 2007-05-23 17:52:22 :

I just tested Version 0.40 on Solaris 8, perl 5.8.8/sun4-solaris-thread-multi
and the test still hangs at forkm.

From mnooning@cpan.org on 2007-05-23 18:04:09 :

A Solaris tester.  Outstanding!

Please do me a favor and test version 0.41.  I just submitted it today.
 I see it is now on CPAN.

Otherwise, in t/forkm.t --> sub CatchChild, change the "if (keys .."
line to match what is below and test again.

                if (keys(%childs) == 0) {
                    # We ae done when the last of our ten childs are gone.
                    ShowResults();
                    last;
                }

Thanks

From feldt@nhn.ou.edu on 2007-05-24 17:43:08 :

I just tested version 0.41 on Solaris 8, perl 5.8.8/sun4-solaris-thread-multi
with the same hang on the forkm test.  I edited forkm.t to set $debug = 1
and ran the test again.  The forkm.log file contained only:

13228: Start
13229: END: -> handle=undef
13229: END: <-

and this was there before I hit ^C to end the test when it hung.

From m.nooning@comcast.net on 2007-05-25 14:52:33 :

Please use the forkm.t file pasted below.  It is the same one you have,
but sprinkled with print statements.
---------------------------------paste forkm.t with print statements
# -*- perl -*-
#

require 5.004;
use strict;
use IO::Socket ();
use Config ();
use Net::Daemon::Test ();
use Fcntl ();
use Config ();

my $debug = 1;
my $dh;
if ($debug) {
    $dh = Symbol::gensym(); print STDERR ("16: pid $$, ref dh is :",
ref($dh), "\n");
    open($dh, ">", "forkm.log") or die "Failed to open forkm.log: $!";
}

sub log($) {
    my $msg = shift; print STDERR ("21: $$ msg is $msg:\n");
    print $dh "$$: $msg\n" if $dh;
}

&log("Start");
my $ok;
eval {
  if ($^O ne "MSWin32") {
    my $pid = fork();
    if (defined($pid)) {
      if (!$pid) {print STDERR ("31: child $$ is about to exit\n"); exit
0; } # Child
    }
    $ok = 1;
  }
};
if (!$ok) {
  &log("!ok");
  print "1..0\n";
  exit;
}

$| = 1;
$^W = 1;

my($handle, $port);
if (@ARGV) {
    $port = shift @ARGV; print STDERR ("\n49: port $port\n");
} else {
    ($handle, $port) = Net::Daemon::Test->Child
    (10, $^X, '-Iblib/lib', '-Iblib/arch', 't/server',
     '--mode=fork', 'logfile=stderr', 'debug');  print STDERR ("\n53: port
$port\n");
}

sub IsNum {
    my $str = shift;
    (defined($str)  &&  $str =~ /(\d+)/) ? $1 : undef;
}

sub ReadWrite {
    my $fh = shift; my $i = shift; my $j = shift;
    &log("ReadWrite: -> fh=$fh, i=$i, j=$j");
    if (!$fh->print("$j\n")  ||  !$fh->flush()) {
    die "Child $i: Error while writing $j: " . $fh->error() . " ($!)";
    }
    my $line = $fh->getline();
    &log("ReadWrite: line=$line");
    die "Child $i: Error while reading: " . $fh->error() . " ($!)"
    unless defined($line); print STDERR ("72: Did not die\n");
    my $num;
    die "Child $i: Cannot parse result: $line"
    unless defined($num = IsNum($line)); print STDERR ("75: Did not die\n");
    die "Child $i: Expected " . ($j*2) . ", got $num"
    unless $j*2 == $num; print STDERR ("77: Did not die\n");
    &log("ReadWrite: <-"); print STDERR ("78: after log ReadWrite\n");
}

sub MyChild {
    my $i = shift;

    &log("MyChild: -> $i");

    eval {
    my $fh = IO::Socket::INET->new('PeerAddr' => '127.0.0.1',
                       'PeerPort' => $port);
    if (!$fh) {
        &log("MyChild: Cannot connect: $!");
        die "Cannot connect: $!";
    }
    for (my $j = 0;  $j < 1000;  $j++) {
        ReadWrite($fh, $i, $j);
    }
    };
    if ($@) {
    print STDERR "Client: Error $@\n";
    &log("MyChild: Client: Error $@");
    return 0;
    }
    &log("MyChild: <-");
    return 1;
}

sub ShowResults {
    &log("ShowResults: ->");
    my @results;
    for (my $i = 1;  $i <= 10;  $i++) {
    $results[$i-1] = "not ok $i\n";
    }
    if (open(LOG, "<log")) {
    while (defined(my $line = <LOG>)) {
        if ($line =~ /(\d+)/) {
        $results[$1-1] = $line;
        }
    }
    }
    for (my $i = 1;  $i <= 10;  $i++) {
    print $results[$i-1];
    }
    &log("ShowResults: <-");
    exit 0;
}

my %childs;
sub CatchChild {
    &log("CatchChild: ->");
    for(;;) {
    my $pid = wait;
    if ($pid > 0) {
        &log("CatchChild: $pid");
        if (exists $childs{$pid}) {print STDERR ("135: childs $pid is :",
$childs{$pid}, "\n");
        delete $childs{$pid};
                if (keys(%childs) == 0) {
                    # We ae done when the last of our ten childs are gone.
                    ShowResults();
                    last;
        }
        }
    }
    }
    $SIG{'CHLD'} = \&CatchChild;
    &log("CatchChild: <-");
}
$SIG{'CHLD'} = \&CatchChild;

# Spawn 10 childs, each of them running a series of test
unlink "log";
&log("Spawning childs");
for (my $i = 0;  $i < 10;  $i++) {
    if (defined(my $pid = fork())) {
    if ($pid) {
        # This is the parent
        $childs{$pid} = $i; print STDERR ("157: $$ Created childs $pid\n");
    } else {print STDERR ("158: pid $$\n");
        &log("Child starting");
        # This is the child
        undef $handle;
        %childs = ();
        my $result = MyChild($i);
        my $fh = Symbol::gensym(); print STDERR ("164: ref fh is :",
ref($fh), ":\n"); 
        if (!open($fh, ">>log")  ||  !flock($fh, 2)  ||
        !seek($fh, 0, 2)  ||
        !(print $fh (($result ? "ok " : "not ok "), ($i+1), "\n"))  ||
        !close($fh)) {
        print STDERR "Error while writing log file: $!\n";
        exit 1;
        }
        exit 0;
    }
    } else {
    print STDERR "Failed to create new child: $!\n";
    exit 1;
    }
}

my $secs = 120;
while ($secs > 0) {
    $secs -= sleep $secs;
}

END {
    &log("END: -> handle=" . (defined($handle) ? $handle : "undef"));
    if ($handle) { print STDERR ("\n187 handle $handle\n");
    $handle->Terminate();
    undef $handle;
    }
    while (my($var, $val) = each %childs) { print STDERR ("\n191:
killing child $var and val is $val\n");
    kill 'TERM', $var;
    }
    %childs = ();
    unlink "ndtest.prt";
    &log("END: <-");
    exit 0;
}

From feldt@nhn.ou.edu on 2007-05-25 15:46:46 :

Using the forkm.t variant with print statements yields:

$ gmake test
PERL_DL_NONLAZY=1 /usr/local/bin/perl "-MExtUtils::Command::MM" "-e" 
"test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/base..........ok
t/config........ok
t/fork..........ok
t/forkm.........16: pid 18566, ref dh is :GLOB
21: 18566 msg is Start:
31: child 18567 is about to exit
21: 18567 msg is END: -> handle=undef:
21: 18567 msg is END: <-:

53: port
34214
21: 18566 msg is CatchChild: ->:
21: 18566 msg is CatchChild: 18567:
^Cgmake: *** [test_dynamic] Error 130
$

where the ^C is typed after the hang has occurred.
The forkm.log file contains (as before):

18566: Start
18567: END: -> handle=undef
18567: END: <-

From m.nooning@comcast.net on 2007-05-25 20:22:17 :

> 53: port
> 34214
Your results make it look like $port has a newline character embedded as
the first character of $port.  I suspect that it might be a
typographical error on your part.

Please double check that line 53 ends with the print statement below.  I
added the two colons around $port, as you see, just to double check.

 print STDERR ("\n53: port :$port:\n");

It could be true that Net::Daemon::Test is returning a $port that has a
newline character embedded as the first character, but before I go
digging, please do the double check.

Thanks

From feldt@nhn.ou.edu on 2007-05-26 01:00:17 :

The newline was my fault for simply using cut-and-paste to generate
your version of the file.  So, ignore that newline from my output.
I looked at the file and do not see any other line wraps that would
have affected output or running of the code.

From feldt@nhn.ou.edu on 2007-05-26 02:02:54 :

It occurred to me that I ought to try actually running the test
with the correction.  The first time, it ran through to completion (!)
generating a lot of output (and indidicating it had failed only
the forkm.t test).  So, I wanted to save this in a file and
tried:  gmake test > test.txt 2>&1

This, however, hung as before with a small amount of output in
test.txt.  So I did some experimenting.  I found that every time I
tried to redirect stdout and stderr the test hung.  Even more oddly,
I found that running just a 'gmake test' hangs about 1/2 the time
and runs to completion the rest.

I am including the gist of one that completed.  I don't have a
way to catch the beginning (my terminal buffer from home right
now is not large enough), but the screen receives sets (presumably
1000) of:

:
72: Did not die
75: Did not die
77: Did not die
21: 19093 msg is ReadWrite: <-:
78: after log ReadWrite
21: 19093 msg is ReadWrite: -> fh=IO::Socket::INET=GLOB(0x3a5b38), i=0, j=756:
21: 19093 msg is ReadWrite: line=1512

with 'j=756' incrementing by one each time and 'line=1512' incrementing
by two each time.  It ends with:

72: Did not die
75: Did not die
77: Did not die
21: 19093 msg is ReadWrite: <-:
78: after log ReadWrite
21: 19093 msg is ReadWrite: -> fh=IO::Socket::INET=GLOB(0x3a5b38), i=0, j=999:
21: 19093 msg is ReadWrite: line=1998
:
72: Did not die
75: Did not die
77: Did not die
21: 19093 msg is ReadWrite: <-:
78: after log ReadWrite
21: 19093 msg is MyChild: <-:
164: ref fh is :GLOB:
21: 19093 msg is END: -> handle=undef:
21: 19093 msg is END: <-:
21: 19090 msg is CatchChild: 19093:
135: childs 19093 is :0
21: 19090 msg is ShowResults: ->:
21: 19090 msg is ShowResults: <-:
21: 19090 msg is END: -> handle=Net::Daemon::Test::Fork=SCALAR(0x38603c):

187 handle Net::Daemon::Test::Fork=SCALAR(0x38603c)
21: 19090 msg is END: <-:
t/forkm.........FAILED tests 2-10                                            
    Failed 9/10 tests, 10.00% okay
t/ithread.......Perl exited with active threads:
    0 running and unjoined
    1 finished and unjoined
    0 running and detached
t/ithread.......ok                                                           
t/ithreadm......ok                                                           
t/loop-child....ok                                                           
t/loop..........ok                                                           
t/single........ok                                                           
t/thread........skipped
    all skipped: no reason given
t/threadm.......ok                                                           
t/unix..........ok                                                           
Failed Test Stat Wstat Total Fail  List of Failed
-------------------------------------------------------------------------------
t/forkm.t                 10    9  2-10
1 test skipped.
Failed 1/12 test scripts. 9/68 subtests failed.
Files=12, Tests=68, 74 wallclock secs ( 6.75 cusr +  1.94 csys =  8.69 CPU)
Failed 1/12 test programs. 9/68 subtests failed.
gmake: *** [test_dynamic] Error 29

The forkm.log file begins with:

19090: Start
19091: END: -> handle=undef
19091: END: <-
19090: Spawning childs
19093: Child starting
19093: MyChild: -> 0
19093: ReadWrite: -> fh=IO::Socket::INET=GLOB(0x3a5b38), i=0, j=0
19093: ReadWrite: line=0

19093: ReadWrite: <-
19093: ReadWrite: -> fh=IO::Socket::INET=GLOB(0x3a5b38), i=0, j=1
19093: ReadWrite: line=2

and continues in this vein as well, ending with:

19093: ReadWrite: <-
19093: ReadWrite: -> fh=IO::Socket::INET=GLOB(0x3a5b38), i=0, j=999
19093: ReadWrite: line=1998

19093: ReadWrite: <-
19093: MyChild: <-
19093: END: -> handle=undef
19093: END: <-
19090: CatchChild: ->
19090: CatchChild: 19091
19090: CatchChild: 19093
19090: ShowResults: ->
19090: ShowResults: <-
19090: END: -> handle=Net::Daemon::Test::Fork=SCALAR(0x38603c)
19090: END: <-

From m.nooning@comcast.net on 2007-06-02 16:33:04 :

I did not realize until your reply that you would get up to 10,000 debug
prints from sub ReadWrite alone.  I changed the debug statements in sub
ReadWrite to only print to STDERR upon failure.  I also made other debug
print changes.

Please rerun forkm.t, this time using the one pasted below.  There
should only be a hundred lines or so.  From the Net-Daemon directory,
please run

perl -Mblib t/forkm.t

on Solaris and post the results.

Thanks
------------------------paste forkm.t
# -*- perl -*-
#

require 5.004;
use strict;
use IO::Socket ();
use Config ();
use Net::Daemon::Test ();
use Fcntl ();
use Config ();

my $debug = 1;
my $dh;
if ($debug) {
    $dh = Symbol::gensym();
    print STDERR (__LINE__, ": pid $$, ref dh is :", ref($dh), "\n");
    open($dh, ">", "forkm.log") or die "Failed to open forkm.log: $!";
}

sub log($) {
    my $msg = shift; print STDERR (__LINE__, ": $$ msg is $msg:\n");
    print $dh "$$: $msg\n" if $dh;
}

&log("Start");
my $ok;
eval {
  if ($^O ne "MSWin32") {
    my $pid = fork();
    if (defined($pid)) {
      if (!$pid) {
        # Child
        print STDERR (__LINE__, ": child $$ is about to exit\n");
        exit 0;
      } 
    }
    $ok = 1;
  }
};
if (!$ok) {
  &log("!ok");
  print "1..0\n";
  exit;
}

$| = 1;
$^W = 1;

my($handle, $port);
if (@ARGV) {
    $port = shift @ARGV; print STDERR ("\n", __LINE__, ": port $port\n");
} else {
    ($handle, $port) = Net::Daemon::Test->Child
    (10, $^X, '-Iblib/lib', '-Iblib/arch', 't/server',
     '--mode=fork', 'logfile=stderr', 'debug');
     print STDERR ("\n", __LINE__, ": port :$port:\n");
}

sub IsNum {
    my $str = shift;
    (defined($str)  &&  $str =~ /(\d+)/) ? $1 : undef;
}

# $i is 1 to 10, $j is 9..999
sub ReadWrite {
    my $fh = shift; my $i = shift; my $j = shift;
    &log("ReadWrite: -> fh=$fh, i=$i, j=$j");
    if (!$fh->print("$j\n")  ||  !$fh->flush()) {
        print STDERR (__LINE__, ": $$  :$i: :$j: Could not fh->print\n");
    die "Child $i: Error while writing $j: " . $fh->error() . " ($!)";
    }
    my $line = $fh->getline();
    if (!defined($line) ) {
      print STDERR (__LINE__, ": $$ :$i: :$j: The line is NOT defined\n");
      die "Child $i: Error while reading: " . $fh->error() . " ($!)";
    } else {
      &log("ReadWrite: line=$line");
    }

    my $num;
    if (!defined($num = IsNum($line))) { 
      print STDERR (__LINE__, ": $$ :$i: :$j: num  = IsNum is not
defined\n");
      die "Child $i: Cannot parse result: $line";
    }
    if (!($j*2 == $num)) {
      print STDERR (__LINE__, ": $$ :$i: :$j: j*2 ", $j*2, " is not
$num\n");
      die "Child $i: Expected " . ($j*2) . ", got $num";
    }
    &log("ReadWrite: <-");
}

sub MyChild {
    my $i = shift; # $i will be 1 to 10

    &log("MyChild: -> $i");

    eval {
    my $fh = IO::Socket::INET->new('PeerAddr' => '127.0.0.1',
                       'PeerPort' => $port);
        print STDERR (__LINE__, ": PeerPort :$port:\n");
    if (!$fh) {
            print STDERR (__LINE__, ": No fh, cannot connect: $!\n");
        &log("MyChild: Cannot connect: $!");
        die "Cannot connect: $!";
    }
    for (my $j = 0;  $j < 1000;  $j++) {
        ReadWrite($fh, $i, $j);
    }
    };
    if ($@) {
    print STDERR (__LINE__, "Client: Error $@\n");
    &log("MyChild: Client: Error $@");
    return 0;
    }
    &log("MyChild: <-");
    print STDERR (__LINE__, ": PeerPort :$port:\n");

    return 1;
}

sub ShowResults {
    &log("ShowResults: ->");
    my @results;
    for (my $i = 1;  $i <= 10;  $i++) {
    $results[$i-1] = "not ok $i\n";
    }
    if (open(LOG, "<log")) {
    while (defined(my $line = <LOG>)) {
        if ($line =~ /(\d+)/) {
        $results[$1-1] = $line;
        }
    }
    }
    for (my $i = 1;  $i <= 10;  $i++) {
    print $results[$i-1];
    }
    &log("ShowResults: <-");
    exit 0;
}

my %childs;
sub CatchChild {
    &log("CatchChild: ->");
    for(;;) {
    my $pid = wait;
    if ($pid > 0) {
        &log("CatchChild: $pid");
        if (exists $childs{$pid}) {
                print STDERR (__LINE__, ": childs $pid is :",
$childs{$pid}, "\n");
        delete $childs{$pid};
                if (keys(%childs) == 0) {
                    print STDERR (__LINE__, ": \%childs is 0\n");
                    # We ae done when the last of our ten childs are gone.
                    ShowResults();
                    print STDERR (__LINE__, ": \n");
                    last;
        } else {
                    print STDERR (__LINE__, ": Should see this nine
times\n");
                }
        }
    }
    }
    print STDERR (__LINE__, ": No more childs\n");
    $SIG{'CHLD'} = \&CatchChild;
    &log("CatchChild: <-");
}
$SIG{'CHLD'} = \&CatchChild;

# Spawn 10 childs, each of them running a series of test
unlink "log";
&log("Spawning childs");
for (my $i = 0;  $i < 10;  $i++) {
    if (defined(my $pid = fork())) {
    if ($pid) {
        # This is the parent
        $childs{$pid} = $i;
            print STDERR (__LINE__, ": $$ Created childs $pid\n");
    } else {
            print STDERR (__LINE__, ": pid $$\n");
        &log("Child starting");
        # This is the child
        undef $handle;
        %childs = ();
        my $result = MyChild($i);
        my $fh = Symbol::gensym();
            print STDERR (__LINE__, ": ref fh is :", ref($fh), ":\n"); 
        if (!open($fh, ">>log")  ||  !flock($fh, 2)  ||
        !seek($fh, 0, 2)  ||
        !(print $fh (($result ? "ok " : "not ok "), ($i+1), "\n"))  ||
        !close($fh)) {
        print STDERR (__LINE__, "Error while writing log file: $!\n");
        exit 1;
        }
        exit 0;
    }
    } else {
    print STDERR (__LINE__, "Failed to create new child: $!\n");
    exit 1;
    }
}

my $secs = 120;
while ($secs > 0) {
    $secs -= sleep $secs;
}

END {
    &log("END: -> handle=" . (defined($handle) ? $handle : "undef"));
    if ($handle) {
        print STDERR ("\n", __LINE__, " handle $handle\n");
    $handle->Terminate();
    undef $handle;
    }
    while (my($var, $val) = each %childs) {
        print STDERR ("\n", __LINE__, ": killing child $var and val is
$val\n");
    kill 'TERM', $var;
    }
    %childs = ();
    unlink "ndtest.prt";
    &log("END: <-");
    exit 0;
}

From feldt@nhn.ou.edu on 2007-06-04 18:53:48 :

Ok, I have run the latest forkm test as indicated.  I ran it 20 times obtaining
two different failure modes (meaning the test hung at the end) and two
different success modes (meaning I got a prompt back).  These can be categorized
by the appearance of lines like:

22: 5559 msg is ReadWrite: -> fh=IO::Socket::INET=GLOB(0x3e9428), i=0, j=0:

The first failure category contains none of these lines.  The second contains
1000 lines with i=0 (and j from 0 to 999).  The first success case contains
the i=0 lines and also contains 1000 lines with i=1.  The second success case
adds 1000 lines with i=2.

There were 10 cases of failure1, 7 cases of failure2, 2 cases of success1 and
a single case of success2 out of the 20 attempts.

Examples of each mode (ellipsis for removed content):

=== failure mode 1 ===
17: pid 5534, ref dh is :GLOB
22: 5534 msg is Start:
Starting server: /usr/local/bin/perl -Iblib/lib -Iblib/arch t/server --mode=fork 
logfile=stderr debug
34: child 5536 is about to exit
22: 5536 msg is END: -> handle=undef:
22: 5536 msg is END: <-:
1..10

59: port :52585:
22: 5534 msg is CatchChild: ->:
22: 5534 msg is CatchChild: 5536:
=== end failure mode 1 ===

=== failure mode 2 ===
17: pid 5550, ref dh is :GLOB
22: 5550 msg is Start:
Starting server: /usr/local/bin/perl -Iblib/lib -Iblib/arch t/server --mode=fork
  logfile=stderr debug
34: child 5552 is about to exit
22: 5552 msg is END: -> handle=undef:
22: 5552 msg is END: <-:
1..10

59: port :52600:
22: 5550 msg is Spawning childs:
185: pid 5559
22: 5559 msg is Child starting:
22: 5559 msg is MyChild: -> 0:
22: 5550 msg is CatchChild: ->:
22: 5550 msg is CatchChild: 5552:
105: PeerPort :52600:
22: 5559 msg is ReadWrite: -> fh=IO::Socket::INET=GLOB(0x3e9428), i=0, j=0:
22: 5559 msg is ReadWrite: line=0
:
22: 5559 msg is ReadWrite: <-:
22: 5559 msg is ReadWrite: -> fh=IO::Socket::INET=GLOB(0x3e9428), i=0, j=1:
22: 5559 msg is ReadWrite: line=2
:
... (repeat blocks with line+=2, j+=1)
22: 5559 msg is ReadWrite: <-:
22: 5559 msg is ReadWrite: -> fh=IO::Socket::INET=GLOB(0x3e9428), i=0, j=999:
22: 5559 msg is ReadWrite: line=1998
:
22: 5559 msg is ReadWrite: <-:
22: 5559 msg is MyChild: <-:
121: PeerPort :52600:
192: ref fh is :GLOB:
22: 5559 msg is END: -> handle=undef:
22: 5559 msg is END: <-:
22: 5550 msg is CatchChild: 5559:
=== end failure mode 2 ===

=== success mode 1 ===
17: pid 5877, ref dh is :GLOB
22: 5877 msg is Start:
Starting server: /usr/local/bin/perl -Iblib/lib -Iblib/arch t/server --mode=fork
  logfile=stderr debug
34: child 5880 is about to exit
22: 5880 msg is END: -> handle=undef:
22: 5880 msg is END: <-:
1..10

59: port :52834:
22: 5877 msg is Spawning childs:
183: 5877 Created childs 5882
185: pid 5882
22: 5882 msg is Child starting:
22: 5882 msg is MyChild: -> 0:
185: pid 5883
22: 5883 msg is Child starting:
22: 5883 msg is MyChild: -> 1:
22: 5877 msg is CatchChild: ->:
22: 5877 msg is CatchChild: 5880:
105: PeerPort :52834:
22: 5882 msg is ReadWrite: -> fh=IO::Socket::INET=GLOB(0x3e94b0), i=0, j=0:
105: PeerPort :52834:
22: 5883 msg is ReadWrite: -> fh=IO::Socket::INET=GLOB(0x3e94b0), i=1, j=0:
22: 5882 msg is ReadWrite: line=0
:
... (middle removed)
22: 5882 msg is ReadWrite: <-:
22: 5882 msg is ReadWrite: -> fh=IO::Socket::INET=GLOB(0x3e94b0), i=0, j=999:
22: 5882 msg is ReadWrite: line=1998
:
22: 5882 msg is ReadWrite: <-:
22: 5882 msg is MyChild: <-:
121: PeerPort :52834:
192: ref fh is :GLOB:
22: 5882 msg is END: -> handle=undef:
22: 5882 msg is END: <-:
22: 5877 msg is CatchChild: 5882:
155: childs 5882 is :0
158: %childs is 0
22: 5877 msg is ShowResults: ->:
ok 1
ok 2
not ok 3
not ok 4
not ok 5
not ok 6
not ok 7
not ok 8
not ok 9
not ok 10
22: 5877 msg is ShowResults: <-:
22: 5877 msg is END: -> handle=Net::Daemon::Test::Fork=SCALAR(0x2cd3b4):

216 handle Net::Daemon::Test::Fork=SCALAR(0x2cd3b4)
22: 5877 msg is END: <-:
=== end success mode 1 ===

=== success mode 2 ===
17: pid 5918, ref dh is :GLOB
22: 5918 msg is Start:
Starting server: /usr/local/bin/perl -Iblib/lib -Iblib/arch t/server --mode=fork
  logfile=stderr debug
34: child 5920 is about to exit
22: 5920 msg is END: -> handle=undef:
22: 5920 msg is END: <-:
1..10

59: port :52866:
22: 5918 msg is Spawning childs:
183: 5918 Created childs 5940
185: pid 5940
22: 5940 msg is Child starting:
22: 5940 msg is MyChild: -> 0:
185: pid 5941
22: 5941 msg is Child starting:
22: 5941 msg is MyChild: -> 1:
183: 5918 Created childs 5941
105: PeerPort :52866:
22: 5940 msg is ReadWrite: -> fh=IO::Socket::INET=GLOB(0x3e9428), i=0, j=0:
185: pid 5942
22: 5942 msg is Child starting:
22: 5942 msg is MyChild: -> 2:
22: 5918 msg is CatchChild: ->:
105: PeerPort :52866:
22: 5941 msg is ReadWrite: -> fh=IO::Socket::INET=GLOB(0x3e9428), i=1, j=0:
22: 5918 msg is CatchChild: 5920:
105: PeerPort :52866:
22: 5942 msg is ReadWrite: -> fh=IO::Socket::INET=GLOB(0x3e9428), i=2, j=0:
22: 5940 msg is ReadWrite: line=0
:
... (many lines removed)
22: 5942 msg is ReadWrite: <-:
22: 5942 msg is ReadWrite: -> fh=IO::Socket::INET=GLOB(0x3e9428), i=2, j=578:
22: 5918 msg is CatchChild: 5941:
155: childs 5941 is :1
158: %childs is 0
22: 5918 msg is ShowResults: ->:
22: 5942 msg is ReadWrite: line=1156
:
22: 5942 msg is ReadWrite: <-:
22: 5942 msg is ReadWrite: -> fh=IO::Socket::INET=GLOB(0x3e9428), i=2, j=579:
22: 5942 msg is ReadWrite: line=1158
:
22: 5942 msg is ReadWrite: <-:
22: 5942 msg is ReadWrite: -> fh=IO::Socket::INET=GLOB(0x3e9428), i=2, j=580:
ok 1
ok 2
not ok 3
not ok 4
not ok 5
not ok 6
not ok 7
not ok 8
not ok 9
not ok 10
22: 5918 msg is ShowResults: <-:
22: 5942 msg is ReadWrite: line=1160
:
22: 5942 msg is ReadWrite: <-:
22: 5942 msg is ReadWrite: -> fh=IO::Socket::INET=GLOB(0x3e9428), i=2, j=581:
22: 5918 msg is END: -> handle=Net::Daemon::Test::Fork=SCALAR(0x2cd324):

216 handle Net::Daemon::Test::Fork=SCALAR(0x2cd324)
22: 5942 msg is ReadWrite: line=1162
:
22: 5942 msg is ReadWrite: <-:
22: 5942 msg is ReadWrite: -> fh=IO::Socket::INET=GLOB(0x3e9428), i=2, j=582:
22: 5918 msg is END: <-:
22: 5942 msg is ReadWrite: line=1164
:
... (many lines removed - all blocks with i=2)
22: 5942 msg is ReadWrite: <-:
22: 5942 msg is ReadWrite: -> fh=IO::Socket::INET=GLOB(0x3e9428), i=2, j=999:
22: 5942 msg is ReadWrite: line=1998
:
22: 5942 msg is ReadWrite: <-:
22: 5942 msg is MyChild: <-:
121: PeerPort :52866:
192: ref fh is :GLOB:
22: 5942 msg is END: -> handle=undef:
22: 5942 msg is END: <-:
=== end success mode 2 ===

From m.nooning@comcast.net on 2007-06-05 01:16:16 :

Thanks for the work.

I was hoping that the prints from one of the error sections would show.
 Unfortunately not one single one of them show.  Consequently there are
no tell-tale failures to back track on.

I'll have to give this more thought.  At this point I would welcome
suggestions from anyone.

Thanks

From lgoddard@cpan.org on 2007-06-05 14:55:08 :

This is now fine on Debian:

  CPAN.pm: Going to build M/MN/MNOONING/Net-Daemon/Net-Daemon-
0.41.tar.gz

Checking if your kit is complete...
Looks good
Writing Makefile for Net::Daemon
cp lib/Net/Daemon/Test.pm blib/lib/Net/Daemon/Test.pm
cp lib/Net/Daemon/Log.pm blib/lib/Net/Daemon/Log.pm
cp lib/Net/.svn/format blib/lib/Net/.svn/format
cp lib/Net/Daemon/.svn/format blib/lib/Net/Daemon/.svn/format
cp lib/.svn/entries blib/lib/.svn/entries
cp lib/Net/Daemon.pm blib/lib/Net/Daemon.pm
cp lib/Net/Daemon/.svn/text-base/Log.pm.svn-base 
blib/lib/Net/Daemon/.svn/text-base/Log.pm.svn-base
cp lib/Net/.svn/entries blib/lib/Net/.svn/entries
cp lib/Net/Daemon/.svn/text-base/Test.pm.svn-base 
blib/lib/Net/Daemon/.svn/text-base/Test.pm.svn-base
cp lib/Net/.svn/text-base/Daemon.pm.svn-base blib/lib/Net/.svn/text-
base/Daemon.pm.svn-base
cp lib/Net/Daemon/.svn/entries blib/lib/Net/Daemon/.svn/entries
cp lib/.svn/format blib/lib/.svn/format
Manifying blib/man3/Net::Daemon::Test.3pm
Manifying blib/man3/Net::Daemon::Log.3pm
Manifying blib/man3/Net::Daemon.3pm
  MNOONING/Net-Daemon/Net-Daemon-0.41.tar.gz
  /usr/bin/make -- OK
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-
e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/base..........ok
t/config........ok
t/fork..........ok
t/forkm.........ok
t/ithread.......Perl exited with active threads:
        0 running and unjoined
        1 finished and unjoined
        0 running and detached
t/ithread.......ok
t/ithreadm......ok
t/loop-child....ok
t/loop..........ok
t/single........ok
t/thread........skipped
        all skipped: no reason given
t/threadm.......ok
t/unix..........ok
All tests successful, 1 test skipped.
Files=12, Tests=68, 82 wallclock secs ( 5.47 cusr +  0.72 csys =  6.19 
CPU)
  MNOONING/Net-Daemon/Net-Daemon-0.41.tar.gz
  /usr/bin/make test -- OK
Running make install
Installing /usr/local/share/perl/5.8.4/Net/Daemon.pm
Installing /usr/local/share/perl/5.8.4/Net/Daemon/Test.pm
Installing /usr/local/share/perl/5.8.4/Net/Daemon/Log.pm
Installing /usr/local/share/perl/5.8.4/Net/Daemon/.svn/format
Installing /usr/local/share/perl/5.8.4/Net/Daemon/.svn/entries
Installing /usr/local/share/perl/5.8.4/Net/Daemon/.svn/text-
base/Log.pm.svn-base
Installing /usr/local/share/perl/5.8.4/Net/Daemon/.svn/text-
base/Test.pm.svn-base
Installing /usr/local/share/perl/5.8.4/Net/.svn/format
Installing /usr/local/share/perl/5.8.4/Net/.svn/entries
Installing /usr/local/share/perl/5.8.4/Net/.svn/text-base/Daemon.pm.svn-
base
Installing /usr/local/share/perl/5.8.4/.svn/entries
Installing /usr/local/share/perl/5.8.4/.svn/format
Installing /usr/local/man/man3/Net::Daemon::Test.3pm
Installing /usr/local/man/man3/Net::Daemon::Log.3pm
Installing /usr/local/man/man3/Net::Daemon.3pm
Writing /usr/local/lib/perl/5.8.4/auto/Net/Daemon/.packlist
Appending installation info to /usr/local/lib/perl/5.8.4/perllocal.pod
  MNOONING/Net-Daemon/Net-Daemon-0.41.tar.gz
  /usr/bin/make install  -- OK

lgoddard@uk-sandbox:~/trafficjam/trunk$ perl -V
Summary of my perl5 (revision 5 version 8 subversion 4) configuration:
  Platform:
    osname=linux, osvers=2.6.15.6, archname=i386-linux-thread-multi
    uname='linux ernie 2.6.15.6 #1 thu mar 16 13:11:55 est 2006 i686 
gnulinux '
    config_args='-Dusethreads -Duselargefiles -Dccflags=-DDEBIAN -
Dcccdlflags=-fPIC -Darchname=i386-linux -Dprefix=/usr -
Dprivlib=/usr/share/perl/5.8 -Darchlib=/usr/lib/perl/5.8 -
Dvendorprefix=/usr -Dvendorlib=/usr/share/perl5 -
Dvendorarch=/usr/lib/perl5 -Dsiteprefix=/usr/local -
Dsitelib=/usr/local/share/perl/5.8.4 -
Dsitearch=/usr/local/lib/perl/5.8.4 -Dman1dir=/usr/share/man/man1 -
Dman3dir=/usr/share/man/man3 -Dsiteman1dir=/usr/local/man/man1 -
Dsiteman3dir=/usr/local/man/man3 -Dman1ext=1 -Dman3ext=3perl -
Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Uusesfio -Uusenm -
Duseshrplib -Dlibperl=libperl.so.5.8.4 -Dd_dosuid -des'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define use5005threads=undef useithreads=define 
usemultiplicity=define
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -
DDEBIAN -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -
D_FILE_OFFSET_BITS=64',
    optimize='-O2',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN -
fno-strict-aliasing -I/usr/local/include'
    ccversion='', gccversion='3.3.5 (Debian 1:3.3.5-13)', 
gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', 
lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lgdbm -lgdbm_compat -ldb -ldl -lm -lpthread -lc -lcrypt
    perllibs=-ldl -lm -lpthread -lc -lcrypt
    libc=/lib/libc-2.3.2.so, so=so, useshrplib=true, 
libperl=libperl.so.5.8.4
    gnulibc_version='2.3.2'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'

Characteristics of this binary (from libperl):
  Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES 
PERL_IMPLICIT_CONTEXT
  Built under linux
  Compiled at May 10 2006 03:55:26
  @INC:
    /etc/perl
    /usr/local/lib/perl/5.8.4
    /usr/local/share/perl/5.8.4
    /usr/lib/perl5
    /usr/share/perl5
    /usr/lib/perl/5.8
    /usr/share/perl/5.8
    /usr/local/lib/site_perl
    .
lgoddard@uk-sandbox:~/trafficjam/trunk$

From m.nooning@comcast.net on 2007-06-15 01:14:56 :

Try this on Solaris 8.  Just below the ok statement on line 33 of
t/forkm.t, add the wait statement below.

    wait;

From feldt@nhn.ou.edu on 2007-06-15 14:06:25 :

That did it!  I ran the test 10 times just to make sure
(since it was clearly a timing issue) and it was successful
each time.  Thanks!

From m.nooning@comcast.net on 2007-06-16 20:14:58 :

Excellent.

Many thanks to Mr. Bowman for the tip.

Mr. Bowman, between yesterday and today my computer died.  I am on an
old one I keep around.  I am too lazy to dig into the emails of the dead
computers hard drive to figure out who wrote me with the "wait;" tip.  I
hope I am getting your name right.  In any case, good call.

I just added version Net-Daemon-0.42 to CPAN.  It should show up by
tomorrow morning.  Since you have Solaris, please download it and try it
out again, and let me know how it went.  If everything iss okay I will
then close out this bug.

Thanks

From mnooning@cpan.org on 2007-06-17 20:31:52 :

I needed to put in another version, 0.43, because I had .svn
(subversion) directories in the tar.gz file of 0.42, and I failed to inc
the version number in the proper .pm file.

Otherwise 0.43 is the same as 0.42.

Time and CPAN testers will tell us if this is fixed.
toddr commented 3 years ago

Given the age of this case, I'm going to assume it has been resolved. Please re-open if that is not the case.